scrollbar: improve visibility animation - #2737
Draft
huacnlee wants to merge 13 commits into
Draft
Conversation
huacnlee
marked this pull request as ready for review
August 16, 2026 09:44
huacnlee
marked this pull request as draft
August 16, 2026 10:00
Base played the scrollbar entrance and exit with its own hardcoded durations, curves, and per-mode choreography, which put product motion below the gpui-base seam. Base now plays a transition it does not own. ScrollbarMotion carries the idle hold, enter, exit, and expand durations plus a ScrollbarEntrance choreography, and defaults to motionless: an unstyled scrollbar appears and disappears with no fade or slide. crates/ui projects the product timing through ScrollbarTheme::motion, on the full theme projection and on set_scrollbar_mode alike, so a runtime mode change cannot leave a stale entrance behind. A zero duration is now the only way to say "adopt the target now", which also covers reduced motion and always-visible scrollbars. That replaces the separate immediate flag, and settles a transition that was already in flight when the policy changed — the flag used to let it run on, because set_visible returned early on an unchanged target. Rendered behavior under the styled theme is unchanged. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Description
Improve scrollbar appearance and disappearance motion across the shared
gpui-baseimplementation.This implementation was AI-assisted, then reviewed, visually tested in the Scrollbar story, and covered with test-first regression tests.
Screenshot
The change is temporal rather than a static layout change. It was manually exercised in the Scrollbar story across Scrolling, Hover, and Always modes.
How to Test
cargo fmt --all -- --check cargo test -p gpui-base cargo run -p gpui-component-story -- ScrollbarIn the story, switch between Scrolling, Hover, and Always and verify the entrance/exit directions, visible fade, interruption reversal, and stationary Always behavior.
Checklist
cargo runfor story tests related to the changes.