refactor: make authentication section collapsible

- Wrap Authentication in details/summary for progressive disclosure
- Update containerEl references to authDetails within the section
- Simplify API Key description from "Use this key in the Authorization header as Bearer token" to "Use as Bearer token in Authorization header"
This commit is contained in:
2025-10-26 08:26:16 -04:00
parent 9cf83ed185
commit d37327e50d

View File

@@ -84,15 +84,22 @@ export class MCPServerSettingTab extends PluginSettingTab {
}));
// Authentication (Always Enabled)
containerEl.createEl('h3', {text: 'Authentication'});
const authDetails = containerEl.createEl('details');
authDetails.style.marginBottom = '20px';
const authSummary = authDetails.createEl('summary');
authSummary.style.fontSize = '1.17em';
authSummary.style.fontWeight = 'bold';
authSummary.style.marginBottom = '12px';
authSummary.style.cursor = 'pointer';
authSummary.setText('Authentication');
// API Key Display (always show - auth is always enabled)
new Setting(containerEl)
new Setting(authDetails)
.setName('API Key Management')
.setDesc('Use this key in the Authorization header as Bearer token');
.setDesc('Use as Bearer token in Authorization header');
// Create a full-width container for buttons and key display
const apiKeyContainer = containerEl.createDiv({cls: 'mcp-api-key-section'});
const apiKeyContainer = authDetails.createDiv({cls: 'mcp-api-key-section'});
apiKeyContainer.style.marginBottom = '20px';
apiKeyContainer.style.marginLeft = '0';