perf(settings): batch store registrations and defer font enumeration (#4058)

Settings pages, parent action proxies and template actions registered one by one, cloning the store map and notifying subscribers per item (~1,650 action and ~172 page updates per Settings open). registerActions now disposes in one update too, and the new registerSettingsPages batches page registration and disposal; both keep later per-id overrides. Disabled font pickers no longer enumerate system fonts; enabled ones defer it to idle and load at once on interaction, and the icon-font probe waits past startup.

Co-authored-by: dengliu <[email protected]>
Цей коміт міститься в:
Deng Liuтаdengliu authored and GitHub committed 2026-11-18 09:10:40 +08:00
1 джерело 0e169cc653
коміт 606a66b5dd
14 files changed
+290 -103

No files matched your search

+11 -12
Переглянути файл
@@ -17,7 +17,7 @@ import {
registerMenuGroup,
registerMenuSlotItem,
registerOverlay,
registerSettingsPage,
registerSettingsPages,
registerStatusItem,
registerToolWindow,
toolWindowService,
@@ -55,8 +55,8 @@ import { replyActions } from "./replyActions";
/** Settings › Agents › Coding Agents and Settings › Agents › External MCP Servers (also used by the Settings window). */
export function activateSettingsPages(): () => void {
const disposers = [
registerSettingsPage({
return registerSettingsPages([
{
id: REGISTRY_PAGE,
title: "Coding Agents",
group: AGENTS_GROUP,
@@ -64,8 +64,8 @@ export function activateSettingsPages(): () => void {
order: 450,
keywords: ["agent", "acp", "registry", "install", "update", "coding agent"],
component: lazyComponent(() => import("./AgentRegistryPage").then((m) => m.AgentRegistryPage)),
}),
registerSettingsPage({
},
{
id: WORKING_STATUS_PAGE,
title: "Working Status",
group: AGENTS_GROUP,
@@ -73,25 +73,24 @@ export function activateSettingsPages(): () => void {
order: 465,
keywords: ["agent", "status", "playful", "words", "working", "spinner", "fun", "delay", "seconds"],
component: lazyComponent(() => import("./WorkingStatusPage").then((m) => m.WorkingStatusPage)),
}),
registerSettingsPage({
},
{
id: MCP_PAGE,
title: "External MCP Servers",
group: AGENTS_GROUP,
order: 475,
keywords: ["mcp", "model context protocol", "servers", "tools", "agent"],
component: lazyComponent(() => import("./McpServersPage").then((m) => m.McpServersPage)),
}),
registerSettingsPage({
},
{
id: POLICY_PAGE,
title: "Command Permissions",
group: AGENTS_GROUP,
order: 490,
keywords: ["agent", "policy", "security", "whitelist", "blacklist", "permission", "command", "exec"],
component: lazyComponent(() => import("./AgentPolicyPage").then((m) => m.AgentPolicyPage)),
}),
];
return () => disposers.reverse().forEach((d) => d());
},
]);
}
export function activate(): () => void {