fix(chat,layout): stop subpixel jitter under #topbar when reasoning is expanded#72
Merged
Merged
Conversation
c654aa2 to
100d9cd
Compare
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.
Symptom
Scrolling chat with an assistant message's reasoning section (or any tool result inside
<details>) expanded produces a visible 1–2 px vertical jitter on text under#topbar. Persists for the duration of smooth-scroll inertia, especially noticeable on Chrome/Edge on Windows with non-integer DPI scaling (125%/150%).Diagnosis — two compounding causes
Verified during testing: neither fix alone eliminates the jitter; both are required.
Cause A — nested scroller (
src/css/chat.css).msg-tool-result(the wrapper holding reasoning text and tool results inside<details>) hadmax-height: 250px; overflow-y: auto, making it a nested scroller inside.chat-messages. Each outer-page scroll frame triggered scroll-anchoring computations on the inner scroller; sub-pixel layout shifts cascaded into the compositor.Cause B — backdrop-filter resampling (
src/css/layout.css)#topbarhasbackdrop-filter: blur(16px)over a semi-transparent background. During smooth-scroll inertia, the page behind the topbar shifts by sub-pixel offsets each frame. The backdrop resamples on every frame and on non-integer DPI the resampled output has slightly different anti-aliasing weights — visible as text-rendering churn directly below the header.Confirmation
Runtime DevTools tests (each tested in isolation, then together):
Result: A alone — still jitters. B alone — still jitters. A + B — jitter gone.
Pixel-diff of recorded scroll: ~1.1% of pixels change per frame, max ΔL = 3/255, with diff bands aligned with text baselines (anti-aliasing fingerprint, not codec noise).
Fix
Two changes, both required:
src/css/chat.css— removemax-height: 250pxandoverflow-y: autofrom.msg-tool-result. Both reasoning and tool-result content already live inside<details>— the user opts in to expand; long content flows with the page, collapsing is the escape hatch.src/css/layout.css— addtransform: translateZ(0)andwill-change: backdrop-filterto#topbar. Pins the topbar to its own GPU composition layer with a stable filtered texture instead of recompositing every sub-pixel scroll tick.Verified by
End-to-end test on top of
main(204e0e5, v3.6.0): repro session with expanded reasoning + flick-scroll no longer shows any jitter on text below the header. Glass effect intact. Reasoning content readable, just no internal scrollbar anymore.