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
|
|
@ -129,6 +129,14 @@ pub enum Event {
|
|||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
params: Option<Map<String, Value>>,
|
||||
},
|
||||
/// A UI command registered with `ui.registerCommands` was run through
|
||||
/// the engine (control channel, later MCP); the frontend executes it.
|
||||
UiCommand {
|
||||
/// Command id, e.g. `palette.open`.
|
||||
id: String,
|
||||
/// The params the command was run with, as given.
|
||||
params: Value,
|
||||
},
|
||||
}
|
||||
|
||||
/// Severity of an [`Event::Notification`].
|
||||
|
|
@ -208,4 +216,16 @@ mod tests {
|
|||
json!({"kind": "themeChanged", "id": "lutra-light", "dark": false, "tokens": {"--lt-bg": "#f4f1ec"}})
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn ui_command_shape() {
|
||||
let e = Event::UiCommand {
|
||||
id: "palette.open".into(),
|
||||
params: json!({}),
|
||||
};
|
||||
assert_eq!(
|
||||
serde_json::to_value(e).unwrap(),
|
||||
json!({"kind": "uiCommand", "id": "palette.open", "params": {}})
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue