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:
2025-11-07 11:35:05 -05:00
parent f04991fc12
commit 206c0aaf8a
3 changed files with 22 additions and 22 deletions

View File

@@ -99,13 +99,13 @@ export default class MCPServerPlugin extends Plugin {
async startServer() { async startServer() {
if (this.mcpServer?.isRunning()) { if (this.mcpServer?.isRunning()) {
new Notice('MCP Server is already running'); new Notice('MCP server is already running');
return; return;
} }
// Validate authentication configuration // Validate authentication configuration
if (this.settings.enableAuth && (!this.settings.apiKey || this.settings.apiKey.trim() === '')) { 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; return;
} }
@@ -116,28 +116,28 @@ export default class MCPServerPlugin extends Plugin {
this.mcpServer.setNotificationManager(this.notificationManager); this.mcpServer.setNotificationManager(this.notificationManager);
} }
await this.mcpServer.start(); 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(); this.updateStatusBar();
} catch (error) { } catch (error) {
const message = error instanceof Error ? error.message : String(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); console.error('MCP Server start error:', error);
} }
} }
async stopServer() { async stopServer() {
if (!this.mcpServer?.isRunning()) { if (!this.mcpServer?.isRunning()) {
new Notice('MCP Server is not running'); new Notice('MCP server is not running');
return; return;
} }
try { try {
await this.mcpServer.stop(); await this.mcpServer.stop();
new Notice('MCP Server stopped'); new Notice('MCP server stopped');
this.updateStatusBar(); this.updateStatusBar();
} catch (error) { } catch (error) {
const message = error instanceof Error ? error.message : String(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); console.error('MCP Server stop error:', error);
} }
} }

View File

@@ -65,7 +65,7 @@ export class MCPServerSettingTab extends PluginSettingTab {
.setName('Notification history') .setName('Notification history')
.setDesc('View recent MCP tool calls') .setDesc('View recent MCP tool calls')
.addButton(button => button .addButton(button => button
.setButtonText('View History') .setButtonText('View history')
.onClick(() => { .onClick(() => {
this.plugin.showNotificationHistory(); this.plugin.showNotificationHistory();
})); }));
@@ -129,12 +129,12 @@ export class MCPServerSettingTab extends PluginSettingTab {
new Setting(containerEl) new Setting(containerEl)
.setHeading() .setHeading()
.setName('MCP Server Settings'); .setName('MCP server settings');
// Server status // Server status
new Setting(containerEl) new Setting(containerEl)
.setHeading() .setHeading()
.setName('Server Status'); .setName('Server status');
const statusEl = containerEl.createEl('div', {cls: 'mcp-server-status'}); const statusEl = containerEl.createEl('div', {cls: 'mcp-server-status'});
const isRunning = this.plugin.mcpServer?.isRunning() ?? false; 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'}); const buttonContainer = containerEl.createEl('div', {cls: 'mcp-button-container'});
if (isRunning) { if (isRunning) {
buttonContainer.createEl('button', {text: 'Stop Server'}) buttonContainer.createEl('button', {text: 'Stop server'})
.addEventListener('click', () => { .addEventListener('click', () => {
void (async () => { void (async () => {
await this.plugin.stopServer(); 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', () => { .addEventListener('click', () => {
void (async () => { void (async () => {
await this.plugin.stopServer(); await this.plugin.stopServer();
@@ -166,7 +166,7 @@ export class MCPServerSettingTab extends PluginSettingTab {
})(); })();
}); });
} else { } else {
buttonContainer.createEl('button', {text: 'Start Server'}) buttonContainer.createEl('button', {text: 'Start server'})
.addEventListener('click', () => { .addEventListener('click', () => {
void (async () => { void (async () => {
await this.plugin.startServer(); await this.plugin.startServer();
@@ -214,7 +214,7 @@ export class MCPServerSettingTab extends PluginSettingTab {
// API Key Display (always show - auth is always enabled) // API Key Display (always show - auth is always enabled)
new Setting(authDetails) new Setting(authDetails)
.setName('API Key Management') .setName('API key management')
.setDesc('Use as Bearer token in Authorization header'); .setDesc('Use as Bearer token in Authorization header');
// Create a full-width container for buttons and key display // 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'}); const apiKeyButtonContainer = apiKeyContainer.createDiv({cls: 'mcp-button-group'});
// Copy button // Copy button
const copyButton = apiKeyButtonContainer.createEl('button', {text: '📋 Copy Key'}); const copyButton = apiKeyButtonContainer.createEl('button', {text: '📋 Copy key'});
copyButton.addEventListener('click', () => { copyButton.addEventListener('click', () => {
void (async () => { void (async () => {
await navigator.clipboard.writeText(this.plugin.settings.apiKey || ''); await navigator.clipboard.writeText(this.plugin.settings.apiKey || '');
@@ -233,7 +233,7 @@ export class MCPServerSettingTab extends PluginSettingTab {
}); });
// Regenerate button // Regenerate button
const regenButton = apiKeyButtonContainer.createEl('button', {text: '🔄 Regenerate Key'}); const regenButton = apiKeyButtonContainer.createEl('button', {text: '🔄 Regenerate key'});
regenButton.addEventListener('click', () => { regenButton.addEventListener('click', () => {
void (async () => { void (async () => {
this.plugin.settings.apiKey = generateApiKey(); this.plugin.settings.apiKey = generateApiKey();
@@ -253,7 +253,7 @@ export class MCPServerSettingTab extends PluginSettingTab {
// MCP Client Configuration heading // MCP Client Configuration heading
new Setting(authDetails) new Setting(authDetails)
.setHeading() .setHeading()
.setName('MCP Client Configuration'); .setName('MCP client configuration');
const configContainer = authDetails.createDiv({cls: 'mcp-container'}); const configContainer = authDetails.createDiv({cls: 'mcp-container'});
@@ -297,7 +297,7 @@ export class MCPServerSettingTab extends PluginSettingTab {
// Copy button // Copy button
const copyConfigButton = tabContent.createEl('button', { const copyConfigButton = tabContent.createEl('button', {
text: '📋 Copy Configuration', text: '📋 Copy configuration',
cls: 'mcp-config-button' cls: 'mcp-config-button'
}); });
copyConfigButton.addEventListener('click', () => { copyConfigButton.addEventListener('click', () => {
@@ -428,7 +428,7 @@ export class MCPServerSettingTab extends PluginSettingTab {
// Copy button // Copy button
const copyConfigButton = tabContent.createEl('button', { const copyConfigButton = tabContent.createEl('button', {
text: '📋 Copy Configuration', text: '📋 Copy configuration',
cls: 'mcp-config-button' cls: 'mcp-config-button'
}); });
copyConfigButton.addEventListener('click', () => { copyConfigButton.addEventListener('click', () => {

View File

@@ -26,7 +26,7 @@ export class NotificationHistoryModal extends Modal {
contentEl.addClass('mcp-notification-history-modal'); contentEl.addClass('mcp-notification-history-modal');
// Title // Title
contentEl.createEl('h2', { text: 'MCP Notification History' }); contentEl.createEl('h2', { text: 'MCP notification history' });
// Filters (create once, never recreate) // Filters (create once, never recreate)
this.createFilters(contentEl); this.createFilters(contentEl);
@@ -161,7 +161,7 @@ export class NotificationHistoryModal extends Modal {
const actionsContainer = containerEl.createDiv({ cls: 'mcp-history-actions' }); const actionsContainer = containerEl.createDiv({ cls: 'mcp-history-actions' });
// Export button // Export button
const exportButton = actionsContainer.createEl('button', { text: 'Export to Clipboard' }); const exportButton = actionsContainer.createEl('button', { text: 'Export to clipboard' });
exportButton.addEventListener('click', () => { exportButton.addEventListener('click', () => {
void (async () => { void (async () => {
const exportData = JSON.stringify(this.filteredHistory, null, 2); const exportData = JSON.stringify(this.filteredHistory, null, 2);
@@ -169,7 +169,7 @@ export class NotificationHistoryModal extends Modal {
// Show temporary success message // Show temporary success message
exportButton.textContent = '✅ Copied!'; exportButton.textContent = '✅ Copied!';
setTimeout(() => { setTimeout(() => {
exportButton.textContent = 'Export to Clipboard'; exportButton.textContent = 'Export to clipboard';
}, 2000); }, 2000);
})(); })();
}); });