Repository navigation
fix(web): family tabs keep the lead on the row and fit short titles - #1018
Merged
Merged
Conversation
The tab row moved tabs behind "+N" by counting every tab at the 96px floor, so short titles like "UI" or "QA" went into the menu while the row had room. On a narrow row, opening a thread could also push the parent's tab into "+N". The fit now keeps the parent's tab and the open thread's tab on the row, and charges each tab its own width when that is under the floor. The row reads those widths from hidden copies of its tabs and of "+N", drawn with the same markup and classes, and re-fits when a copy resizes, so a larger browser font, a theme font or a late font load stay correct.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
This branch was previously deployed
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.
The family tab row moved tabs behind "+N" by counting every tab at the 96px floor, so short titles like "UI" or "QA" went into the menu while the row still had room. On a narrow row, opening a thread could also push the parent's (lead's) tab into "+N".
Fit.
fitFamilyTabsnow always keeps the parent's tab and the open thread's tab on the row, and charges each tab its own width when that is under the 96px floor. Long titles still shrink to the floor before tabs move behind "+N", and the lead's tab never shrinks. Gaps between tabs count too.Measuring. The row keeps hidden copies of every tab and of the "+N" button (
aria-hidden,inert), drawn with the same markup and box classes as the real ones, and reads their widths. A ResizeObserver on the copies and the row re-fits when something changes: a larger browser font, a theme's font, or a font that loads late. An earlier version estimated widths with hard-coded sizes. Review found it broke with a larger root font, a fixed 44px "+N" width, rounding slack, and theme font switches, so it measures the copies instead.Tests: unit tests for the fit (short titles cost their own width, gaps count, parent and open tab always kept). A browser test with nine short-titled tabs checks they all fit with no "+N" and no label cut, then switches to a 24px root font and checks that what stays on the row is whole and inside it.