Lutra/ui/src/commands/uiCommands.ts
danny 097bbd9409 M2.4: Find tool window in a new bottom panel
- Bottom panel under editor and project tree (resizable, collapsible,
  closable) for Find and later tool windows.
- Find store: search.find with options and include/exclude globs, results
  streamed and sorted by file, events held until the searchId answer, a
  new search cancels the running one, refused queries shown in place.
- Find tool window: toggles, counts, cancel, truncated hint, highlighted
  previews, keyboard navigation, Enter or click runs editor.reveal.
- UI command find.open (Mod+Alt+F) with prefill from the selection or the
  word at the cursor; find.open {query} from agents searches at once.
- 26 Vitest tests; progress docs and architecture updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 12:42:53 +02:00

29 lines
1.2 KiB
TypeScript

/**
* UI commands: commands the frontend runs itself. They are registered with
* the engine (`ui.registerCommands`) so `listCommands`, the palette, the
* keymap and agents see them; running one through the engine comes back as
* a `uiCommand` event. Components supply the behaviour with
* `useCommandsStore().provide(id, handler)`; a UI command nobody provides
* is disabled.
*/
/** A UI command as registered with the engine. */
export interface UiCommandSpec {
/** Command id, `area.action` in camelCase. */
id: string;
/** Catalog key of the label. */
labelKey: string;
/** Menu path with `/` separators. */
menuPath?: string;
/** Default shortcut in Lutra notation. */
defaultShortcut?: string;
}
/** The frontend's UI commands. */
export const UI_COMMANDS: readonly UiCommandSpec[] = [
{ id: "editor.reveal", labelKey: "command.editor.reveal" },
{ id: "find.open", labelKey: "command.find.open", defaultShortcut: "Mod+Alt+F" },
{ id: "palette.open", labelKey: "command.palette.open", defaultShortcut: "Mod+Shift+P" },
{ id: "settings.open", labelKey: "command.settings.open", defaultShortcut: "Mod+," },
{ id: "view.toggleProjectTree", labelKey: "command.view.toggleProjectTree", defaultShortcut: "Mod+1" },
];