fix: use Setting.setHeading() instead of createElement for headings

Replace createEl('h2'), createEl('h3'), and createEl('h4') with
Setting().setHeading().setName() in settings.ts to comply with
Obsidian plugin submission requirements. The Setting API provides
consistent styling and is the recommended approach for settings tabs.

Changes:
- Replace h2 heading for 'MCP Server Settings'
- Replace h3 heading for 'Server Status'
- Replace h4 heading for 'MCP Client Configuration'
- Remove custom 'mcp-heading' class (Setting API provides styling)

Note: Modal headings in notification-history.ts are unchanged as they
use the standard Modal API which is separate from the Settings API.
This commit is contained in:
2025-11-07 11:32:05 -05:00
parent ceeefe1eeb
commit f04991fc12

View File

@@ -127,10 +127,14 @@ export class MCPServerSettingTab extends PluginSettingTab {
this.authDetailsEl = null;
this.configContainerEl = null;
containerEl.createEl('h2', {text: 'MCP Server Settings'});
new Setting(containerEl)
.setHeading()
.setName('MCP Server Settings');
// Server status
containerEl.createEl('h3', {text: 'Server Status'});
new Setting(containerEl)
.setHeading()
.setName('Server Status');
const statusEl = containerEl.createEl('div', {cls: 'mcp-server-status'});
const isRunning = this.plugin.mcpServer?.isRunning() ?? false;
@@ -247,7 +251,9 @@ export class MCPServerSettingTab extends PluginSettingTab {
keyDisplayContainer.textContent = this.plugin.settings.apiKey || '';
// MCP Client Configuration heading
authDetails.createEl('h4', {text: 'MCP Client Configuration', cls: 'mcp-heading'});
new Setting(authDetails)
.setHeading()
.setName('MCP Client Configuration');
const configContainer = authDetails.createDiv({cls: 'mcp-container'});