Skip to content

fix: give the tab bar a real window-drag region - #521

Merged
Juliusolsson05 merged 1 commit into
mainfrom
fix/tab-bar-drag-region
Jul 9, 2026
Merged

Juliusolsson05 merged 1 commit into
mainfrom
fix/tab-bar-drag-region

Conversation

@Juliusolsson05

Copy link
Copy Markdown
Owner

Symptom

"The app has no header" — the window can't be moved by grabbing the top bar, or only via a tiny weird hitbox. Surfaced during the overlay incident, but this is pre-existing on main and unrelated to the reverted feature (#517): the running build was verified overlay-free and the symptom persisted.

Root cause (two compounding bugs)

  1. TabBar.tsx put [-webkit-app-region:no-drag] on the flex-1 tab-list container, which spans everything right of the traffic lights. The empty strip right of the + button — most of the header on a typical 1–3-tab window — was completely dead: not interactive, not draggable.
  2. The only remaining drag zone, the traffic-light spacer, gets its width over IPC (ready-to-show/resize only). After any renderer reload (Cmd+R, crash recovery) it stays 0 until a manual resize — zero draggable pixels total.

Fix

  • no-drag moves to the interactive children (each tab, the + button); the container inherits drag from the bar. Empty tab-bar space now drags the window, exactly like Chrome's tab strip.
  • Main re-pushes the traffic-light inset on did-finish-load, so reloads can't strand the spacer at 0 (this also fixes tabs sliding under the traffic lights after Cmd+R).

Verification

  • tsc clean on both projects.
  • To feel it: npm run build && npm start (preview runs from out/ — a stale out/ was part of tonight's confusion) or npm run dev, then drag the empty area of the tab bar.

🤖 Generated with Claude Code

The window has no native title bar (hiddenInset), so the tab bar IS the
header — but its no-drag opt-out sat on the flex-1 tab-list container,
which spans every pixel right of the traffic lights. Result: the empty
bar right of the "+" button (most of the row) was neither clickable nor
draggable, and the only drag zone was the traffic-light spacer. That
spacer's width arrives over IPC on ready-to-show/resize only, so after
any renderer reload it collapsed to 0 — leaving the window with zero
draggable header pixels ("I can't move the app", post-#517
investigation; the reverted overlay feature got blamed but this was
pre-existing).

Two changes:
- no-drag moves from the tab-list container to each interactive child
  (tabs, + button), so all empty tab-bar space drags the window —
  Chrome tab-strip semantics.
- main re-pushes the traffic-light inset on did-finish-load so a
  renderer reload can't strand the spacer at 0.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Juliusolsson05
Juliusolsson05 merged commit 4ae7ba3 into main Jul 9, 2026
@Juliusolsson05
Juliusolsson05 deleted the fix/tab-bar-drag-region branch July 9, 2026 20:48
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