Skip to content

Investigate idle chat wheel jitter - #1044

Closed
shanselman wants to merge 2 commits into
mainfrom
shanselman-fix-idle-chat-scrolling
Closed

Investigate idle chat wheel jitter#1044
shanselman wants to merge 2 commits into
mainfrom
shanselman-fix-idle-chat-scrolling

Conversation

@shanselman

@shanselman shanselman commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Status: do not merge

The user completed a direct normal-profile A/B at head 12b85917e0cd0e4683d63fa3315a474ba588cee7 and reported no perceptible improvement over exact current main 4d09797c.

A later routed-wheel diagnostic run does show that this branch suppresses repeated anchor-driven reversals, but it leaves a large virtualization extent-collapse jump. That remaining jump is consistent with the user's unchanged subjective result. The current +248/-92 production diff is therefore not justified for merge.

Recommendation: replace, not merge, this PR. A follow-up should isolate the ItemsRepeater extent instability and carry only the smallest wheel-intent/anchor change proven necessary.

Root cause evidence

The comparison used fresh local clones of the same normal profile. Both clones enabled MCP-only mode locally, navigated through the existing app.navigate {"page":"chat"} command, warmed the long idle timeline to exact top, then received the same native synthetic wheel sequence through Win32 mouse input: 36 steps down followed by 36 steps up. Both builds recorded all 72 routed PointerWheelChanged events.

Build Opposite ViewChanged moves Wheel-step endpoint reversals Largest opposite jump
Main 4d09797c 45 15 348.667 px
PR 12b85917 1 1 256.579 px

Main's representative reversal:

scrollable 1437.333 -> 816.000, offset 1043.979 -> 816.000
following False -> True, anchor NaN -> 1
ViewChanging next=467.333 final=1051.052
ViewChanged offset 816.000 -> 467.333  (reverse pull: -348.667 px)
scrollable 816.000 -> 1164.667, offset 467.333 -> 816.000

PR head suppresses that repeated anchor oscillation because routed wheel intent keeps anchoring disabled. It still records the underlying virtualizer collapse:

scrollable 1518.667 -> 816.000  (extentDelta=-702.667)
offset 1072.579 -> 816.000      (reverse pull: -256.579 px)
anchor=NaN, following=False, ownerGeneration=-

This separates two causes:

  1. Main incorrectly re-arms VerticalAnchorRatio=1 during an active wheel sequence when an extent collapse temporarily makes the viewport look bottom-following. That amplifies one extent clamp into repeated 300+ px oscillations.
  2. The dominant remaining jitter is ItemsRepeater/virtualized extent contraction itself. Investigate idle chat wheel jitter #1044 does not fix that, so the user can reasonably perceive no improvement.

Temporary tracing used OutputDebugStringW, was never telemetry, and has been fully removed from the worktree. Both diagnostic app PIDs and their launchers were stopped.

Validation

  • ./build.ps1: passed.
  • Shared tests: 3,170 passed, 31 skipped.
  • Tray tests: 1,916 passed.
  • ChatTimelineVirtualizationProofTests: 8/8 passed repeatedly.
  • Full non-accessibility Tray UI under dotnet-coverage: 100/100 passed twice.
  • Accessibility: every page plus the session-title proof passed serially in fresh isolated app processes. The monolithic lane also exposed the existing sequence-dependent ClickablePointOnScreen transient.
  • Paired Claude Opus and GPT Codex review found no critical/high code defects.

Real behavior proof

  • Current main 4d09797c: user reports mouse scrolling is a little jittery in the middle, but bottom is reachable.
  • PR head 12b85917: user reports no perceptible improvement.
  • Identical routed-wheel diagnostic: branch reduces measured reversals from 45 to 1, but the remaining 256.579 px reverse clamp is still large and comes from virtualized extent collapse.

Keep this PR draft. Do not merge. Replace it with a substantially smaller evidence-based patch, or close it if the extent-collapse investigation does not produce a material user-visible improvement.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ac9b771f-96ec-47e0-825f-fcf9921b3e38
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ac9b771f-96ec-47e0-825f-fcf9921b3e38
@shanselman

Copy link
Copy Markdown
Collaborator Author

A/B update: do not merge.

The user compared this head with current main and reported no perceptible improvement. The existing proof drives external animated ChangeView calls and verifies monotonic/end-state offsets, but it does not faithfully measure native wheel jitter. The PR remains draft with no merge recommendation.

Temporary opt-in diagnostics are being used locally to capture real routed wheel deltas and exact ViewChanging/ViewChanged, offset, extent, anchoring, follow, and programmatic-owner sequences on exact base 4d09797c and head 12b85917. No diagnostic logging will remain in the final production diff.

@shanselman shanselman changed the title Fix user-owned idle chat scrolling Investigate idle chat wheel jitter Jul 22, 2026
@clawsweeper

clawsweeper Bot commented Jul 22, 2026

Copy link
Copy Markdown

ClawSweeper status: review started.

I am starting a fresh review of this pull request: Investigate idle chat wheel jitter This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@shanselman

Copy link
Copy Markdown
Collaborator Author

Closing after measured A/B and focused iteration. Current main shows a real StackLayout variable-height extent-estimation discontinuity; the draft ownership patch reduced repeated oscillation but did not improve perceived scrolling, and the custom stable-measurement layout eliminated reversals but failed prepend/follow determinism and was too invasive. No production change from this investigation is recommended. Traces and rejected patches are preserved for the planned chat virtualization refactor.

@shanselman shanselman closed this Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant