fix(settings): stabilize MCP permission layout

This commit is contained in:
ptma authored and GitHub committed 2026-07-21 16:59:02 +08:00
1 parent 727290fa32
commit 5fcebb5c08
4 files changed
+151 -66

No files matched your search

@@ -82,7 +82,6 @@ describe("MCP policy settings state", () => {
expect(settingsDialogSource).toContain("if (mcpPolicyControlsDisabled.value) return;");
expect(settingsDialogSource).toContain(':disabled="mcpPolicyControlsDisabled"');
expect(settingsDialogSource).toContain('@update:allowed-connection-ids="onMcpAllowedConnectionIdsChange"');
expect(settingsDialogSource).toContain('<fieldset :disabled="mcpPolicyControlsDisabled"');
const loadingStart = settingsDialogSource.indexOf("mcpPolicyLoading.value = true;");
const policyLoad = settingsDialogSource.indexOf("await settingsStore.initMcpGlobalPolicy(true);");
@@ -103,6 +102,13 @@ describe("MCP policy settings state", () => {
expect(descriptionSource.match(/col-start-1 row-start-1/g)).toHaveLength(3);
expect(descriptionSource.match(/\? 'visible' : 'invisible'/g)).toHaveLength(3);
});
it("keeps execution mode cards accessible as a keyboard radio group", () => {
expect(settingsDialogSource).toContain('role="radiogroup" aria-labelledby="mcp-execution-mode-label"');
expect(settingsDialogSource.match(/role="radio"/g)).toHaveLength(3);
expect(settingsDialogSource).toContain(":aria-checked=\"mcpExecutionMode === 'safe_write'\"");
expect(settingsDialogSource).toContain("onMcpExecutionModeKeydown($event, 'safe_write')");
});
});
describe("MCP connection search", () => {