fix: use sentence case for all UI text
Apply sentence case (first word capitalized, rest lowercase unless proper noun) to all user-facing text strings to comply with Obsidian UI guidelines. Changes: - Command names (already correct) - Notice messages - Button labels - Setting names - Modal titles Specific fixes: - "MCP Server" -> "MCP server" (in notices and headings) - "Server Status" -> "Server status" - "API Key Management" -> "API key management" - "MCP Client Configuration" -> "MCP client configuration" - "Start/Stop/Restart Server" -> "Start/stop/restart server" (buttons) - "View History" -> "View history" - "Copy Key" -> "Copy key" - "Regenerate Key" -> "Regenerate key" - "Copy Configuration" -> "Copy configuration" - "Export to Clipboard" -> "Export to clipboard" - "MCP Notification History" -> "MCP notification history" - "Authentication" -> "authentication" (in error message) All 760 tests pass.
This commit is contained in:
14
src/main.ts
14
src/main.ts
@@ -99,13 +99,13 @@ export default class MCPServerPlugin extends Plugin {
|
||||
|
||||
async startServer() {
|
||||
if (this.mcpServer?.isRunning()) {
|
||||
new Notice('MCP Server is already running');
|
||||
new Notice('MCP server is already running');
|
||||
return;
|
||||
}
|
||||
|
||||
// Validate authentication configuration
|
||||
if (this.settings.enableAuth && (!this.settings.apiKey || this.settings.apiKey.trim() === '')) {
|
||||
new Notice('⚠️ Cannot start server: Authentication is enabled but no API key is set. Please set an API key in settings or disable authentication.');
|
||||
new Notice('⚠️ Cannot start server: authentication is enabled but no API key is set. Please set an API key in settings or disable authentication.');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -116,28 +116,28 @@ export default class MCPServerPlugin extends Plugin {
|
||||
this.mcpServer.setNotificationManager(this.notificationManager);
|
||||
}
|
||||
await this.mcpServer.start();
|
||||
new Notice(`MCP Server started on port ${this.settings.port}`);
|
||||
new Notice(`MCP server started on port ${this.settings.port}`);
|
||||
this.updateStatusBar();
|
||||
} catch (error) {
|
||||
const message = error instanceof Error ? error.message : String(error);
|
||||
new Notice(`Failed to start MCP Server: ${message}`);
|
||||
new Notice(`Failed to start MCP server: ${message}`);
|
||||
console.error('MCP Server start error:', error);
|
||||
}
|
||||
}
|
||||
|
||||
async stopServer() {
|
||||
if (!this.mcpServer?.isRunning()) {
|
||||
new Notice('MCP Server is not running');
|
||||
new Notice('MCP server is not running');
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await this.mcpServer.stop();
|
||||
new Notice('MCP Server stopped');
|
||||
new Notice('MCP server stopped');
|
||||
this.updateStatusBar();
|
||||
} catch (error) {
|
||||
const message = error instanceof Error ? error.message : String(error);
|
||||
new Notice(`Failed to stop MCP Server: ${message}`);
|
||||
new Notice(`Failed to stop MCP server: ${message}`);
|
||||
console.error('MCP Server stop error:', error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ export class MCPServerSettingTab extends PluginSettingTab {
|
||||
.setName('Notification history')
|
||||
.setDesc('View recent MCP tool calls')
|
||||
.addButton(button => button
|
||||
.setButtonText('View History')
|
||||
.setButtonText('View history')
|
||||
.onClick(() => {
|
||||
this.plugin.showNotificationHistory();
|
||||
}));
|
||||
@@ -129,12 +129,12 @@ export class MCPServerSettingTab extends PluginSettingTab {
|
||||
|
||||
new Setting(containerEl)
|
||||
.setHeading()
|
||||
.setName('MCP Server Settings');
|
||||
.setName('MCP server settings');
|
||||
|
||||
// Server status
|
||||
new Setting(containerEl)
|
||||
.setHeading()
|
||||
.setName('Server Status');
|
||||
.setName('Server status');
|
||||
|
||||
const statusEl = containerEl.createEl('div', {cls: 'mcp-server-status'});
|
||||
const isRunning = this.plugin.mcpServer?.isRunning() ?? false;
|
||||
@@ -149,7 +149,7 @@ export class MCPServerSettingTab extends PluginSettingTab {
|
||||
const buttonContainer = containerEl.createEl('div', {cls: 'mcp-button-container'});
|
||||
|
||||
if (isRunning) {
|
||||
buttonContainer.createEl('button', {text: 'Stop Server'})
|
||||
buttonContainer.createEl('button', {text: 'Stop server'})
|
||||
.addEventListener('click', () => {
|
||||
void (async () => {
|
||||
await this.plugin.stopServer();
|
||||
@@ -157,7 +157,7 @@ export class MCPServerSettingTab extends PluginSettingTab {
|
||||
})();
|
||||
});
|
||||
|
||||
buttonContainer.createEl('button', {text: 'Restart Server'})
|
||||
buttonContainer.createEl('button', {text: 'Restart server'})
|
||||
.addEventListener('click', () => {
|
||||
void (async () => {
|
||||
await this.plugin.stopServer();
|
||||
@@ -166,7 +166,7 @@ export class MCPServerSettingTab extends PluginSettingTab {
|
||||
})();
|
||||
});
|
||||
} else {
|
||||
buttonContainer.createEl('button', {text: 'Start Server'})
|
||||
buttonContainer.createEl('button', {text: 'Start server'})
|
||||
.addEventListener('click', () => {
|
||||
void (async () => {
|
||||
await this.plugin.startServer();
|
||||
@@ -214,7 +214,7 @@ export class MCPServerSettingTab extends PluginSettingTab {
|
||||
|
||||
// API Key Display (always show - auth is always enabled)
|
||||
new Setting(authDetails)
|
||||
.setName('API Key Management')
|
||||
.setName('API key management')
|
||||
.setDesc('Use as Bearer token in Authorization header');
|
||||
|
||||
// Create a full-width container for buttons and key display
|
||||
@@ -224,7 +224,7 @@ export class MCPServerSettingTab extends PluginSettingTab {
|
||||
const apiKeyButtonContainer = apiKeyContainer.createDiv({cls: 'mcp-button-group'});
|
||||
|
||||
// Copy button
|
||||
const copyButton = apiKeyButtonContainer.createEl('button', {text: '📋 Copy Key'});
|
||||
const copyButton = apiKeyButtonContainer.createEl('button', {text: '📋 Copy key'});
|
||||
copyButton.addEventListener('click', () => {
|
||||
void (async () => {
|
||||
await navigator.clipboard.writeText(this.plugin.settings.apiKey || '');
|
||||
@@ -233,7 +233,7 @@ export class MCPServerSettingTab extends PluginSettingTab {
|
||||
});
|
||||
|
||||
// Regenerate button
|
||||
const regenButton = apiKeyButtonContainer.createEl('button', {text: '🔄 Regenerate Key'});
|
||||
const regenButton = apiKeyButtonContainer.createEl('button', {text: '🔄 Regenerate key'});
|
||||
regenButton.addEventListener('click', () => {
|
||||
void (async () => {
|
||||
this.plugin.settings.apiKey = generateApiKey();
|
||||
@@ -253,7 +253,7 @@ export class MCPServerSettingTab extends PluginSettingTab {
|
||||
// MCP Client Configuration heading
|
||||
new Setting(authDetails)
|
||||
.setHeading()
|
||||
.setName('MCP Client Configuration');
|
||||
.setName('MCP client configuration');
|
||||
|
||||
const configContainer = authDetails.createDiv({cls: 'mcp-container'});
|
||||
|
||||
@@ -297,7 +297,7 @@ export class MCPServerSettingTab extends PluginSettingTab {
|
||||
|
||||
// Copy button
|
||||
const copyConfigButton = tabContent.createEl('button', {
|
||||
text: '📋 Copy Configuration',
|
||||
text: '📋 Copy configuration',
|
||||
cls: 'mcp-config-button'
|
||||
});
|
||||
copyConfigButton.addEventListener('click', () => {
|
||||
@@ -428,7 +428,7 @@ export class MCPServerSettingTab extends PluginSettingTab {
|
||||
|
||||
// Copy button
|
||||
const copyConfigButton = tabContent.createEl('button', {
|
||||
text: '📋 Copy Configuration',
|
||||
text: '📋 Copy configuration',
|
||||
cls: 'mcp-config-button'
|
||||
});
|
||||
copyConfigButton.addEventListener('click', () => {
|
||||
|
||||
@@ -26,7 +26,7 @@ export class NotificationHistoryModal extends Modal {
|
||||
contentEl.addClass('mcp-notification-history-modal');
|
||||
|
||||
// Title
|
||||
contentEl.createEl('h2', { text: 'MCP Notification History' });
|
||||
contentEl.createEl('h2', { text: 'MCP notification history' });
|
||||
|
||||
// Filters (create once, never recreate)
|
||||
this.createFilters(contentEl);
|
||||
@@ -161,7 +161,7 @@ export class NotificationHistoryModal extends Modal {
|
||||
const actionsContainer = containerEl.createDiv({ cls: 'mcp-history-actions' });
|
||||
|
||||
// Export button
|
||||
const exportButton = actionsContainer.createEl('button', { text: 'Export to Clipboard' });
|
||||
const exportButton = actionsContainer.createEl('button', { text: 'Export to clipboard' });
|
||||
exportButton.addEventListener('click', () => {
|
||||
void (async () => {
|
||||
const exportData = JSON.stringify(this.filteredHistory, null, 2);
|
||||
@@ -169,7 +169,7 @@ export class NotificationHistoryModal extends Modal {
|
||||
// Show temporary success message
|
||||
exportButton.textContent = '✅ Copied!';
|
||||
setTimeout(() => {
|
||||
exportButton.textContent = 'Export to Clipboard';
|
||||
exportButton.textContent = 'Export to clipboard';
|
||||
}, 2000);
|
||||
})();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user