Skip to content

[Windows v0.1.62] Scrolling becomes increasingly broken as session length grows #169

Open

Description

@6monthpeek

GUI version

0.1.62

Operating system

Windows

Reproduction steps

  1. Launch Command Code Desktop v0.1.62 on Windows 11 with a 3840x2160 display.
  2. Open an existing conversation or start a new session.
  3. Continue working in the same session until the conversation becomes lengthy, containing multiple agent responses and collapsible tool execution blocks.
  4. Scroll through the conversation using the mouse wheel.
  5. Drag the conversation scrollbar thumb up and down.
  6. Repeat while the agent is generating a response and after it has finished.

The issue becomes increasingly noticeable as the session grows longer.

Expected behavior

The conversation should scroll smoothly and continuously regardless of session length.

Dragging the scrollbar thumb should move the viewport proportionally to the cursor movement without jumping, oscillating, or snapping back.

Scrolling should remain stable both during and after agent execution.

Actual behavior

Scrolling becomes progressively unstable as the conversation session grows longer.

The viewport teleports in large chunks instead of moving smoothly. When dragging the scrollbar thumb in one direction, it repeatedly jumps between different offsets rather than following the cursor.

The viewport occasionally snaps back to previously visited positions.

This happens both while the agent is actively generating a response and after it has completely finished.

Short sessions are noticeably less affected.

The issue may be related to scroll anchoring, dynamic content height calculations, virtualization, or conflicting scroll position updates. However, the underlying cause has not been confirmed.

Screenshots, recordings, or sanitized logs

Session: c4ba4e9d-8cdf-417d-934c-2b70ba37c1fa
Traces: d1283f0ca145151fe938225528fa03ba, 01a25315603835b676dbea2ebd3a2957, da431364979f125348950e0adacb260b, 64f543f5bb3a11055be5ad08cd188a5b, 1b19e4539b90ba4e98017c3176a2b6ea

Safety check

  • I removed credentials and private project information from this report.

Activity

  1. added
    bug
    on Nov 17, 2026
  2. changed the title [-]**Title: [Windows v0.1.62] Scrolling becomes increasingly broken as session length grows** I'm experiencing a reproducible scrolling issue in the Command Code Windows desktop application. **Environment:** - Windows 11 - Command Code Desktop v0.1.62 - 384[/-] [+][Windows v0.1.62] Scrolling becomes increasingly broken as session length grows[/+] on Nov 17, 2026
  3. 6monthpeek commented on Nov 17, 2026

    @6monthpeek
    Author
  4. self-assigned this
    on Nov 17, 2026
  5. aliarain commented on Nov 17, 2026

    @aliarain
    Collaborator

    the scrollbar drag fight is fixed in the next update, the thumb now follows the cursor in long chats. if wheel scrolling still jumps for you after that, reply here and we'll keep digging

  6. magicprinc commented on Nov 24, 2026

    @magicprinc

    Adding a reproduction detail that none of the reports above isolate, because it points at the pinned-to-bottom path specifically.

    The jitter only happens while the viewport is pinned to the very bottom.

    Reproduction (Command Code Desktop 0.1.63, Windows 10 build 19045 x64):

    1. Open a session with a transcript long enough to scroll — several assistant turns with tool calls works.
    2. Scroll all the way down so the newest message is fully visible and the viewport is at the bottom.
    3. Send a prompt and let the agent stream.
    4. While new content is being appended, the feed oscillates up and down, repeatedly, at a high rate — not one jump, a continuous shaking.
    5. Scroll up slightly, by one or two wheel steps, so the last lines are just off screen.
    6. The shaking stops immediately and the feed streams normally from there.

    The distinguishing point: the same session, the same streaming turn, the same content rate. The only variable is whether the viewport sits exactly at the bottom. Pinned = shakes. A few pixels above the bottom = stable.

    That asymmetry suggests the "follow the tail" path is fighting itself: each update grows the content, the follower scrolls to the new bottom, and then something (resize/layout measurement, or a second scroll correction in the same frame) moves it back, so the two corrections alternate for as long as updates keep arriving. A pure auto-scroll that never lets go would not produce oscillation — it would sit at the bottom. This is a two-way correction loop.

    If it helps to instrument it: counting scroll-position writes per animation frame while pinned at the bottom during a stream should show repeated up and down pairs, and zero of them a few pixels higher.

    Two related observations, in case they share a cause:

    Environment: Command Code Desktop 0.1.63, Windows 10 (build 19045) x64.

  7. magicprinc commented on Nov 25, 2026

    @magicprinc

    Still reproducing on Windows 10 Home 22H2 (build 19045.6456) with Command Code Desktop 0.1.63.

    With the feed pinned to the very bottom, the chat view shakes up and down continuously while a reply streams. Nudging the viewport up by one wheel step makes it stop, so the viewport sitting exactly at the bottom is the only variable. Detailed reproduction and the two-way-correction hypothesis are in #174.

    This is terribly annoying. Reading the newest output during a long turn turns into a constant fight with the viewport, and it is the most disruptive thing I hit in daily use.

    Please fix this. I can test a candidate build and send per-frame scroll-position instrumentation if that helps.

  8. magicprinc commented on Nov 25, 2026

    @magicprinc

    Static read of the shipped 0.1.63 renderer bundle — Windows 10 Home 22H2 (build 19045.6456), Command Code Desktop 0.1.63. No runtime instrumentation: everything below is grep-able in resources/app/out/renderer/assets/workspace-screen-DGk5kgiH.js. This supersedes the "two-way correction loop" guess in my earlier comment.

    1. Virtuoso's own follow is disabled; a custom loop replaced it

    • bre=()=>!1 and followOutput: t||Ze?!1:bre → followOutput is always false.
    • Tail-follow is a custom rAF loop in the totalListHeightChanged handler (Wa): each frame scrollTop += tre(remaining, dt), where tre(e,t) = e - e*(1 - Math.exp(-3*t/150)), i.e. ~27% of the remaining distance per 16 ms frame, floored at 1 px.
    • Guards: (M.current || $.current) && !st.current && performance.now() >= be.current. M.current is the last known Virtuoso atBottom, $.current is the sticky pin, st.current is pointer-down, be.current is an input hold set to now+150 by wheel/keys.
    • That single guard explains the reported asymmetry exactly: wheel-up calls Mt(), which sets M.current = false, $.current = false. Both the follow loop and the secondary path below go dead, so above the bottom there is nothing left to fight and the shaking stops immediately.

    2. A second, competing "go to bottom" target

    • _t({force, sticky}) runs its own rAF loop (up to 12 iterations while scrollHeight keeps changing) calling X.current.scrollToIndex({index:'LAST', align:'end', behavior:'auto'}).
    • Wa targets the container bottom (scrollHeight - clientHeight); _t targets the last item's end. The feed has components:{Header: hre, Footer: mre}, and mre renders a h-6 sm:h-8 spacer (24/32 px), so align:'end' lands 24-32 px short of the container bottom. This is the same shortfall WolfWithoutDuck measured independently in [Bug]: scroll keeps jumping around, making the app very hard to use. #20.
    • _t fires while pinned: on feed row-count change (re.current flag -> _t({force:true})), on the composer wrapper ResizeObserver (t && _t({sticky:true}), ref Je), and on streaming end.
    • Net effect at the bottom during streaming: _t snaps the viewport up by the footer gap, Wa eases it back down at 27%/frame. That is a sawtooth — hard jump up, eased return, repeated as long as triggers keep arriving — not a smooth drift. It matches "shakes up and down while anything is being streamed".
    • atBottomThreshold:48 is larger than that footer gap, so Virtuoso keeps reporting atBottom between the two targets; only the app's own xn() (scrollHeight - clientHeight - scrollTop <= 2) sees the difference.

    3. Upward scroll compensations are deliberately dropped

    • rre() overwrites the scroller instance's scrollBy and gates it through nre(): top >= 0 always passes; a negative top passes only if draggingScrollbar === false and one of interacting, now - touchedAt < 300, now - pinBreakAt < 300 holds; otherwise the call is silently discarded (Gp = 300).
    • Virtuoso's item-resize compensation goes through scroller.scrollBy(...) (scrollByCallback), so upward corrections during streaming are swallowed. Content then shifts up by the un-compensated delta while the follow loop only recovers 27% per frame.
    • Compounding: ky() (anchor restore used when a row collapses/expands) writes scrollTop += delta and then dispatches cc-feed-anchor-held; the listener sets anchorHeldAt, which itself blocks upward compensation for the next 300 ms.

    4. Two more writers on the same viewport

    • nn() ("Jump to latest") is a 320 ms cubic ease-out rAF loop that writes scrollTop unconditionally.
    • Hi() (focus/keyboard anchor) keeps doing scrollTop += rectDelta for up to 1200 ms or 3 stable frames (kre = 1200, yre = 3), triggered by focus inside the feed and by Tab.

    5. Reduce Motion cannot help here

    The only matchMedia('(prefers-reduced-motion: reduce)') check in the entire workspace bundle belongs to an unrelated height animation. Neither the follow easing, nor nn(), nor the 320 ms cubic consults it. With Reduce Motion enabled, the feed behaves identically.

    6. The "hold" mode cannot be switched off

    Jne() is window.electronAPI?.isFeedScrollHoldEnabled?.() !== false. That method does not exist in out/preload/index.js at all, so the flag evaluates to undefined and the behaviour is always on. It reads like an intended kill-switch that was never wired.

    7. CSS / layout context

    • [data-virtuoso-scroller]{overscroll-behavior:none;overflow-anchor:none;scroll-behavior:auto!important} — native scroll anchoring is off, so nothing else absorbs a per-frame height change.
    • .cc-chat-scroller{scrollbar-gutter:stable both-edges; mask-image:linear-gradient(to bottom,transparent 0,...,black 28px)} — the 12 px top fade makes any few-pixel shift read as a flicker.
    • increaseViewportBy is {top:800,bottom:800} normally, but {top:1e9,bottom:1e9} when screenReaderMode is on/auto (P = KQ()), i.e. every row mounted at once — a different performance regime that would amplify all of the above.

    Not measured: with no runtime trace, the relative contribution of (2) vs (3) and the exact amplitude/rate are unconfirmed. Item heights in the size tree also swing on re-measure, which is what keeps re-triggering both paths.

    Please prioritise a fix for the pinned-to-bottom path. It is by far the most disruptive thing in daily use.

    @aliarain @ahmadawais

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions