Skip to content

Add split terminal File menu; drop tab-bar hover popover#318

Merged
sbertix merged 1 commit into
mainfrom
sbertix/terminal-commands
May 13, 2026
Merged

Add split terminal File menu; drop tab-bar hover popover#318
sbertix merged 1 commit into
mainfrom
sbertix/terminal-commands

Conversation

@sbertix
Copy link
Copy Markdown
Collaborator

@sbertix sbertix commented May 13, 2026

Summary

  • Restructures File > Terminal to mimic Ghostty: New Terminal Tab, divider, four Split Terminal {Right,Left,Down,Up} entries with SF Symbol icons. Moves Close Terminal / Close Terminal Tab into the .saveItem group next to Close Window.
  • Replaces the tab-bar + hover popover (350 ms debounce, pointer guards, click-suppression — duplicated the inline split buttons next to it) with two Menu + primaryAction: controls: click splits in the primary direction, long-press / right-click shows both directions.
  • Deletes the local KeyboardShortcutModifier ViewModifier; introduces ghosttyKeyboardShortcut(_:in:) that funnels through SwiftUI's nilable keyboardShortcut(_:) overload so menu-bar CommandGroups keep a stable view identity when Ghostty shortcuts hydrate from disk (sidesteps stripped Tahoe menu arrangement items, mirroring appKeyboardShortcut in SupacodeSettingsShared).
  • Extracts SecondaryToolbarMenuStyle (custom MenuStyle) shared between the tab-bar split menus and the sidebar repo-section ellipsis menu — replaces the 4-modifier chain that was duplicated across both call sites.
  • Fixes a pre-existing bug in GhosttySurfaceSearchOverlay: the Next/Previous buttons were looking up "search:next" / "search:previous" instead of Ghostty's actual action names "navigate_search:next" / "navigate_search:previous", so their shortcut hints never rendered. Same correction in TerminalCommands and GhosttyShortcutManager.terminalActions.

Test plan

  • make build-app succeeds.
  • make check (format + lint) clean.
  • AppFeatureSplitTerminalTests (9 cases: 4 reducer + 4 binding-pin + 1 no-op) passes.
  • File > Terminal shows the new menu structure with shortcut hints (⌘T for New Tab; splits where Ghostty has user bindings).
  • File > Close section shows Close Terminal / Close Terminal Tab / Close Window in order.
  • Tab bar: click "Split Right" splits right; long-press reveals Split Right + Split Left. Same for the Down/Up pair.
  • Sidebar repo-section ellipsis menu still renders with the same borderless chrome as before.
  • In-surface search overlay's Next/Previous buttons now show their keyboard shortcut hints.

…minal commands

Restructures the File menu to mirror Ghostty's: "New Terminal Tab", four
"Split Terminal {Right,Left,Down,Up}" entries with SF Symbol icons, and
moves "Close Terminal" / "Close Terminal Tab" next to "Close Window" in the
.saveItem group. Adds a `splitTerminal(direction)` reducer action, gates the
File-menu split items on a focused surface via `.focusedValue`, and shows
hotkey hints on the tab-bar long-press menu items.

Tab-bar trailing accessories shed the 350ms hover popover that duplicated
the inline split buttons; the two split buttons become `Menu` + primaryAction
so click splits in the primary direction and long-press reveals both
directions. New `SecondaryToolbarMenuStyle` consolidates the borderless
menu chrome shared with the sidebar repo ellipsis menu.

Drops the local `KeyboardShortcutModifier` wrapper now that SwiftUI's
nilable `keyboardShortcut(_:)` overload exists, and introduces a
`ghosttyKeyboardShortcut(_:in:)` helper that funnels through the same
nilable overload so menu-bar `CommandGroup`s keep a stable view identity
when Ghostty shortcuts hydrate from disk (avoids stripping Tahoe menu
arrangement items).

Also fixes a pre-existing bug where the in-surface search overlay looked
up `search:next` / `search:previous` instead of Ghostty's actual action
names `navigate_search:next` / `navigate_search:previous`, leaving the
Next/Previous buttons without their shortcut hints.
@sbertix sbertix enabled auto-merge (squash) May 13, 2026 20:14
@tuist
Copy link
Copy Markdown

tuist Bot commented May 13, 2026

🛠️ Tuist Run Report 🛠️

Builds 🔨

Scheme Status Duration Commit
supacode 2m 11s 5166fb094

@sbertix sbertix merged commit 54cda55 into main May 13, 2026
2 checks passed
@sbertix sbertix deleted the sbertix/terminal-commands branch May 13, 2026 20:20
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.

1 participant