M1.8: command palette, global keymap, UI commands
- Engine: ui.registerCommands (validated, replaces the previous set),
UI commands in listCommands with ui: true and labelKey, running one
through the engine emits uiCommand {id, params}.
- Frontend: ui/src/commands/ (keymap by key code, fuzzy ranking, Pinia
commands store with handlers, recents and error toasts), the command
palette (Mod+Shift+P), UI commands palette.open, settings.open (Mod+,,
disabled until M1.9b) and view.toggleProjectTree (Mod+1). The editor's
shortcuts.ts moved into the global keymap.
- Tests: engine and control-channel tests for registration and
uiCommand, Vitest for keymap, ranking, store, palette and App wiring.
- Docs: architecture, ui-parity, target-app-parity, gaps, roadmap,
ROADMAP, README.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
2f8fef876b
commit
184b8a3468
33 changed files with 2282 additions and 233 deletions
|
|
@ -27,9 +27,12 @@ function sourceFiles(dir: string): string[] {
|
|||
});
|
||||
}
|
||||
|
||||
/** Every call of `t` with a literal first argument, by file. */
|
||||
/**
|
||||
* Every call of `t` with a literal first argument, and every literal
|
||||
* `labelKey` (UI commands, whose labels the palette looks up), by file.
|
||||
*/
|
||||
const usedKeys = sourceFiles(SRC).flatMap((file) =>
|
||||
[...readFileSync(file, "utf8").matchAll(/\bt\(\s*(["'`])([^"'`]*)\1/g)].map((m) => ({
|
||||
[...readFileSync(file, "utf8").matchAll(/(?:\bt\(|\blabelKey:)\s*(["'`])([^"'`]*)\1/g)].map((m) => ({
|
||||
file,
|
||||
key: m[2] ?? "",
|
||||
})),
|
||||
|
|
@ -105,7 +108,7 @@ describe("en.json", () => {
|
|||
it("uses flat dotted keys of known areas with string values", () => {
|
||||
for (const [key, value] of Object.entries(en)) {
|
||||
expect(key).toMatch(
|
||||
/^(app|project|editor|common|theme|recovery|notification)\.[A-Za-z0-9]+(\.[A-Za-z0-9]+)*$/,
|
||||
/^(app|command|project|editor|common|palette|theme|recovery|notification)\.[A-Za-z0-9]+(\.[A-Za-z0-9]+)*$/,
|
||||
);
|
||||
expect(typeof value).toBe("string");
|
||||
expect(value.trim()).not.toBe("");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue