Repository navigation
Conversation
The wrapped header strip fell back to the plain wrap whenever its first tab was wider than the room beside the toolbar. A selected tab is wider (its gear and close show), so selecting the first tab flipped the whole strip back: the toolbar took its own column again and, with long names, every tab took a line of its own. Selecting any other tab brought the full-width rows back. The first tab is now trimmed to the room instead (tab-corner-fit, a max-width from --tab-corner-first-max, its name ellipsized). Only a toolbar that leaves less than TAB_CORNER_MIN_FIRST_TAB (120px) beside it keeps the plain wrap, which does not depend on the selection. Two measuring details make the trim hold: - the room comes from the rounded-up float width, less the tab's 2px margin and a pixel for subpixel layout (a tab at the exact width still wrapped under the float); - the first tab is measured with its trim cleared and its gear/close width transitions finished, or a grown room reads the last trim as the width and a selection change is judged by the width the tab is leaving. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
|
Thank you @timkjr for this follow-up to #721, and welcome to Codeman. The L-shaped header strip now trims a too-wide first tab to the room beside the toolbar instead of falling back to the plain wrap, so the layout no longer changes depending on which tab is selected. The three new browser cases fail on master and pass here, and the full test suite is green. Three small things I will apply on top when merging:
You do not need to do anything here. If you would rather push these yourself, go ahead before the merge. Thanks again for the careful write-up and the hand-checked widths. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Follow-up to #721. With the L-shaped header strip on, selecting the first tab could switch the whole strip back to the plain wrapped layout: the toolbar took its own column again, and with long tab names every other tab dropped onto a row of its own. Selecting any other tab brought the full-width rows back, so the layout depended on which tab was selected.
The cause is #721's first-tab fallback. A selected tab is wider than an unselected one (its gear and close buttons appear), so a first tab that fits beside the toolbar unselected can stop fitting once selected, and the strip then dropped
.tabs-corner.With this change the first tab is trimmed to the room beside the toolbar instead (its name ellipsized), and the strip keeps the L-shape whichever tab is selected.
How
_syncTabStripCorner()no longer falls back when the first tab is too wide. It addstab-corner-fitto the first tab, and styles.css caps that tab atmax-width: var(--tab-corner-first-max), so.tab-infoellipsizes the name.TAB_CORNER_MIN_FIRST_TAB(120px, constants.js) beside it. That depends on the toolbar, not on the selection.width/paddingtransitions are finished before it is measured. A selection change starts them in the same render, so otherwise the tab was judged by the width it was leaving.docs/architecture-invariants.md: the L-shaped strip section's first-tab sentence is updated to match.Tests
test/tab-strip-corner.browser.test.ts(browser suite) has three new cases, replacing the old first-tab fallback case:.activewith gear and close);ResizeObserveris disconnected so a single pass must get it right).A case for a toolbar that leaves no usable room checks the remaining fallback. All 14 cases pass.
Also checked by hand in headless Chromium with four long-named tabs at 900 / 1000 / 1100 / 1400 px, selecting each tab in turn: the strip stays L-shaped and the first tab stays beside the toolbar every time.
npm run typecheck,lint,format:check,check:frontend-syntax,check:browser-excludespass. Fullnpm testpasses except two environment-only failures in this checkout:frontend-public-tooling(spreadsheet assets not prepared) andxterm-private-api(a different xterm in the localnode_modules).🤖 Generated with Claude Code