Skip to content

Reland title-sized tabs as an experiment that holds widths through agent renames - #34527

Merged
AmethystLiang merged 11 commits into
mainfrom
AmethystLiang/reland-stable-tabs
Nov 1, 2026
Merged

AmethystLiang merged 11 commits into
mainfrom
AmethystLiang/reland-stable-tabs

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​401 $\color{#cf222e}{\Huge{\mathbf{−}}}$​50 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​351
Prod 10 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​234 $\color{#cf222e}{\Huge{\mathbf{−}}}$​18 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​216

ELI5

Tabs can now size themselves to their titles without jumping around while an agent keeps renaming them. A tab resizes only after titles stop changing for a few seconds, never while your pointer is over the tabs, and right away when you rename it yourself. The whole feature is behind Settings → Experimental → Fit tabs to titles (off by default), so everyone else keeps today's fixed-width tabs.

What Changed

Relands #34025 (reverted in #34506) and fixes the reason it was reverted.

Feedback on #34025: "Agents like to rename tabs. When they rename the tabs can shift around… it's a bit disorienting… possibly make it experimental?"

Cause: with title-sized tabs (max-w-max), every live title change resized that tab and pushed every tab to its right. Live titles change constantly: OSC titles from agents and shells, orca CLI renames, generated chat titles, browser page titles.

Fix:

  • Settled title widths. Each tab is sized from a settled title, not the live one. The live title is drawn over that width and truncates briefly (the hover card still shows the full title). The settled title catches up:
    • once no title in the strip has changed for 3s; all pending tabs settle together, so the strip moves at most once per burst of renames, and a tab an agent keeps retitling holds until it stops,
    • never while the pointer is over the strip, so nothing moves as you aim or click (the same idea as Chrome holding tab widths while you close tabs),
    • immediately when the strip is shown again (workspace switch, floating panel reopened),
    • immediately when the user commits an inline rename. The next title change also settles, so host-normalized or cleared names resize correctly.
  • Implementation. TabTitleWidthProvider (in tab-width-rules.tsx) owns a strip-wide quiet timer and pointer hover state, and keeps settled titles per tab id so labels that remount (context menu, rename cancel) keep their held width. The width comes from a hidden ::before with the settled title, so textContent and accessible names contain only the live title.
  • Experimental gate. experimentalFitTabsToTitles (default false), following the existing Experimental-pane pattern with a search entry. With it off, the old fixed 180px / 220px tab widths apply.
  • Unchanged from Size tabs to titles and preserve floating panel drag space #34025, for everyone: reserved leading-icon slot (agent status changes don't move labels or close buttons), the floating-panel drag handle, and the hover-card icon fix.

Why

Most terminal apps with dynamic titles (iTerm2, Ghostty, Windows Terminal's default) use equal-width tabs for exactly this reason; Windows Terminal makes title-length sizing opt-in. Holding widths keeps the readability win without layout moving under you. Gating it as experimental lets us dogfood before changing the default, as the reviewer suggested.

Alternatives considered (both were tried while dogfooding this PR):

  • Hold until the strip changes (open/close/move): no shifting, but agent-renamed tabs stayed truncated next to empty space indefinitely, which made the feature pointless.
  • Hover freeze alone: tabs no longer move under the pointer, but still jump on every rename while you're just watching an agent work.
  • Grow-only or bucketed widths: still shift neighbors on growth.
  • Settle on tab activation: moves tabs right after a click.

Linked Issue

N/A (maintainer reland of #34025 / #34506).

Visual Proof

Default (setting off): fixed widths, unchanged from today
fixture-fixed-default.png

Setting: Settings → Experimental → Fit tabs to titles
settings-after.png

Real dev app, setting on (earlier hold rule; the held state below now lasts only until titles go quiet for 3s). Before / after five program renames of the middle tab: every tab's x and width are identical, and the live title truncates inside the held width.
drive-0-initial.png
drive-2-held.png

Opening a tab (a strip change the user caused) settles the held width to the full title:
drive-3-after-open.png

Crowded strip fixture after agent renames: widths held, no stray ellipsis.
fixture-agent-rename-crowded.png

The reverted behavior (neighbors shifting on every rename) is the "before"; it no longer reproduces with the setting on.

Testing

  • Unit: pnpm test src/renderer/src/components/tab-bar src/renderer/src/components/settings src/renderer/src/components/floating-terminal (292 files pass).

  • E2E, headless (ORCA_BACKGROUND_LAUNCH=1):

    • tab-strip-active-dock.spec.ts and floating-workspace-pane-height.spec.ts pass.
    • New assertions: with the pointer over the strip, agent/CLI renames leave every tab's x and width unchanged, even after 3.5s of quiet; with the pointer away, renames 1s apart still leave every tab unchanged; once renames stop, the tab fits its title; a rename typed in the UI resizes immediately.
    • The @headful floating drag-handle test now covers both fixed and fit widths. It was not run locally, since visible-window tests are reserved for CI.
  • Manual (macOS, dev app, ORCA_BACKGROUND_LAUNCH=1, folder workspace):

    • Turned the setting on in Settings → Experimental.
    • Drove five program title changes on the middle of three tabs through the same store action as terminal OSC titles. All tab x positions and widths stayed identical.
    • Opening a fourth tab settled the renamed tab to its full title.
    • Real shells couldn't start because the machine was at its PTY limit (posix_openpt errno 6), so actual OSC bytes from a live shell weren't exercised.
  • Fixtures: pnpm fixtures:shot 'tab-bar/TabBar', including new fixedWidth, agentRename, and agentRenameCrowded fixtures.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

AI Disclosure

Review

An independent agent review found remount, clear-rename, re-enable, floating-panel, and ellipsis gaps; all are fixed in this PR.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Remote / SSH: renames of host-owned tabs settle on the next title change after the user commits, so host round trips and normalization are covered. The setting is a renderer-local preference, so mixed client and server versions are unaffected; web clients store it locally like other UI settings.
  • Folder workspaces: no git assumptions; validated manually in a folder workspace.
  • Mobile: the mobile tab strip already sizes to content with a tight 44–128px cap; no change.
  • Cross-platform: CSS and React only.
  • Performance: one timer and two pointer listeners per strip; no measurement or ResizeObserver.
  • Known trade-off: after an agent renames a tab, its title may show truncated for about 3s (longer while the agent keeps renaming, or while the pointer is over the tabs) before the strip resizes once.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@blacksmith-sh

This comment has been minimized.

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
Walkthrough

Adds a disabled-by-default experimental setting that lets tabs fit their widths to titles. The tab strip tracks settled titles and applies the sizing behavior across terminal, browser, and editor tabs. The change also adds a drag area beside the floating terminal tab strip and passes the panel’s open state to that strip. Fixtures and end-to-end tests cover tab widths, overflow, title changes, and floating-panel interactions.

Merge Risk: Moderate · previous review b53fd

CI is blocked by the new waits, and terminal tab layout can change even with the experiment disabled. Resolve the CI failure before merging.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly identifies the main change: an experimental reland of title-sized tabs that preserves widths during agent renames.
Description check Passed The description is complete and aligned with the template. It explains the user impact, implementation, motivation, alternatives, testing, visual proof, compatibility considerations, performance, and …
Docstring Coverage Passed Docstring coverage is inconclusive: files from earlier reviews still need to be rechecked within the check's analysis limits. Not blocking.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description is complete and aligned with the template. It explains the user impact, implementation, motivation, alternatives, testing, visual proof, compatibility considerations, performance, and checklist status. The Linked Issue section says N/A, but the description identifies the related prior pull requests and the template permits maintainers to avoid opening needless issues.

Finishing Touches
Fix failing CI checks
  • Commit to this branch
  • Create a new PR
Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2c4646a1-98d6-4c2a-8635-683c7357ebf1
Commits

Reviewing files that changed from the base of the PR and between 203f4e7 and 9a80093.

Files selected for processing: 27
  • src/renderer/src/components/floating-terminal/FloatingTerminalPanelSurface.tsx
  • src/renderer/src/components/settings/ExperimentalPane.tsx
  • src/renderer/src/components/settings/FitTabsToTitlesExperimentalSetting.tsx
  • src/renderer/src/components/settings/experimental-search.ts
  • src/renderer/src/components/settings/fit-tabs-to-titles-search-entry.ts
  • src/renderer/src/components/tab-bar/BrowserTab.test.tsx
  • src/renderer/src/components/tab-bar/BrowserTab.tsx
  • src/renderer/src/components/tab-bar/ClientHostedBrowserTab.tsx
  • src/renderer/src/components/tab-bar/EditorFileTab.tsx
  • src/renderer/src/components/tab-bar/SortableTab.rename-shortcut.test.tsx
  • src/renderer/src/components/tab-bar/SortableTab.tsx
  • src/renderer/src/components/tab-bar/TabBar.context-menu.test.ts
  • src/renderer/src/components/tab-bar/TabBar.fixture.tsx
  • src/renderer/src/components/tab-bar/TabHoverCard.tsx
  • src/renderer/src/components/tab-bar/TerminalTabLeadingIcon.tsx
  • src/renderer/src/components/tab-bar/tab-bar-props.ts
  • src/renderer/src/components/tab-bar/tab-bar-surface.tsx
  • src/renderer/src/components/tab-bar/tab-title-tooltip.test.tsx
  • src/renderer/src/components/tab-bar/tab-width-rules.ts
  • src/renderer/src/components/tab-bar/tab-width-rules.tsx
  • src/renderer/src/components/tab-bar/use-sortable-tab-rename.ts
  • src/renderer/src/components/tab-bar/use-tab-strip-slot-props.ts
  • src/renderer/src/i18n/locales/en.json
  • src/shared/default-global-settings.ts
  • src/shared/global-settings-types.ts
  • tests/e2e/floating-workspace-pane-height.spec.ts
  • tests/e2e/tab-strip-active-dock.spec.ts
Files with no reviewable changes: 1
  • src/renderer/src/components/tab-bar/tab-width-rules.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@AmethystLiang
AmethystLiang force-pushed the AmethystLiang/reland-stable-tabs branch from 9a80093 to 7ec150b Compare October 28, 2026 01:17

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

Minor · Use the tab-aware drag predicate for the titlebar. · FloatingTerminalPanelSurface.tsx:185-190

src/renderer/src/components/floating-terminal/FloatingTerminalPanelSurface.tsx:185-190
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use the tab-aware drag predicate for the titlebar.

floating-terminal-panel-drag-actions.ts imports a predicate that does not exclude data-tab-id or data-client-hosted-browser-row-id. A ClientHostedBrowserTab pointer-down therefore bubbles to handleDragStart, which captures the pointer and moves the panel when the pointer moves. The existing tab-aware predicate already defines the required boundary.

Suggested fix
-import { isFloatingTerminalDragTarget } from './floating-terminal-panel-drag-target'
+import { isFloatingTerminalDragTarget } from './floating-terminal-titlebar-drag-target'

Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: eff772d7-483b-4b50-a67c-e08e62260252
Commits

Reviewing files that changed from the base of the PR and between 9a80093 and 7ec150b.

Files selected for processing: 4
  • src/renderer/src/components/settings/ExperimentalPane.tsx
  • src/renderer/src/components/settings/experimental-search.ts
  • src/renderer/src/i18n/locales/en.json
  • src/shared/default-global-settings.ts
Files skipped from review as they are similar to previous changes: 1
  • src/renderer/src/i18n/locales/en.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@AmethystLiang
AmethystLiang force-pushed the AmethystLiang/reland-stable-tabs branch from ec1d288 to a168320 Compare October 28, 2026 03:44

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e98363a2-a9d1-450e-83c5-d14c88d1724b
Commits

Reviewing files that changed from the base of the PR and between 7ec150b and ec1d288.

Files selected for processing: 6
  • src/renderer/src/components/settings/FitTabsToTitlesExperimentalSetting.tsx
  • src/renderer/src/components/tab-bar/TabBar.fixture.tsx
  • src/renderer/src/components/tab-bar/tab-bar-surface.tsx
  • src/renderer/src/components/tab-bar/tab-width-rules.tsx
  • src/renderer/src/i18n/locales/en.json
  • tests/e2e/tab-strip-active-dock.spec.ts
Files skipped from review as they are similar to previous changes: 3
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/components/settings/FitTabsToTitlesExperimentalSetting.tsx
  • src/renderer/src/components/tab-bar/TabBar.fixture.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Comment thread tests/e2e/tab-strip-active-dock.spec.ts Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

Minor · Render editor titles through TabTitleLabel. · EditorFileTab.tsx:276-331

src/renderer/src/components/tab-bar/EditorFileTab.tsx:276-331
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Render editor titles through TabTitleLabel.

With Fit tabs to titles enabled, EditorFileTab is inside TabTitleWidthProvider, but its label uses a raw live-title span. Editor title changes can therefore resize the tab immediately and bypass the shared settled-title and hover behavior used by terminal and browser tabs.

Replace the editor label boundary with TabTitleLabel, while forwarding the existing style and double-click behavior.

Suggested fix
-import { TAB_LABEL_WIDTH_CLASSES, TAB_ROOT_WIDTH_CLASSES } from './tab-width-rules'
+import { TAB_ROOT_WIDTH_CLASSES, TabTitleLabel } from './tab-width-rules'

-          <span
-            className={`${TAB_LABEL_WIDTH_CLASSES}${isPreviewTab ? ' italic' : ''}${isMissingFileMutation ? ' line-through' : ''}`}
+          <TabTitleLabel
+            tabId={file.tabId ?? file.id}
+            title={tabLabel}
+            className={`${isPreviewTab ? 'italic' : ''}${isMissingFileMutation ? ' line-through' : ''}`}
             style={tabStatusColor ? { color: tabStatusColor } : undefined}
             onDoubleClick={(e) => {
               if (isPreviewTab && onMakePermanent) {
                 e.stopPropagation()
                 onMakePermanent()
@@
               e.stopPropagation()
               openRenameInput()
             }}
-          >
-            {tabLabel}
-          </span>
+          />

Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 16b84715-c2c9-4444-878b-ac19085a10e1
Commits

Reviewing files that changed from the base of the PR and between ec1d288 and a168320.

Files selected for processing: 4
  • src/renderer/src/components/tab-bar/SortableTab.tsx
  • src/renderer/src/components/tab-bar/TabBar.context-menu.test.ts
  • src/renderer/src/components/tab-bar/TabHoverCard.tsx
  • src/renderer/src/i18n/locales/en.json
Files skipped from review as they are similar to previous changes: 2
  • src/renderer/src/components/tab-bar/TabHoverCard.tsx
  • src/renderer/src/i18n/locales/en.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@AmethystLiang
AmethystLiang force-pushed the AmethystLiang/reland-stable-tabs branch from a168320 to b53fd40 Compare October 29, 2026 04:24
@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The changes affect tab layout across Orca’s desktop tab strips.

The PR appears safe to merge with non-blocking follow-ups for title stability and cache cleanup.

Findings

  1. P2 Tabs resize before titles stop ▶
  2. P2 Simulator titles still move tabs ▶
  3. P2 Returning tabs keep old widths ▶
  4. P2 Closed titles stay in memory ▶

Summary

Adds optional title-sized tabs with shared delayed resizing.

  • Tabs fit their titles without jumping on every live rename.
  • Terminal tab labels stay put when their icons change.
  • The floating panel keeps a grab area beside its tabs.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  Setting[Fit tabs to titles] --> Enabled{Enabled?}
  Enabled -->|No| Fixed[Fixed tab widths]
  Enabled -->|Yes| Held[Keep settled titles]
  Held --> Live[Draw live titles within held widths]
  Live --> Quiet[Restart shared quiet timer]
  Quiet --> Hover{Pointer over strip?}
  Hover -->|Yes| Wait[Keep holding widths]
  Hover -->|No, after quiet| Settle[Update settled titles together]
  Wait --> Quiet
  Rename[User commits rename] --> Settle
  Shown[Strip becomes visible] --> Settle
Loading

Reviews (1) · Last reviewed commit: "Settle title-fit tab widths after titles..." · Reviewed by Greptile

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick comments: 1
tests/e2e/tab-strip-active-dock.spec.ts: 1

280-280: Trivial · Functional Correctness · Quick win

Assert the width decrease after agent titles settle.

The final assertion can pass without a settling update because the tab already has the long-title width before the assertion. Rename it to a short title, wait for settling, and assert that the width decreases before running the user-rename checks. No other test in this file covers this delayed width transition.


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c7ef632c-3c60-471a-818f-f20dcc887722
Commits

Reviewing files that changed from the base of the PR and between a168320 and b53fd40.

Files selected for processing: 6
  • src/renderer/src/components/tab-bar/EditorFileTab.tsx
  • src/renderer/src/components/tab-bar/TabBar.context-menu.test.ts
  • src/renderer/src/i18n/locales/en.json
  • src/shared/default-global-settings.ts
  • src/shared/global-settings-types.ts
  • tests/e2e/tab-strip-active-dock.spec.ts
Files skipped from review as they are similar to previous changes: 2
  • src/renderer/src/components/tab-bar/EditorFileTab.tsx
  • src/renderer/src/i18n/locales/en.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@AmethystLiang
AmethystLiang force-pushed the AmethystLiang/reland-stable-tabs branch 5 times, most recently from fdcabef to b37d1d1 Compare November 1, 2026 00:21
@AmethystLiang

Copy link
Copy Markdown
Contributor Author

@coderabbitai Fixing. Will be in the next commit

@coderabbitai

coderabbitai Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

@AmethystLiang Thanks for the update. The finding remains open pending the next commit.

You are interacting with an AI system.

@AmethystLiang
AmethystLiang force-pushed the AmethystLiang/reland-stable-tabs branch 2 times, most recently from fb901d1 to cbf63e7 Compare November 1, 2026 06:54
…rimental

Title-sized tabs resized whenever an agent, shell, CLI, or page changed a
tab's live title, shifting neighbors. Tabs now size from a settled title
that only updates when the strip changes, the workspace is shown again, or
the user renames; the live title overlays it. Title fitting is opt-in via
Settings > Experimental > Fit tabs to titles; fixed widths remain default.
… pointer

Holding widths until the strip changed left agent-renamed tabs truncated
beside empty space. Tabs now follow their titles once no title in the strip
has changed for 3s, all at once, and never while the pointer is over the strip.
- Refit only on workspace return or confirmed inline rename
- Preserve tab geometry through title, status, and control changes
@AmethystLiang
AmethystLiang force-pushed the AmethystLiang/reland-stable-tabs branch from 1092503 to d295d1f Compare November 1, 2026 09:39
@AmethystLiang
AmethystLiang merged commit d77a49d into main Nov 1, 2026
48 checks 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.

1 participant