Skip to content

fix(tabs): cap tab widths with intrinsic CSS sizing - #37131

Merged
AmethystLiang merged 1 commit into
mainfrom
AmethystLiang/cap-tab-width
Nov 1, 2026
Merged

AmethystLiang merged 1 commit into
mainfrom
AmethystLiang/cap-tab-width

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​3 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​3 $\color{#cf222e}{\Huge{\mathbf{−}}}$​3 0

ELI5

Tabs stop stretching across wide panes. The new-tab button stays beside the last tab.

What Changed

Give every tab a preferred width of 330px and let the strip size itself from its contents. Tabs still share constrained space equally, shrink to the existing 144px minimum, and scroll when they no longer fit. All tab types use the existing shared sizing rule.

Why

CSS intrinsic sizing handles the cap without JavaScript width calculations, duplicated constants, state, or effects.

Linked Issue

Internal maintenance; no linked issue.

Visual Proof

Component fixture screenshots could not be captured: the local Vite fixture runner fails to resolve @electron-toolkit/tsconfig/tsconfig.node.json. A standalone headless Chromium layout probe verified sizing at 260, 420, 700, and 1280px with 0, 1, 2, 4, and 12 tabs. This does not replace rendered component verification.

Testing

  • 30 targeted tab context-menu and scroll-growth tests passed.
  • Web typecheck, changed-file lint/format, and changed-code quality gates passed.
  • Commit hooks passed.
  • Updated the existing strip layout test; no new state or logic tests needed.
  • No platform APIs, remote protocol, workspace assumptions, or mobile-specific behavior changed.

Review

Self-reviewed the complete diff and shared tab sizing, paired-client tabs, overflow, and creation-button layout. Full CI remains required before merge.

Agent skill upstream boundary

  • Not applicable; no upstream skill source copied.

Checklist

  • Small and focused
  • Explained behavior and mechanism
  • Rendered before/after screenshots (blocked as described above)
  • Self-reviewed correctness and performance
  • Considered cross-platform and remote impact
  • Full lint, typecheck, tests, and build (CI will cover)

@coderabbitai

coderabbitai Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent 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: 07069041-6801-477a-aaec-2783de69d36a
Commits

Reviewing files that changed from the base of the PR and between bf48d66 and b0a647f.

Files selected for processing: 3
  • src/renderer/src/components/tab-bar/TabBar.context-menu.test.ts
  • src/renderer/src/components/tab-bar/tab-bar-surface.tsx
  • 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; 8 remain after this review.

Walkthrough

The tab width rules add a 330px preferred width while retaining the 144px minimum and flex growth. The tab strip wrapper now sizes to its content, can shrink, and remains capped at its parent’s width. The test title and class assertions now reflect this sizing behavior.

Merge Risk: Minimal · up to b0a64

Tabs are capped at a 330px preferred width, share space equally when constrained, and scroll once they reach the 144px minimum. No merge-blocking risk remains beyond normal CI.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Description check Warning The description is detailed and covers the change, rationale, testing, review, and limitations. However, it states that no linked issue exists despite the template requiring an actual issue, and it do… Link an actual issue in the Linked Issue section. Provide before-and-after screenshots or a video, or explain an approved exception for the missing visual proof.
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: limiting tab widths through intrinsic CSS sizing.
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 detailed and covers the change, rationale, testing, review, and limitations. However, it states that no linked issue exists despite the template requiring an actual issue, and it does not provide the required before-and-after visual proof for this UI change.

Resolution

Link an actual issue in the Linked Issue section. Provide before-and-after screenshots or a video, or explain an approved exception for the missing visual proof.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 3 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
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

@AmethystLiang
AmethystLiang merged commit ef79fa1 into main Nov 1, 2026
41 checks passed
audichuang pushed a commit to audichuang/orca that referenced this pull request Nov 2, 2026
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