Skip to content

MoriUI: move terminal tabs into the window titlebar (Chrome-style)#95

Merged
vaayne merged 1 commit into
mainfrom
moriui/titlebar-tabs
Jun 24, 2026
Merged

MoriUI: move terminal tabs into the window titlebar (Chrome-style)#95
vaayne merged 1 commit into
mainfrom
moriui/titlebar-tabs

Conversation

@vaayne

@vaayne vaayne commented Jun 24, 2026

Copy link
Copy Markdown
Owner

What

Moves the terminal tabs from a separate 34pt strip above the terminal into the window titlebar, Chrome-style. The tabs fill the previously-empty titlebar space between the left and right toolbar icon groups, reclaiming a full row of vertical height for the terminal.

How

  • New TerminalTabsBarView — a native AppKit tabs view (NSStackView of NSControl pills + + button), hosted as an NSToolbarItem in the titlebar.
    • SwiftUI hosting was tried first and abandoned: inside an NSToolbar flexible-space layout it repeatedly rendered as a blank strip. Native AppKit renders reliably.
    • withObservationTracking rebuilds the tabs when @Observable AppState changes.
  • MainWindowController lays out three groups — left icons / tabs strip / right icons — and dynamically sizes the tabs strip to fill the gap between the icon groups (recomputed on resize), with symmetric ~39pt margins.
  • Equal-width tabs: each tab is a fixed 160pt; a low-priority oversized tail spacer absorbs the slack so tabs stay left-aligned with empty space on the right — without .fill stretching the first tab and without triggering toolbar overflow.
  • Removed the old 34pt strip from TerminalAreaViewController.

Verification

  • mise run test ✅ (all packages)
  • swift build -c release --product Mori ✅ (Swift 6 strict concurrency clean)
  • Debug build + bundle.sh + launch smoke ✅
  • Layout verified via in-app offscreen-bitmap evidence: tabWidths=[160.0, 160.0], all toolbar items visible (no overflow »), leftMargin=39 rightMargin=39 at two window widths.

🤖 Generated with Claude Code

Replace the separate 34pt tab strip above the terminal with a native
AppKit tabs view hosted as a toolbar item in the titlebar, filling the
previously-empty space between the left and right toolbar icon groups.
This reclaims a full row of vertical height for the terminal.

The tabs are native AppKit (NSStackView of NSControl pills), not SwiftUI:
hosting SwiftUI inside an NSToolbar flexible-space layout repeatedly
rendered as a blank strip. A low-priority oversized tail spacer absorbs
the slack so every tab keeps a fixed 160pt width, left-aligned with empty
space on the right, without NSStackView's `.fill` stretching the first tab
and without triggering toolbar overflow.
@vaayne vaayne merged commit d8ca22f into main Jun 24, 2026
5 checks passed
@vaayne vaayne deleted the moriui/titlebar-tabs branch June 26, 2026 01:55
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