Root causes found in release web captures (1280x800 and 560x900): - Follow mode undid small wheel/trackpad ticks at the end: each tick is its own scroll, re-judged as following within 32 px and jumped back. A user scroll toward older rows now releases the end however small; the jump control appears once streamed content moves the end beyond the threshold. - The end-of-scroll jump ran inside the position's activity switch, so a touch or scrollbar drag released near the end recursed without end (stack overflow during the gesture). The jump now runs after the notification. - Horizontally scrolling code blocks and tables claimed diagonal trackpad gestures whole. HorizontalScrollView gives mostly vertical gestures to the enclosing list; sideways and Shift + wheel still scroll the block. - The wheel over the floating chat bar, composer and jump control moved nothing. VerticalWheelForwarder scrolls the transcript from them unless something under the pointer claims the event. Adds widget tests per content kind and scroll mode, follow/touch/Load older tests, a capture-kit check (tool/capture/examples/chat-wheel-scroll.json) with eval/expect steps, wheel dx/repeat, --params and eval: targets, a transcript scroll probe and fixture options, and fixes the kit ignoring a script's size. Notes in notes/chat-wheel-scroll.md.
3.2 KiB
Chat transcript: wheel and trackpad scrolling
Operator report (desktop browser): "while in the chat, sometimes I can't scroll."
Reproduction
Release web build of tool/search_selection_probe_entry.dart with
?chats=3&msgs=40,3,12&rich=1 (and &live=400, &older=1;
tool/perf/chat_scroll_fixture.dart), driven by tool/capture wheel steps
at 1280x800 and 560x900. window.chatScrollMetrics() reports the transcript
offset after each step (tool/perf/chat_scroll_probe.dart). 136 measured
steps across long, short, streaming, Load older, switched and overlay cases.
Failed before the fix (offset unchanged, or pulled back to the end):
- Small wheel/trackpad ticks at the end (|dy| below 32 px per event): every tick was snapped back, in long and short chats, both sizes, over any content. While a reply streamed, the ticks were pulled further down.
- Diagonal trackpad gestures over a code block or table that scrolls sideways: the whole event went to the block, so the transcript did not move.
- Wheel over the floating chat controls: the composer (field, attach, send), the title pill, the model control and the jump control.
Load older, chat switching, short (top-anchored) chats and the split (bottom-anchored) view itself scrolled correctly; no anchor or extent defect was found.
Root causes and fixes
- Follow mode (
chat_thread_view.dart): each wheel tick is its own scroll, and its end re-judged "following" with the 32 px threshold, then jumped to the end. Now a user scroll toward older rows releases the end however small (chatFollowsAfterScroll); a scroll toward the end still returns within the threshold. The jump control appears once streamed content moves the end beyond the threshold. - The same end-of-scroll jump ran inside the position's activity switch: a touch or scrollbar drag released within 32 px of the end re-entered the handler without end (stack overflow while handling the gesture, which left the drag broken). The jump now runs after the notification.
- Flutter's
Scrollableclaims a pointer scroll when its own axis can move, and the innermost claim wins.HorizontalScrollView(lib/ui/layout/wheel_scroll_forwarding.dart, used by markdown code blocks and tables) gives a mostly vertical gesture to the enclosing vertical list; a mostly sideways one, or Shift + wheel, still scrolls the block. VerticalWheelForwarderwraps the conversation page, so a wheel over its floating bar, composer and jump control scrolls the transcript unless something under the pointer (a composer field with its own overflow) claims it first.
Not changed: the shell's floating tab buttons (bottom right on wide windows) still take no wheel; they are app navigation shared by every destination.
Checks
- Widget tests:
test/features/chat/conversation/chat_thread_wheel_scroll_test.dart(every content kind, both scroll modes, mouse and trackpad, sideways and Shift),chat_thread_wheel_follow_test.dart(streaming, touch drags, floating controls, Load older),test/ui/layout/wheel_scroll_forwarding_test.dart. - Browser check:
tool/capture/examples/chat-wheel-scroll.json(16 expectations; fails on the first one before the fix).