Skip to content

A menu bar across the top lets me browse and run every command by subject #340

Description

@a-team-app

Context

First slice of #290: a menu bar across the top of the window, so you can browse everything TuiCode can do by subject (File, Edit, Selection, View, Go, Diff, Review, Help) and reach it with the keyboard or the mouse, without knowing a command's name first. The pitch has the mockups and the full command-to-menu mapping (Where every command lands, plus Git blame at the foot of Diff per Decided #8).

Acceptance criteria

  • A one-row menu bar runs the full width of the window, above both the sidebar and the editor, reading File Edit Selection View Go Diff Review Help. It's always there, including with no folder or file open.
  • The bar and its menus use the active theme's menu colours, and follow a theme switch in Settings.
  • F10 opens the File menu. ←/→ move between menus, ↑/↓ walk items, Enter runs the item, Esc closes the menu and puts focus back where it was.
  • F10 is listed as Show menu in Settings › Keyboard Shortcuts and can be rebound there like any other command.
  • Where the terminal delivers Alt+<letter>, Alt+F, Alt+E, Alt+S, Alt+V, Alt+G, Alt+D, Alt+R and Alt+H open their menus. Where it doesn't, F10 still works.
  • Clicking a menu title opens it; clicking an item runs it; clicking outside closes it.
  • Every command that has a mnemonic appears in exactly one menu, in the menu and order the pitch's mapping gives, with separators where it draws them. Show all commands and Show mnemonics are under Help.
  • Go › Focus editor tab ► opens a submenu of tabs 1 to 9.
  • Each item shows its label and, right-aligned, its current key (the way the palette shows keys, e.g. Alt+↓); an item with no key shows only its label. No item shows a mnemonic. After rebinding a command in Settings, its menu item shows the new key.
  • Running an item acts on what you were on before you opened the menu: e.g. with focus in an editor, Edit › Move line down moves that editor's line; with focus in a diff tab, Diff › Next change moves to the next change in that diff.
  • An item picked where its command doesn't apply behaves as that command's key would there (the same status message, or nothing), and doesn't crash.
  • Every item is listed whatever the context in this slice — dimming comes in a later task.

Tests

  • The mapping: every command with a mnemonic appears in exactly one menu, and every menu item names a registered command. A new command with a mnemonic and no menu home fails the test.
  • Menu hot-key letters are unique across the eight menus.
  • An item runs its command once, by id, through the same path as the palette (not a second key binding that would fire twice).
  • The item's key column follows the live bindings, including after a rebind and for an unbound command.
  • A command run from the menu acts in the scope captured when the menu opened (an Editor-scoped and a Diff-scoped case).
  • F10 opens the menu by default and is rebindable; the bar is laid out above the sidebar and editor without shifting what they show.
  • Update AGENTS.md: adding a command means giving it a menu home. Add to the TUI style guide that a menu bar is how the app exposes its commands.

Out of scope

  • Mnemonics in the menus, or any change to mnemonics or command labels.
  • Dimming or hiding items that don't apply here (a later task).
  • The command palette's Mnemonic column (a separate task).
  • A setting to hide the menu bar, context menus on right-click, toolbars.
  • Any new command other than Show menu, or any change to what an existing command does.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    a-team:devClaimed by the a-team Dev

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions