Skip to content

[scroll area] Fix remount thumb size - #4107

Merged
atomiks merged 3 commits into
mui:masterfrom
atomiks:codex/6545-scroll-area-remount-flicker
Mar 4, 2026
Merged

atomiks merged 3 commits into
mui:masterfrom
atomiks:codex/6545-scroll-area-remount-flicker

Conversation

@atomiks atomiks added type: bug It doesn't behave as expected. component: scroll area Changes related to the scroll area component. labels Feb 16, 2026
@atomiks atomiks mentioned this pull request Feb 16, 2026
1 task done
@pkg-pr-new

pkg-pr-new Bot commented Feb 16, 2026 •

Copy link
Copy Markdown
  • base-ui-tanstack-start

  • vite-css-base-ui-example

    pnpm add https://pkg.pr.new/@base-ui/react@4107
    
    pnpm add https://pkg.pr.new/@base-ui/utils@4107
    

commit: b851a2b

@mui-bot

mui-bot commented Feb 16, 2026 •

Copy link
Copy Markdown

Bundle size report

Bundle Parsed size Gzip size
@base-ui/react 🔺+556B(+0.12%) 🔺+216B(+0.15%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

@netlify

netlify Bot commented Feb 16, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 691d8d2
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/69a810ec408a0800082e9354
😎 Deploy Preview https://deploy-preview-4107--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@atomiks
atomiks force-pushed the codex/6545-scroll-area-remount-flicker branch 3 times, most recently from 85c9a40 to 9add0c8 Compare February 16, 2026 10:44
@atomiks atomiks changed the title [scroll area] Fix remount thumb flicker in tabs [scroll area] Fix remount thumb size Feb 17, 2026
@atomiks
atomiks force-pushed the codex/6545-scroll-area-remount-flicker branch 5 times, most recently from ae4da4c to 638e76e Compare February 17, 2026 08:34
@atomiks
atomiks marked this pull request as ready for review February 17, 2026 08:38
@chatgpt-codex-connector

This comment was marked as outdated.

@atomiks

atomiks commented Feb 17, 2026

Copy link
Copy Markdown
Contributor Author

@codex

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@atomiks

atomiks commented Mar 3, 2026 •

Copy link
Copy Markdown
Contributor Author

Codex Review

Overview

This PR stabilizes ScrollArea remount and hydration behavior by consolidating mount-time initialization into the viewport measurement path, while expanding Chromium coverage around overflow, corner recomputation, and remount scenarios.

Findings

1. 🟡 [Non-blocking] Mount-time CPU is still slower than latest master in Chromium stress runs

Impact: UIs that mount many ScrollArea instances can still see a measurable initial-render CPU increase. This is not a correctness blocker, but it is a runtime regression in the tested mount-heavy scenario.

Evidence: Consolidation landed in packages/react/src/scroll-area/viewport/ScrollAreaViewport.tsx (single-path mount initialization through computeThumbPosition and removal of duplicate mount-time readiness updates), and Chromium benchmark was re-run against latest upstream/master (205a9a05a) using interleaved runs (master then head) with 1,000 mounted ScrollArea instances per sample.

Command/method: pnpm test:chromium ScrollAreaMountPerf.temp --no-watch, measuring from render start to two requestAnimationFrame ticks.

Ref Runs Mean (ms) p50 (ms) p95 (ms) Sample size
upstream/master (205a9a05a) 1-5 (interleaved) 477.42 473.90 491.80 5
PR head (691d8d27a) 1-5 (interleaved) 521.92 521.20 534.50 5
Delta (head vs master) - +44.50 (+9.32%) +47.30 +42.70 -

Recommendation: Keep trimming mount initialization transitions in the source path (for example, avoid separate phase updates where equivalent state can be derived in the same compute cycle), then rerun the same interleaved Chromium table against latest master.

2. ℹ️ [Informational] Simplification direction is correct, but readiness state still spans multiple components

Impact: The recent consolidation reduced duplicate observer/mount work, but readiness/visibility policy still depends on cross-component coordination, which makes future perf tuning and bundle-size tradeoffs harder to reason about.

Evidence: Readiness is produced in packages/react/src/scroll-area/viewport/ScrollAreaViewport.tsx, then consumed for visibility in packages/react/src/scroll-area/scrollbar/ScrollAreaScrollbar.tsx and packages/react/src/scroll-area/thumb/ScrollAreaThumb.tsx.

Recommendation: Keep the simplified single initialization path and continue minimizing cross-component readiness plumbing so mount-time behavior stays easier to optimize without adding new abstraction weight.

No blocking issues found in this patch.

Confidence: 4/5

High confidence based on a full-branch pass, targeted Scroll Area validation in Chromium/JSDOM, and refreshed interleaved Chromium perf sampling against latest upstream/master.

Notes

  • Verified test coverage remains green after the consolidation (pnpm test:chromium ScrollArea --no-watch, pnpm test:jsdom ScrollArea --no-watch).

@atomiks
atomiks force-pushed the codex/6545-scroll-area-remount-flicker branch from 17d63f5 to 942e0e6 Compare March 4, 2026 09:03
@atomiks
atomiks force-pushed the codex/6545-scroll-area-remount-flicker branch from 56c6264 to 0b609ef Compare March 4, 2026 10:42
@atomiks
atomiks merged commit c546b9d into mui:master Mar 4, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: scroll area Changes related to the scroll area component. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[scroll-area] Thumb flashes at wrong size on remount [scroll-area] has overflow data attributes applied on first render before measure

2 participants