Add Tools/Help menus and preferences dialog

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
2026-11-13 17:00:08 +08:00
parent 4efeadbee3
commit cbd2690993
7 changed files with 126 additions and 2 deletions

View File

@@ -47,8 +47,14 @@ export function workbenchById(manifest: DesktopManifest, id: string): DesktopWor
return manifest.workbenches.find(item => item.id === id);
}
const humanize = (command: string) => {
const stripped = command.replace(/^[A-Za-z0-9]+_/, "").replace(/_/g, " ");
const spaced = stripped.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/\s+/g, " ").trim();
return spaced || command;
};
export function commandLabel(manifest: DesktopManifest, command: string): string {
return manifest.commandMetadata[command]?.menuText?.trim() || command;
return manifest.commandMetadata[command]?.menuText?.trim() || humanize(command);
}
export function commandTooltip(manifest: DesktopManifest, command: string): string {