Repository navigation
Keep the chat at the bottom when a NEEDS YOU card arrives or retires - #786
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
PR Summary by QodoKeep chat pinned when NEEDS YOU cards arrive or retire
AI Description
Diagram
High-Level Assessment
Files changed (4)
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a824e69ee8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ChatItems.AddHandler(PointerPressedEvent, OnReaderGesture, RoutingStrategies.Tunnel, handledEventsToo: true); | ||
| ChatItems.AddHandler(PointerReleasedEvent, OnReaderGesture, RoutingStrategies.Tunnel, handledEventsToo: true); | ||
| ChatItems.AddHandler(PointerWheelChangedEvent, OnReaderGesture, RoutingStrategies.Tunnel, handledEventsToo: true); | ||
| ChatItems.AddHandler(ScrollGestureEvent, OnReaderGesture, RoutingStrategies.Tunnel, handledEventsToo: true); |
There was a problem hiding this comment.
Register scroll gestures on their bubbling route
On touch devices, Avalonia's ScrollGestureEvent is bubble-only, so this tunnel-only handler never arms _readerGesture. After the pointer-press flag has drained, each touch-pan offset change reaches OnScrollChanged while _followTail is still true and is immediately undone by ScrollToEnd(), preventing the reader from scrolling up with touch input. Register this event for RoutingStrategies.Bubble (with handled events enabled) instead.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Confirmed against Avalonia 12.1.1: ScrollGestureEvent is registered Bubble-only, so the tunnel handler never fired. Registered on the bubbling route in 6f165ee, with a headless test that raises a scroll gesture up from a row and checks an append no longer pulls the reader back; it fails on the tunnel registration and passes on bubble.
Code Review by Qodo
1.
|
…788) The virtualizing panel re-places every row from the average height whenever a realized row changes size, and the presenter then clamps or anchor-shifts the offset by amounts that look exactly like a reader scrolling up. Only the reader's own input tells the two apart, so follow-tail keys on gestures inside the list rather than on the change's offset delta. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
a824e69 to
3179a96
Compare
…ail (#788) The scroll gesture event routes on the bubbling strategy only, so a tunnel registration never sees it and every touch pan up was undone. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Closes #788 — AI-2532
What & why
Answering a card in the desktop app scrolled the chat to its beginning. Marking the awaiting tool row changes its height, which makes Avalonia's virtualizing panel drop its anchor and re-place every row from the average realized height; with tall prose above short rows the estimate is far off, the extent collapses, and retiring the card grows the viewport and clamps the offset down by the same amount. Follow-tail read that offset drop as the reader scrolling up and stopped correcting. It now keys on the reader's input: a change landing above the bottom is followed unless a pointer, wheel, key or scrollbar gesture inside the list landed in the same layout pass, and a change landing on the bottom re-arms it. The expansion hold is a case of the same rule. The same re-anchoring still moves a reader who has scrolled up; that is #789 (AI-2533).
Where to look
A click's command runs on the pointer release, a dispatcher turn after the press, so both events arm the gesture flag; arming on the press alone let the expansion click scroll the summary away.
Verification
Headless repro against a real 13-row session cut after its AskUserQuestion call: on the old code the list landed on rows 0..3 at offset 390 with extent 3801 once the card retired, and stayed there; with the fix it converges on the last rows (offset 1871, extent 2651) and the appended transcript keeps it there. The new test fails on the old code at the card's arrival and passes now; ChatTabViewSmokeTests 29/29, Capacitor.App.Tests.Unit 1415/1415.
🤖 Generated with Claude Code