Repository navigation
style(native-chat): make message history rail ticks subtler at rest - #51164
Conversation
There was a problem hiding this comment.
Review of head 18e17cce0c07 (source read; the app and fixtures were not run): changes requested, one P2 and three P3. The tick styling itself meets the stated requirements: the opacity values are valid in this repo's Tailwind, the hover, focus-visible, preview-open and list-open states all fire, the active/previewed precedence is unchanged, reduced motion is kept, and the fixture is correct.
P2: scroll lighting is removed without being mentioned. NativeChatMessageRail.tsx:237 drops every data-awake style, so scrolling the transcript no longer brightens the rail (before, about 300 ms and up to a 1.5 s sustain). useNativeChatRailWake still sets and clears dataset.awake on every scroll, so it is now dead work, and the doc comment at :50 still says scrolling lights the rail. The PR body does not mention this. Either keep the behavior by adding group-data-awake/rail: variants that match the hover state, or remove the hook, fix the comment at :50, and say in the PR body that scrolling no longer lights the rail. Whether scroll should light the rail is a design call.
P3:
- The 700 ms fade-out delay is gone, so ticks snap back in 150 ms when the pointer briefly leaves. Restore a resting-direction delay or note it.
h-[3px]toh-[2px]makes each hit target 1 px shorter (up to 20 px over the rail), which contradicts "hit targets unchanged". Fix the body or keep 11 px withpy-[4.5px].- The pending tick pulses to about 9% alpha at rest, so the "loading older history" cue is nearly invisible unless the rail is hovered or focused. Optionally give it a rest floor.
18e17cc to
7c4ba27
Compare
main removed useNativeChatRailWake in stablyai#51164 and now builds railRef from a plain useRef. Both sides converged on that, so only the import line conflicted: the hook no longer exists and NativeChatMessageRail moved into NativeChatTranscriptOverlays, leaving neither import used here.
ELI5
The message history rail on the right edge of native chat now stays quiet and thin while you read and scroll, and expands to full contrast when you hover over it, focus it with the keyboard, or open its preview/list.
What Changed
NativeChatMessageRail.tsxto a subtler hairline style at rest (h-[2px],w-2at 18% opacity for inactive ticks;w-2.5at 30% opacity for the active scroll tick) instead of fading the entire rail container.w-3at 50% opacity, active/previewed tickw-5at 100% opacity) when hovering the rail (group-hover/rail), focusing a tick via keyboard (group-has-focus-visible/rail), or while the preview card (group-data-[state=open]/rail) or long-chat message list (group-data-list-open/rail) is open.useNativeChatRailWakehook (use-native-chat-rail-wake.ts), itsdataset.awakescroll writes inNativeChatMessageList.tsx, and the stalerailRefdoc comment.ease-outwidth and color transitions (motion-reduce:transition-none).py-1topy-[4.5px]so each 2px tick keeps the same 11px hit-target height as the previous 3px tick (py-1).aria-busy) ticks atbg-foreground/50at rest so the loading pulse remains clearly visible while older history pages in.shortChatRestcomponent fixture inNativeChatMessageRail.fixture.tsxfor visual verification of the resting rail state.Checked against how comparable products handle this.
Why
At rest, the previous 3px ticks and scroll-triggered brightening were visually prominent beside the chat transcript. Thinning and softening the resting ticks keeps the reading area calm while preserving clear position feedback and full contrast as soon as the user interacts with the rail.
Visual Proof
Rest — Dark
Rest — Light
Hover / Preview Open — Dark
Hover / Preview Open — Light
Testing
NativeChatMessageRail.test.tsxsuite passes)pnpm check:changedpassed (all 32 checks, including typecheck, format, oxlint, unit tests, and:has()restyle scope ratchet)Performance
Expected minor improvement (unmeasured, reasoned from code), because removing
useNativeChatRailWakeremoves its pane-lifetime disposal cleanup, its reader-scroll wake/timer/dataset.awakemutations, and its conditional scroll-sustain check on transcript scroll events. Styling changes apply CSS width/color transitions to at most 20 already-rendered<span>ticks inside a fixed-size rail container (w-6), adding no JavaScript execution, React renders, listeners, I/O, or memory allocations.Risk
Level: Low
Scoped to
NativeChatMessageRail.tsx, removing the unuseduseNativeChatRailWakehook fromNativeChatMessageList.tsx, and adding a dev-only fixture. No data, settings, IPC, remote SSH, mobile, or keyboard/click behavior changed; tick hit targets remain 11px tall. Reversible with a plain git revert.Agent skill upstream boundary
Checklist
N/Awith reasonpnpm check:changedpasses locally