You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(tab-bar): add fit tab width mode and max tab width setting - #48482
Adds a Tab width setting (Default | Fit) and a Max tab width setting (140–480 px, default 300 px) under Settings → General → Tabs.
Default keeps Orca's exact current behavior (zero change for existing users).
Fit lets every tab — including terminal and agent tabs — shrink to fit its title instead of reserving 300 px of empty space, while still capping long prompt titles with ... at Max tab width and scrolling horizontally on overflow.
What Changed
Before
Terminal and agent tabs were always w-[300px] max-w-[300px] min-w-[80px] flex-auto, leaving large empty gaps on short tab names (hub, api, ui) and condensing inactive tabs into 32 px icon-only slots once width / count < 80px.
The 300 px max width was hard-coded across tab width rules and the inline rename slot.
After
Persisted settings & normalization (src/shared/workspace-layout/tab-groups/tab-width-settings.ts, composed into GlobalSettingsBase, defaulted in default-global-settings.ts, normalized on profile load in normalize-loaded-global-settings.ts):
tabWidthMode: 'default' | 'fit' (defaults to 'default')
tabMaxWidth: clamped integer in 140..480 px (defaults to 300)
Parameterized max-width through --tab-max-width (defaulting to 300px) for default, fit, condensed active slots, and inline rename (has-[[data-tab-rename-input]]:w-[var(--tab-max-width,300px)]).
Clean horizontal overflow in Fit mode (TabBar.tsx, use-tab-strip-condense.ts):
When tabWidthMode === 'fit', useTabStripCondense is disabled so tabs are not crushed into 32 px icons or hidden behind +N; instead the strip uses its existing horizontal scroll container, edge fades, scroll indicator, and left/right scroll chevrons when overflowing.
Forked tabs in w-max slots (SortableTab.tsx):
@container/tab (container-type: inline-size) collapses an intrinsically sized w-max slot down to min-w-[80px]. In fit (or content) sizing, SortableTab omits @container/tab and passes narrowIcon={false} to ForkMarkedName, so forked tabs fit Fork · <title> cleanly up to --tab-max-width.
Added Tab width (SettingsSegmentedControl) and Max tab width (NumberField) rows inside General → Tabs, wired into Settings search and en.json.
Why
Terminal and agent tabs frequently carry either very short custom names (hub, api, ui) or long unedited prompt titles. A two-option Default | Fit mode paired with Max tab width directly solves the wasted strip space without introducing four overlapping VS Code sizing modes or a redundant min-width control:
Keeping a max-width cap in Fit mode prevents a single long agent prompt tab from monopolizing the entire strip, while TabHoverCard still reveals the full title on hover.
Keeping default + 300px as defaults guarantees zero visual or behavioral change unless the user opts in.
Before (defaultShortAndLong, 1100 px):hub, api, ui, Codex Chat, and the long prompt tab share equal ~210 px slots with large empty padding on short names.
After (fitShortAndLong, 1100 px):hub, api, and ui sit cleanly at 80px (full icon + title + close button), Codex Chat hugs its text, the long prompt truncates cleanly at 300px with ..., and + sits immediately beside the last tab.
Custom cap (fitCustomMaxWidth, tabMaxWidth: 200): short tabs stay fitted while the long prompt caps cleanly at 200px.
Overflow (fitOverflowing, 420 px with 8 tabs): tabs stay readable at their fitted widths (no condense-plan collapse to 32 px icons) with horizontal scroll chevrons and edge fade masks.
Inline rename (fitRenaming): double-clicking hub widens the slot from 80px to 300px (var(--tab-max-width)) for comfortable editing (asserted in fixture interact).
Forked tabs (ForkedChatTab:fitWidth): verified DOM widths — hub = 80px, Fork · api > 80px, Fork · Annotate capabilities fits snugly between 150px and 280px (no @container/tab collapse), and a long forked prompt caps at 300px.
Settings UI (TabWidthSettings:fitSelected): matches SettingsGroup, SettingsSegmentedControl, and NumberField density and tokens in light and dark modes.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
ORCA_BACKGROUND_LAUNCH=1 pnpm fixtures:shot ... --theme both --scale 2 — passed (all 18 + 5 shots, 0 page/console errors, including runtime DOM width assertions for rename expansion and forked fit tabs).
ORCA_BACKGROUND_LAUNCH=1 pnpm check:changed — 42/42 checks passed in 98.1s (format, oxlint, changed-code quality, all 4 typecheck projects, affected unit tests, compiled :has() restyle scope, localization catalogs/coverage/extraction, dead design-system classes, and all ratchets).
Unit tests are intentionally limited to the pure persisted-setting normalizer (tab-width-settings.test.ts); UI layout and interaction are verified via component fixtures per AGENTS.md.
Performance
None, because tabWidthMode and tabMaxWidth are primitive Zustand selectors (only re-rendering tabs when those two settings change), --tab-max-width is omitted from inline styles at the default 300 px value, and fit mode skips useTabStripCondense DOM measurements and condense-plan work.
Risk
Level: Low
Both settings are optional on GlobalSettings and default to 'default' and 300, so existing profiles, older paired clients, and SSH/remote hosts keep identical behavior.
The riskiest area is CSS interaction between w-max, @container/tab, and has-[[data-tab-rename-input]], which was explicitly exercised across normal, forked, overflowing, and renaming fixtures.
Back-out is a plain git revert; unknown keys in saved settings are harmlessly ignored on older builds.
AI Disclosure
Implemented and verified with assistance from Antigravity / Codex (GPT-5 family) under human direction and review.
Review
Cross-platform: Pure CSS/React layout and shared settings normalization; no platform-specific APIs, paths, or keybindings.
SSH/remote & older clients: Local presentation preference only (not host-owned); absent/unknown values safely normalize to 'default' and 300.
Agent & integration compatibility: Provider-neutral across terminal, native chat, forked chat, editor, browser, and client-hosted browser tabs.
Performance: Primitive selectors, static Tailwind classes via CSS variable, zero extra style object allocation at default 300 px, and skipped condense measurements in fit mode.
UI quality: Uses SettingsGroup, SettingsRow, SettingsSegmentedControl, NumberField, and en.json tokens; verified in light and dark modes.
Security: Clamped numeric CSS pixel value (140..480) and strict union normalizer ('default' | 'fit'); no untrusted string interpolation.
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.
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)
I stated the risk: what could break, for whom, and how to back it out
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)
No actionable comments were generated in the recent review.
Walkthrough
The change adds persisted tab-width settings with default and fit modes and a configurable maximum width. General settings provides controls and search entries for these values. The tab strip applies the selected sizing rules, disables condensation in fit mode, and uses the configured maximum width. Fixtures cover settings controls, tab sizing, overflow, and renaming.
Merge Risk: Minimal · up to 9753b
This adds optional tab width settings, and the default mode preserves existing behavior. No concrete merge-blocking risk was found in the reviewed changes.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "feat(tab-bar): add fit tab width mode and max tab width setting" names the main change. The changeset adds a Tab width setting (Default or Fit) and a Max tab width setting, and wires both i…
Description check
The description follows the repository template. It includes ELI5, What Changed, Why, Linked Issue (Fixes #33867), Visual Proof (fixture commands and observed before/after behavior), Testing with comm…
Linked Issues check
Issue #33867 asks for a setting that reduces tab width, such as a compact tab width option. The PR adds two settings under Settings → General → Tabs: tabWidthMode ('default' | 'fit') and tabMaxWidth (…
Out of Scope Changes check
All changed areas connect to the tab width objective. The changes cover the settings model and defaults (tab-width-settings.ts, default-global-settings.ts, global-settings-base.ts), load-time normaliz…
Full details: Title check
Explanation
The title "feat(tab-bar): add fit tab width mode and max tab width setting" names the main change. The changeset adds a Tab width setting (Default or Fit) and a Max tab width setting, and wires both into tab sizing, settings UI, and persistence. The title is specific, concise, and follows a conventional commit style.
Full details: Description check
Explanation
The description follows the repository template. It includes ELI5, What Changed, Why, Linked Issue (Fixes #33867), Visual Proof (fixture commands and observed before/after behavior), Testing with commands run, Performance ("None, because ..." with reasoning), Risk with a level, AI Disclosure, Review, Agent skill boundary, and a completed checklist. The Visual Proof section describes fixture results in text, but it does not attach images or video. The template asks for BEFORE and AFTER attachments that can be switched, so that item is only partly met. The AI Disclosure section is filled in, which is appropriate for an outside contributor.
Full details: Linked Issues check
Explanation
Issue #33867 asks for a setting that reduces tab width, such as a compact tab width option. The PR adds two settings under Settings → General → Tabs: tabWidthMode ('default' | 'fit') and tabMaxWidth (clamped to 140–480 px, default 300). Fit mode sizes each tab to its title with an 80 px floor. Max tab width lowers the width cap, so users can make tabs narrower. The persisted values are normalized in tab-width-settings.ts and normalize-loaded-global-settings.ts. The width rules in tab-width-rules.ts and use-tab-strip-slot-props.ts read --tab-max-width. The settings UI is in TabWidthSettings.tsx and is wired into GeneralPane.tsx. The issue has no other acceptance criteria. The PR does not add a standalone compact preset, but the issue proposes a setting only as an example. The implemented settings satisfy the stated problem. Automated unit tests cover the normalizer (tab-width-settings.test.ts). Layout behavior is covered by component fixtures, not by unit tests. The issue does not require unit tests.
Full details: Out of Scope Changes check
Explanation
All changed areas connect to the tab width objective. The changes cover the settings model and defaults (tab-width-settings.ts, default-global-settings.ts, global-settings-base.ts), load-time normalization, CSS width rules, fit-mode overflow handling (TabBar.tsx, use-tab-strip-condense.ts), forked-tab sizing (SortableTab.tsx), the settings UI and search entries (TabWidthSettings.tsx, GeneralPane.tsx, general-search.ts), and en.json strings for those controls. The fixtures and the normalizer test support verification of these changes. No change was found that is unrelated to tab width sizing.
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
Adds a Tab width setting (Default | Fit) and a Max tab width setting (140–480 px, default 300 px) under Settings → General → Tabs.
...at Max tab width and scrolling horizontally on overflow.What Changed
Before
w-[300px] max-w-[300px] min-w-[80px] flex-auto, leaving large empty gaps on short tab names (hub,api,ui) and condensing inactive tabs into 32 px icon-only slots oncewidth / count < 80px.After
src/shared/workspace-layout/tab-groups/tab-width-settings.ts, composed intoGlobalSettingsBase, defaulted indefault-global-settings.ts, normalized on profile load innormalize-loaded-global-settings.ts):tabWidthMode:'default' | 'fit'(defaults to'default')tabMaxWidth: clamped integer in140..480px (defaults to300)tab-width-rules.ts,use-tab-strip-slot-props.ts):--tab-max-width(defaulting to300px) fordefault,fit, condensed active slots, and inline rename (has-[[data-tab-rename-input]]:w-[var(--tab-max-width,300px)]).FIT_TAB_CONTAINER_WIDTH_CLASSES(w-max max-w-[var(--tab-max-width,300px)] min-w-[80px] flex-none [&>*]:max-w-[var(--tab-max-width,300px)]), preserving Orca's existingmin-w-[80px]floor.TabBar.tsx,use-tab-strip-condense.ts):tabWidthMode === 'fit',useTabStripCondenseis disabled so tabs are not crushed into 32 px icons or hidden behind+N; instead the strip uses its existing horizontal scroll container, edge fades, scroll indicator, and left/right scroll chevrons when overflowing.w-maxslots (SortableTab.tsx):@container/tab(container-type: inline-size) collapses an intrinsically sizedw-maxslot down tomin-w-[80px]. Infit(orcontent) sizing,SortableTabomits@container/taband passesnarrowIcon={false}toForkMarkedName, so forked tabs fitFork · <title>cleanly up to--tab-max-width.TabWidthSettings.tsx,GeneralPane.tsx,general-search.ts,en.json):SettingsSegmentedControl) and Max tab width (NumberField) rows inside General → Tabs, wired into Settings search anden.json.Why
Terminal and agent tabs frequently carry either very short custom names (
hub,api,ui) or long unedited prompt titles. A two-option Default | Fit mode paired with Max tab width directly solves the wasted strip space without introducing four overlapping VS Code sizing modes or a redundant min-width control:max-widthcap in Fit mode prevents a single long agent prompt tab from monopolizing the entire strip, whileTabHoverCardstill reveals the full title on hover.default+300pxas defaults guarantees zero visual or behavioral change unless the user opts in.Linked Issue
Fixes #33867
Refs #40227
Visual Proof
Verified in both dark and light themes via isolated headless Chromium component fixtures (
pnpm fixtures:shot):Observed rendered behavior (both light and dark):
defaultShortAndLong, 1100 px):hub,api,ui,Codex Chat, and the long prompt tab share equal ~210 px slots with large empty padding on short names.fitShortAndLong, 1100 px):hub,api, anduisit cleanly at80px(full icon + title + close button),Codex Chathugs its text, the long prompt truncates cleanly at300pxwith..., and+sits immediately beside the last tab.fitCustomMaxWidth,tabMaxWidth: 200): short tabs stay fitted while the long prompt caps cleanly at200px.fitOverflowing, 420 px with 8 tabs): tabs stay readable at their fitted widths (no condense-plan collapse to 32 px icons) with horizontal scroll chevrons and edge fade masks.fitRenaming): double-clickinghubwidens the slot from80pxto300px(var(--tab-max-width)) for comfortable editing (asserted in fixtureinteract).ForkedChatTab:fitWidth): verified DOM widths —hub=80px,Fork · api>80px,Fork · Annotate capabilitiesfits snugly between150pxand280px(no@container/tabcollapse), and a long forked prompt caps at300px.TabWidthSettings:fitSelected): matchesSettingsGroup,SettingsSegmentedControl, andNumberFielddensity and tokens in light and dark modes.Testing
Commands run (macOS arm64):
pnpm test src/shared/workspace-layout/tab-groups/tab-width-settings.test.ts src/renderer/src/components/tab-bar/strip/use-tab-strip-condense.test.tsx --maxWorkers=2— passed (2 files, 5 tests).ORCA_BACKGROUND_LAUNCH=1 pnpm fixtures:shot ... --theme both --scale 2— passed (all 18 + 5 shots, 0 page/console errors, including runtime DOM width assertions for rename expansion and forked fit tabs).ORCA_BACKGROUND_LAUNCH=1 pnpm check:changed— 42/42 checks passed in 98.1s (format, oxlint, changed-code quality, all 4 typecheck projects, affected unit tests, compiled:has()restyle scope, localization catalogs/coverage/extraction, dead design-system classes, and all ratchets).Unit tests are intentionally limited to the pure persisted-setting normalizer (
tab-width-settings.test.ts); UI layout and interaction are verified via component fixtures perAGENTS.md.Performance
None, because
tabWidthModeandtabMaxWidthare primitive Zustand selectors (only re-rendering tabs when those two settings change),--tab-max-widthis omitted from inline styles at the default 300 px value, andfitmode skipsuseTabStripCondenseDOM measurements and condense-plan work.Risk
Level: Low
GlobalSettingsand default to'default'and300, so existing profiles, older paired clients, and SSH/remote hosts keep identical behavior.w-max,@container/tab, andhas-[[data-tab-rename-input]], which was explicitly exercised across normal, forked, overflowing, and renaming fixtures.git revert; unknown keys in saved settings are harmlessly ignored on older builds.AI Disclosure
Implemented and verified with assistance from Antigravity / Codex (GPT-5 family) under human direction and review.
Review
'default'and300.fitmode.SettingsGroup,SettingsRow,SettingsSegmentedControl,NumberField, anden.jsontokens; verified in light and dark modes.140..480) and strict union normalizer ('default' | 'fit'); no untrusted string interpolation.Agent skill upstream boundary
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)