# 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 1. 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. 2. 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. 3. Flutter's `Scrollable` claims 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. 4. `VerticalWheelForwarder` wraps 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).