A1: tab management: preview tabs, pinning, close actions, reopen closed tab, split into two groups
Some checks are pending
ci / ci (macos-15) (push) Waiting to run
ci / ci (ubuntu-24.04) (push) Waiting to run
ci / ci (windows-2025) (push) Waiting to run

- Pure tab model (components/editor/tabs/model.ts) with Vitest coverage.
- Editor store keeps one buffer sync per buffer and a group layout; a buffer
  in both groups shares text and undo. Bulk closes ask once with a list.
- Tab context menu, tabs.* UI commands (COMMAND_IDS) in a Window menu group,
  no default shortcuts; Show Local History appears once history.show exists.
- Single click in the tree, Find and Go-to opens preview tabs.
- Layout stored through layout.set and restored on project open.
- Public API for other areas: tabOfPath, tabOf, reloadBuffer, openFile.
- Docs: ui-parity, gaps (G2), architecture.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
danny 2026-11-08 12:18:28 +01:00
parent 02922eb89d
commit 7f309dbc4e
28 changed files with 3003 additions and 211 deletions

View file

@ -150,6 +150,17 @@ export const useCommandsStore = defineStore("commands", () => {
return info !== undefined && info.ui !== true && info.enabled;
}
/**
* Whether a command exists: the engine lists it, it is a UI command, or a
* component supplies a handler. Menus hide items of commands another
* area adds later.
*
* @param id - the command id.
*/
function isKnown(id: string): boolean {
return handlers.has(id) || all.value.some((c) => c.id === id);
}
/**
* The commands the palette offers: UI commands and engine commands that
* are user actions (they have a menu path or a default shortcut), not
@ -330,5 +341,5 @@ export const useCommandsStore = defineStore("commands", () => {
unsubscribe = null;
}
return { infos, recent, keymap, entries, isEnabled, provide, execute, dispatch, refresh, start, stop };
return { infos, recent, keymap, entries, isEnabled, isKnown, provide, execute, dispatch, refresh, start, stop };
});

View file

@ -7,6 +7,8 @@
* is disabled.
*/
import { TAB_UI_COMMANDS } from "../components/editor/tabs/commands";
/** A UI command as registered with the engine. */
export interface UiCommandSpec {
/** Command id, `area.action` in camelCase. */
@ -71,4 +73,5 @@ export const UI_COMMANDS: readonly UiCommandSpec[] = [
{ id: "view.toggleStructure", labelKey: "command.view.toggleStructure", menuPath: "View/Structure", defaultShortcut: "Mod+2" },
{ id: "view.selectTheme", labelKey: "command.view.selectTheme", menuPath: "View/Select Theme…" },
{ id: "view.importTheme", labelKey: "command.view.importTheme", menuPath: "View/Import Theme…" },
...TAB_UI_COMMANDS,
];