Repository navigation
Keep the chat at the bottom when a question card is answered - #1174
Conversation
A card that retires clamps back to the bottom on its own; only a card that grows in place, the next question in a series, showed the disarmed follow-tail. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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 at Bottom When Answering Question Cards
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
1.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3bf560b2d7
ℹ️ 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".
| // A press or key inside a pending card is answering it — an option, Next, a step chip — and | ||
| // the card then changes its own height in this layout pass. Read as the reader scrolling up, | ||
| // that would stop following exactly when the next question lands below the fold. | ||
| if (IsActivation(e) && OriginatesFromPendingCard(e)) return; |
There was a problem hiding this comment.
Preserve reader gestures for non-activation keys
When focus is on a button inside a pending card, keys such as Page Up, Page Down, Home, or End are scrolling gestures rather than activations. This unconditional key-down exemption leaves _readerGesture false, so the resulting ScrollChanged retains _followTail and immediately calls ScrollToEnd(), preventing keyboard users from scrolling back through the chat while a card is pending. Restrict the exemption to keys that actually activate the card, such as Enter and Space.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Restricted the key exemption to Enter and Space in b3906bf. Checked against Avalonia 12.1.2: ScrollViewer.OnKeyDown pages on Page Up and Page Down, and a probe of a Page Up from a focused option showed the -477 offset delta snapping straight back to the bottom under the blanket exemption. Home and End are not handled by the ScrollViewer, but they take the reader path as well now. Pinned by Paging_up_from_a_focused_option_leaves_the_reader_where_they_paged.
ScrollViewer pages on Page Up and Page Down from any focused descendant, so only Enter and Space, the keys that activate a card control, are an answer. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Closes #1173 — AI-3243
What & why
Answering a question card that has more than one question left the desktop chat where it was, so a taller next question sat below the fold. Follow-tail treats a press or key inside the list as the reader's own gesture and stops following when the change it produces lands above the bottom, which is what the tool-summary expansion click needs; an answer click is the same kind of press, and the card's height change lands in the same layout pass. A press, or Enter or Space, that originates inside a pending card now leaves the gesture flag alone. Wheel, touch-pan and every other key over the card still count as reader scrolling: Page Up from a focused option pages the list.
Where to look
A card that retires clamps back to the bottom on its own, so the existing retire test could not see this; the new series test needs the next question to be taller than the one it replaces.
Verification
dotnet run --project test/Capacitor.App.Tests.Unit/Capacitor.App.Tests.Unit.csproj -- --treenode-filter "/*/*/ChatTabViewSmokeTests/Answering_a_series*"— failed at the final at-bottom assertion before the fix, passes after. The same flow with the option's command invoked directly, no pointer gesture, stayed at the bottom before the fix.Paging_up_from_a_focused_option_leaves_the_reader_where_they_paged— with every card key exempt, a probe of this flow showed the page-up offset delta of -477 followed by a snap back to the bottom; with the exemption limited to Enter and Space it stays paged.Full
Capacitor.App.Tests.Unit: 2759 passed, 0 failed. Clean rebuild ofCapacitor.App: 0 warnings.🤖 Generated with Claude Code