Repository navigation
feat(native-chat): dim the message rail until hover, focus or scroll - #39369
Merged
Merged
Conversation
The rail drew at full strength the whole time. It now rests at 40% opacity and lights on pointer hover, keyboard focus (focus-visible) or reader scroll input, fading back after about a second idle. Scroll input writes a data attribute on the rail node, so no React render runs per scroll. Reduced motion switches without a fade.
…d snap under reduced motion
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 31 seconds. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
saltyfireball
pushed a commit
to saltyfireball/orca
that referenced
this pull request
Nov 7, 2026
…tablyai#39369) * feat(native-chat): dim the message rail until hover, focus or scroll The rail drew at full strength the whole time. It now rests at 40% opacity and lights on pointer hover, keyboard focus (focus-visible) or reader scroll input, fading back after about a second idle. Scroll input writes a data attribute on the rail node, so no React render runs per scroll. Reduced motion switches without a fade. * fix(native-chat): keep the rail lit through drags and its preview, and snap under reduced motion (cherry picked from commit 8e0a684)
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
In Chat, the message rail (the ticks on the right edge that jump to your earlier messages) was drawn at full strength the whole time, so in a long thread it competed with the conversation. It now rests dimmed (40% opacity) and comes back to full strength when you use it:
:has(:focus-visible)). Tab or arrow keys reveal it. A mouse click does not pin it lit.It fades back about 1 s after the last of those ends: a 300 ms wake window, then a 700 ms CSS delay and a 500 ms fade. It lights in 150 ms. Under
prefers-reduced-motionthe opacity switches with no transition.Streaming output and other app-driven scrolls do not wake it. The wake hangs off the existing reader-input path (
useNativeChatReaderScrollInput'sonReaderScroll), which already tells reader gestures apart from layout and auto-follow writes. Nativescrollevents only extend a wake for up to 1.5 s after a real input, so scrollbar drags and touch flings stay lit, but auto-follow can never keep the rail on.How (cost)
opacity-40plushover:,has-focus-visible:,data-[state=open]:anddata-awake:variants.useNativeChatRailWakesets and clears adata-awakeattribute on the rail's DOM node, with no React state, so scrolling triggers zero React renders. The rail's ref moved up toNativeChatMessageList, which owns the reader-input callbacks.Closes #38610
Visual proof
Captured in the dev app on this branch over CDP, with a 30-turn Claude transcript seeded the same way
tests/e2e/native-chat-message-rail.spec.tsdoes. The "main" column is the same rail with the idle dimming disabled inline, which is exactly howmainrenders it.Light

Dark

Measured computed rail opacity in the app, the same in light and dark:
transition-property: noneDesign choices that could reasonably differ
These are judgement calls, so this PR is opened for review rather than merged:
foreground/20and the current tick isforeground/40.Merge-risk assessment
Low (technically); the visual default is a design call.
Negative user-facing tradeoffs
transition-nonedrops the delay too.Validation
pnpm tc:webpnpm testonNativeChatMessageRail.test.tsxand theNativeChatMessageList*suites: 15 files, 122 tests pass.oxlintandoxfmton the changed files.pnpm check:code-quality:changedpasses.In the real app (dev build, background launch, throwaway profile, CDP port 9454), I measured every state in the table above in light and dark: hover, leave, wheel, keyboard focus, blur, preview card, scrollbar drag, streaming, and reduced motion.
Review: an independent Opus reviewer and Codex. Fixed:
Kept as a documented tradeoff: contrast at rest.
Perf
scrollevent costs one comparison.data-awakeon every wheel event (63 attribute mutations for a 60-event gesture). It now writes twice per gesture.data-awakemutations, about 350 style recalcs (about 60 ms total), 23 layouts and 180 ms of script.