fix(ui-link,ui-breadcrumb,ui-table): avoid layout shifts on SSR hydration - #2724
Merged
Merged
Conversation
…tion The server-rendered markup of three components differed from the mounted one, so the page jumped during hydration: - Breadcrumb: Breadcrumb.Link now truncates with CSS (nowrap + ellipsis) and only measures the text to decide whether the tooltip with the full text is available. - Link: the flex layout when displaying an icon and the default medium size for `variant` were only applied through `makeStyles` after mount. `generateStyle` now derives them from props, so the first render is already good. - Table: Table.Row read `isStacked` and `hover` from TableContext in `makeStyles` after mount, so the stacked state padding and the hover borders were missing on the server. Row is now a functional component that computes its styles during render with `useStyleNew`. Note: A `ref` on Table.Row now points to the row element instead of the class instance. INSTUI-5185 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
|
Contributor
Visual regression reportCypress suite: ✅ Passing Visual diff:
Accessibility (axe): ✅ No violations. 📊 View full report — click a screenshot's ⚠ badge to see each violation boxed on the image, with the offending element named and contrast failures shown as color swatches. Diff images (5)badge-canvas.png — 1573 pixels differbreadcrumb-canvas.png — 2847 pixels differbreadcrumb-dark.png — 3270 pixels differbreadcrumb-light.png — 3237 pixels differlink-canvas.png — 75934 pixels differBaselines come from the |
matyasf
requested review from
HouseOfHawks,
balzss and
git-nandor
and removed request for
balzss
September 21, 2026 20:56
git-nandor
approved these changes
Sep 23, 2026
Collaborator
|
Video of a throttled Next.js SSR load - zero shift. Nice fixes! 🚀 Screen.Recording.2026-09-23.at.9.02.35.AM.mov |
HouseOfHawks
approved these changes
Sep 23, 2026
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.





Summary
mediumsize forvariantfrom props ingenerateStyle, so the server render already has the final styles instead of getting them frommakeStylesafter mount.Breadcrumb.Linkand truncate with CSS (nowrap+ellipsis); a ResizeObserver only checks whether the text got clipped to enable the tooltip. The crumbliisdisplay: blockso the text can be clipped.Table.Rowis now a function component that readsTableContextand computes its styles during render withuseStyleNew, so stacked padding and hover borders are present on the server. ArefonTable.Rownow points to the row element instead of the class instance.Test Plan
Run the following test code in an app (e.g. replace docs app with this):
in Chrome's performance tab set CPU throttling to 20x and network to "slow 4G" and check that the example does not shift
Fixes INSTUI-5185
🤖 Generated with Claude Code