Skip to content

fix: readable, wheel-scrollable tabs and no tab bar for a single tab - #432

Merged
arzafran merged 3 commits into
mainfrom
fix/tab-bar-overflow
Oct 16, 2026
Merged

arzafran merged 3 commits into
mainfrom
fix/tab-bar-overflow

Conversation

@arzafran

Copy link
Copy Markdown
Member

What this does

People who keep dozens of tabs open in one pane could barely read them: every tab shrank to the same width and showed one letter, and only a sideways trackpad swipe scrolled the strip. Tabs now keep a width that fits their title, a regular mouse wheel scrolls the strip, and the selected tab stays in view. A pane with a single tab hides its tab bar entirely, the way cmux does, and the bar comes back at two tabs.

Summary

Review order: Sources/WindowPaneChromePortal.swift, then PaneContainerView.swift.

  • Clipped titles. layoutPills() squeezed every pill to an even share once the row overflowed, floored at 78 pt, which left about 10 pt for the title. The compression is gone: pills take min(220, max(78, title width)) and the strip scrolls.
  • Wheel scrolling. A private TabStripScrollView turns a phase-less, vertical-only wheel event into horizontal scroll. Trackpads and Magic Mouse keep native handling. No global event monitors.
  • Selected tab in view. On a selection change the native bar centers the selected pill once, so manual scrolling is not undone by later layout passes.
  • Stale titles. TabItem == compares ids only, so SwiftUI skipped updateNSView on a rename or OSC title change. BonsplitPaneChromeAnchor now gets a content signature of the tab fields the bar draws.
  • Single-tab panes. showsTabStrip is false when a pane has exactly one tab, except for the top-left pane in minimal mode with the sidebar hidden, where the strip is the titlebar row next to the traffic lights and keeps the window draggable.
  • Controls. When the focused pane's strip is hidden, the new-tab and split capsules hide instead of jumping to another pane, where they would act on the wrong one.
  • Removed the unused Appearance.tabMinWidth and tabMaxWidth from BonsplitConfiguration (no readers).

Test Plan

  • ./scripts/reload.sh --tag tabs-overflow builds.
  • Release arm64 xcodebuild ends in BUILD SUCCEEDED.
  • python3 scripts/check-structural-budgets.py passes.
  • Tagged app, 1 tab: bar hidden. 2 tabs: bar shown. 30 tabs with mixed titles: titles readable.
  • Synthesized line-unit wheel events scroll the strip sideways.
  • rename-tab updates the pill (one paneChrome.update log line per rename; none before the fix).
  • Real mouse wheel and trackpad check by hand.
  • Standard titlebar mode with a single tab: window still drags from the titlebar band (reasoned from code, not exercised).
  • CI green.

Screenshots: before/after needed (30 tabs, single tab).

@arzafran
arzafran merged commit a1a0617 into main Oct 16, 2026
13 checks passed
@arzafran
arzafran deleted the fix/tab-bar-overflow branch October 16, 2026 17:56
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