Skip to content

feat(app): add a split button to the command bar - #177

Merged
TooonyChen merged 1 commit into
mainfrom
feature/split-button
Nov 10, 2026
Merged

TooonyChen merged 1 commit into
mainfrom
feature/split-button

Conversation

@TooonyChen

Copy link
Copy Markdown
Owner

Summary

The split items were only in the session row's context menu and on shortcuts. This adds a Split button at the right end of the command bar, after History, that opens the same items for the focused pane.

  • The button is Lucide's columns-2 icon (0.469.0, the same version as the other icons), with the tooltip and accessible name "Split" / "分屏". It is disabled while the session is connecting or disconnected. New tabs have no command bar, and with the bar turned off there is no button.
  • Its menu is built by paneMenu (paneview.go), the same function the session row's menu uses, so the items are not copied: Split right, Split down, Zoom this pane, Equalize panes, Move pane, Close this pane, with their shortcuts. With one pane, everything but the two splits is disabled.
  • The menu opens above the bar, lined up with the button's right edge. That is why it uses PopoverMenuButton (drawn in the window, as the network tab's interface menu already is): a system menu opens below its button and would cover the file panel.
  • Keyboard: choosing an item leaves the keyboard in the focused pane's terminal. Split, Zoom, Move and Close already set refocus. Equalize panes now sets it too, in the row's menu as well. The button calls Invalidate when a refocus is pending, because the panes are built before the bar.
  • Docs: features.md (Splits, Command bar) in both languages, a sentence in both READMEs, and regenerated docs/screenshots/main-* and quick-commands-*, which show the bar.

Closes #174

Compared with the mockup

The menu content, the button's place right of History and its icon match the mockup, and so does the menu's position above the bar, right-aligned. With one pane, the same items are disabled. Differences:

  • The menu has Move pane (a submenu), which feat(app): drag a pane to move it within a session's splits #173 added to paneMenu after the mockup was drawn. Since the menu comes from the same function, it shows here too.
  • The shortcuts in the screenshots are the Linux/Windows ones (Alt+Shift+=, Ctrl+Shift+X…), because the tests run on Linux. The mockup shows the macOS ones.
  • The button has no blue "open" outline while its menu shows, and no item is highlighted until the pointer is over one. The mockup draws both, but that is MyGo's normal button and menu look.
  • The rebase onto feat(app)!: send the command bar to the current session only #176 removed the send-target button, so the bar is icon, input, History, Split, as in the mockup.

Testing

  • New internal/app/splitbutton_test.go:
    • TestSplitButton: the button comes after the input and after History. Its menu has the row menu's items and their shortcuts. Zoom, Equalize and Close are disabled with one pane. Split right and Split down add panes on the same connection. Equalize, Zoom, Move pane › up and Close act on the focused pane. After each item, typed keys reach the focused pane's shell. The button is disabled when disconnected, absent in a new tab and absent with the command bar off.
    • TestSplitButtonLocal: a local terminal splits from the button.
    • TestSplitButtonScreenshots: frames in English and Simplified Chinese, with two panes and with one.
  • I checked that the keyboard assertion catches a regression: removing the new refocus on Equalize makes the test fail.
  • go fmt ./... (no changes), go build ./..., go vet ./..., GOOS=windows go vet ./..., GOOS=darwin go vet ., go tool mygo vet, go tool mygo generate and go test -race ./... all pass after the rebase onto main (5f052fb).
  • go run ./tools/screenshots regenerated the README scenes that show the bar.

Generated by Claude Code

The button sits after History and opens the session row's panes' items
(paneMenu) above the bar, for the focused pane. Equalize panes now gives
the focused pane's terminal the keyboard, as the other items do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015nMqJHsqtndDSqJDPp1qYv
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T04:29:54.376756Z 4f654e0 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@TooonyChen
TooonyChen merged commit ac2a1e8 into main Nov 10, 2026
1 check passed
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.

feat(app): add a split button to the command bar

2 participants