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
|
|
@ -2,8 +2,9 @@
|
|||
* Tests for the editor area and the editor store: opening tabs (from the
|
||||
* tree and from engine events), editing through CodeMirror into
|
||||
* `buffer.edit`, the dirty marker, closing (middle click, shortcut, the
|
||||
* Save / Don't Save / Cancel question), saving through shortcuts loaded
|
||||
* from the engine's command list, and the notice for files changed on disk.
|
||||
* Save / Don't Save / Cancel question), saving through the global keymap
|
||||
* (`commands/store.ts`) with shortcuts loaded from the engine's command
|
||||
* list, and the notice for files changed on disk.
|
||||
* The engine is a fake behind the mocked Tauri `invoke`.
|
||||
*/
|
||||
import { flushPromises, mount, type VueWrapper } from "@vue/test-utils";
|
||||
|
|
@ -14,6 +15,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|||
const invoke = vi.hoisted(() => vi.fn());
|
||||
vi.mock("@tauri-apps/api/core", () => ({ invoke }));
|
||||
|
||||
import { useCommandsStore } from "../../src/commands/store";
|
||||
import EditorArea from "../../src/components/editor/EditorArea.vue";
|
||||
import { emitEditorEvent } from "../../src/components/editor/engineEvents";
|
||||
import { emitEngineEvent } from "../../src/components/project/engineEvents";
|
||||
|
|
@ -159,8 +161,9 @@ let pinia: Pinia;
|
|||
/** Mounted components to unmount after each test. */
|
||||
let mounted: VueWrapper[] = [];
|
||||
|
||||
/** Mounts the editor area. */
|
||||
/** Mounts the editor area and starts the global keymap. */
|
||||
async function mountArea(): Promise<VueWrapper> {
|
||||
await useCommandsStore(pinia).start();
|
||||
const wrapper = mount(EditorArea, {
|
||||
attachTo: document.body,
|
||||
slots: { default: "empty" },
|
||||
|
|
@ -236,6 +239,7 @@ beforeEach(() => {
|
|||
|
||||
afterEach(async () => {
|
||||
await flushPromises();
|
||||
useCommandsStore(pinia).stop();
|
||||
for (const wrapper of mounted) {
|
||||
wrapper.unmount();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue