Lutra/ui/src/App.vue
danny 184b8a3468 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>
2026-10-16 16:59:43 +02:00

61 lines
1.9 KiB
Vue

<script setup lang="ts">
/**
* Root component: mounts the main window layout with the editor area; the
* slogan shows while no tab is open, and the restore dialog for unsaved
* texts from the recovery journal, the toast stack and the command
* palette. Loads product information from the engine on mount, starts
* showing notifications, following the theme (see `theme.ts`; a failed
* theme report raises an error toast) and the global keymap with the UI
* commands (see `commands/store.ts`).
*/
import { onMounted, onUnmounted } from "vue";
import { useCommandsStore } from "./commands/store";
import CommandPalette from "./components/palette/CommandPalette.vue";
import EditorArea from "./components/editor/EditorArea.vue";
import MainLayout from "./components/layout/MainLayout.vue";
import NotificationStack from "./components/notifications/NotificationStack.vue";
import RecoveryDialog from "./components/recovery/RecoveryDialog.vue";
import { useAppStore } from "./stores/app";
import { useNotificationsStore } from "./stores/notifications";
import { startTheme } from "./theme";
const app = useAppStore();
const notifications = useNotificationsStore();
const commands = useCommandsStore();
/** Stops following the theme; set while mounted. */
let stopTheme: (() => void) | null = null;
onMounted(() => {
notifications.start();
stopTheme = startTheme((error) => notifications.notifyError("theme.systemPreference", error));
void commands.start();
void app.loadAbout();
});
onUnmounted(() => {
stopTheme?.();
stopTheme = null;
commands.stop();
notifications.stop();
});
</script>
<template>
<MainLayout>
<EditorArea>
<p class="workbench__hint">
{{ app.about?.slogan ?? "" }}
</p>
</EditorArea>
</MainLayout>
<RecoveryDialog />
<CommandPalette />
<NotificationStack />
</template>
<style scoped>
.workbench__hint {
color: var(--lt-fg-muted);
}
</style>