Skip to content

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

Open
a-team-app[bot] wants to merge 5 commits into
mainfrom
milestone-340-menu-bar
Open

a-team-app[bot] wants to merge 5 commits into
mainfrom
milestone-340-menu-bar

Conversation

@a-team-app

@a-team-app a-team-app Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

A menu bar now runs across the top of the window: File Edit Selection View Go Diff Review Help. You can browse every command by subject and run it with the keyboard (F10, or Alt+<letter> where the terminal delivers it) or the mouse. Each item shows its current key and follows a rebind in Settings. Show menu (F10) is listed in Settings › Keyboard Shortcuts and can be rebound there.

Closes #340

Choices worth a look:

  • Refresh explorer (re) landed after the pitch's mapping. It's under View, after Show explorer.
  • An item that doesn't apply where you opened the menu does nothing. For example, Edit › Move line down picked from the explorer does nothing, which is what its key does there. No status message, since the key gives none. Dimming such items is the later task.
  • The menu won't open while a dialog is up, e.g. clicking the bar with the palette open. Otherwise it would pull the keys out from under the dialog.
  • The Focus editor tab ► submenu lists the commands' own labels (Focus editor tab 1…9), because relabelling is out of scope.
  • Chord keys show as the palette shows them, e.g. Ctrl+G l.

Not done here: the task asks for a line in the TUI style guide saying a menu bar is how the app exposes its commands. That's a separate repo, so it needs its own change there. AGENTS.md is updated.

Also here: EditorScrollBarHostTests failed twice on Windows because the runner's console answers TG's periodic size query with 120×30, which undid the test's resize. Host tests can now pin their size (HostSteps.PinScreenSize). Only that test uses it for now. Other host tests on Windows are likely exposed to the same race.

🤖 Generated with Claude Code

a-team try tuicode 350

A one-row MenuBar above the sidebar and editor holds eight menus (File,
Edit, Selection, View, Go, Diff, Review, Help), with every command that
has a mnemonic in exactly one of them. Each item runs its command by id
through RunLaunched, as the palette does, and shows its current key from
the live bindings.

F10 opens it through a new Show menu command, so it can be rebound; TG's
own F10 hot key and the menus' bare-letter hot keys are removed so they
can't open a menu behind the keybinding service. While a menu is open an
empty key scope sits on top so arrows, Enter and Esc reach the menu. The
region is captured as it opens and a picked command only runs where its
key would.

The close is handled on the next loop iteration: App.Invoke runs inline
on the UI thread, and moving focus while TG is still shutting the popover
switched the editor group to another tab.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@a-team-app

a-team-app Bot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor Author

Windows CI failed twice here, in different editor scroll-bar resize tests (Narrowing_the_terminal…, A_diff_in_the_background…). Both times the screen was 120×30 after the test had set another size, which looks like TG's AnsiSizeMonitor putting the runner's real console size back. The same test failed 5 times on #315's branch, only on Windows. I've re-run the job. If it fails again, the next run will pin the size in those tests rather than re-run.

TG 2.1.0's ANSI driver sends CSI 18 t every 500 ms and applies the
answer through SetScreenSize. On the Windows runner the console answers
120x30, which overwrote the 80x20 the sideways-bar test had just set,
so the bar never showed (failed twice on windows-latest). The test now
pins its size: any other size the driver takes is put straight back.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@a-team-app
a-team-app Bot marked this pull request as ready for review September 29, 2026 12:18
a-team-app Bot and others added 3 commits September 30, 2026 21:22
Midnight, Daylight, Turbo Pascal and Modern Borland take the a-team
dashboard's Menu scheme, hotkeys underlined. Modern Borland's bar there is
the same cyan as TuiCode's explorer, so it's grey here instead.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The menus now follow the palette's rule: an item is live only in its
command's scope, or Global, and when its isEnabled says yes. Disabled
rather than hidden so menus keep a stable shape and never go empty.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A menu whose items are all greyed out where the keys are, such as
Selection or Diff with no file open, now leaves the bar and the titles
after it close up. It comes back as soon as one of its commands could
run. TG's Bar lines up a hidden item with Pos.Align and keeps its
place, so the menu is removed rather than hidden. Availability is
re-checked on each focus move and every 250ms, since some isEnabled
checks stat the disk.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant