Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs changes before merge. What this changesThis PR centralizes conversation scrolling decisions and pins followed conversations to the bottom through streaming and layout changes. Example: A streamed reply increases the scrollable height from 1000 to 1250 pixels while the offset remains 999.5.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep this maintainer-authored draft open: the ownership transfer is useful, but the new follow rule overrides accessibility scrolling. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe Reactor chat timeline supplies keyed rows and navigation requests to a pure scroll policy; its native adapter applies decisions to the WinUI ItemsView and reports whether Jump to latest should appear. flowchart LR
Timeline[Chat timeline] --> Policy[Scroll policy]
Input[Native input and geometry] --> Policy
Policy --> Adapter[Conversation scroll adapter]
Adapter --> View[WinUI ItemsView]
Policy --> Jump[Jump to latest visibility]
Technical reviewBest possible solution: Keep the single policy and staged native adapter while admitting assistive scroll intent before correcting genuine layout drift. Do we have a high-confidence way to reproduce the issue? Main retains the reported reactive follow behavior, and the new policy deterministically pins a 1000-to-500 offset change without prior input; no target code or tests were run during this read-only review. Is this the best way to solve the issue? The ownership transfer is justified by repeated controller-level decisions and removes their old implementations, but treating every unmarked movement as drift breaks the existing automation reader contract. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b57f12144741. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 12, 2026, 4:47 AM ET / 09:47 UTC. |
Conversation scrolling decisions were spread across a dozen native handlers and flags, and six feature PRs patched them locally after layout changes. ChatScrollPolicy is now a pure Landing/Following/Reading state machine that decides every scroll and Jump to latest visibility. The ItemsView adapter only translates native events into policy inputs and applies the returned command. Following pins the bottom through streaming, reflow and resize by reusing the staged tail-row bring once layout settles; only user action leaves it, and a toggled disclosure keeps its header in place. A source guard fails if other chat code scrolls the conversation; the ledger records the owner and the rule that layout PRs fix the policy, not scrolling. Co-authored-by: Copilot App <[email protected]>
8bff16a to
d3d95fb
Compare
|
This pull request has been automatically marked as stale due to inactivity. |
…croll to the end After a session switch the chat has no extent-growth correction left for that transcript revision, and a viewport resize granted only one correction plus the two landing retries per revision. Virtualized rows realized by a resize and a UI Automation scroll to the end keep remeasuring while a correction is in flight, so the final message could stop short of the viewport with Jump to latest shown (CI flake GatewayFixtureUiTests.SidebarSwitchesRealHistoriesAndShowsMessage240AtBothWidths). - TailReflowCorrection: bounded growth budget (MaxGrowthCorrections = 8) per content revision or viewport resize; a resize also refills the two landing retries. Native remeasurement never refills either; reader input still clears. - Growth seen while a correction waits for layout spends no credit. - UpdateTail clears a pending-correction flag whose dispatch was abandoned. - Docs and ledger state the bounded budgets and the existing UI Automation scroll-away limitation (openclaw#2126 is the structural fix). Ported from the held fix ae0867a onto current main, keeping openclaw#2319's landing retries and pinned correction anchor. Co-authored-by: Copilot App <[email protected]>
…croll to the end (#2417) * fix(chat): long chats reach the latest message after a resize and a scroll to the end After a session switch the chat has no extent-growth correction left for that transcript revision, and a viewport resize granted only one correction plus the two landing retries per revision. Virtualized rows realized by a resize and a UI Automation scroll to the end keep remeasuring while a correction is in flight, so the final message could stop short of the viewport with Jump to latest shown (CI flake GatewayFixtureUiTests.SidebarSwitchesRealHistoriesAndShowsMessage240AtBothWidths). - TailReflowCorrection: bounded growth budget (MaxGrowthCorrections = 8) per content revision or viewport resize; a resize also refills the two landing retries. Native remeasurement never refills either; reader input still clears. - Growth seen while a correction waits for layout spends no credit. - UpdateTail clears a pending-correction flag whose dispatch was abandoned. - Docs and ledger state the bounded budgets and the existing UI Automation scroll-away limitation (#2126 is the structural fix). Ported from the held fix ae0867a onto current main, keeping #2319's landing retries and pinned correction anchor. Co-authored-by: Copilot App <[email protected]> * test(chat): consolidate tail reflow budget tests Co-authored-by: Copilot App <[email protected]> --------- Co-authored-by: Copilot App <[email protected]>
Related: #1089, #2117, #2048
What Problem This Solves
Fixes: chat scrolling keeps regressing (missing the bottom while streaming, overshooting after resize and reflow) because six unrelated layout PRs each patched scroll decisions locally in one 1,000-line controller.
User Impact
User impact: a followed conversation stays at the exact bottom through streaming, resize, expanding a tool card and session switches; scrolling up, keyboard reading or toggling a disclosure stops following, and Jump to latest shows only while reading.
Why This Change Was Made
ChatScrollPolicyis now the single, pure decision owner: a Landing / Following / Reading state machine with typed inputs and one command out.ReactorItemsViewScrollController.csbecomes a thin adapter that translates native events into those inputs and applies the command; it is the only code allowed to scroll the conversation. The native mechanics it keeps (layout waits, staged tail-row realization, landing confirmation, generation fencing) are unchanged.Two native findings shaped the Following pin, both from traces of the existing proof:
Rule for future layout PRs (recorded in the ledger and chat visual design): do not patch scrolling. Fix a broken rule in
ChatScrollPolicywith a newChatScrollPolicyTestscase.ConversationScrolling_HasOneNativeOwnerfails if other chat code scrolls the conversation (popup lists in the composer and pickers are explicitly allowed).Rebased onto
mainafter #2117 and #2048 merged. #2117's interior bottom anchor (Math.BitDecrement(1.0)) is kept as the adapter'sBottomAnchorRatio, and its exact one-pixelTailNavigationPolicy.IsAtBottomis whatChatScrollGeometry.AtBottomuses. Its extent-growth re-pin (one credit per Entries revision, only while following away from the bottom, never while landing or while a reader or disclosure owns the anchor) is folded intoChatScrollPolicyas a policy case rather than a second mechanism:ContentRevisionChanged(fed by the samecontentRevisioninput) and resize are the only things that grant the bounded pin budget, so correction-induced remeasurement and same-revision rerenders cannot replenish it.TailReflowCorrectionis removed; its ledger row is closed and points to the policy.Evidence
ChatScrollPolicyTestscover every rule, including the Debug overshoot and Release streaming-undershoot geometries, the feat(chat): open tool details beside native chat #2048 review's request that Jump to latest follow the mode rather than the raw offset, the pin budget per content revision, improve(chat): refine composer sizing and context controls #2117's same-key first-delta growth (46.29 px below an anchored tail) pinning only while following, and an already-at-bottom reload followed by one wheel notch.ConversationScroll_FollowingKeepsTheExactBottomThroughStreamingResizeExpansionAndSessionSwitch(480 and 1100 px) asserts gap-to-bottom ≤ 1 px with Jump to latest hidden after landing, each streamed delta, resize both ways, a tool card, expanding it, a following reply, and switching sessions away and back.ConversationFeedbackstream, resize and jump proof andProgrammaticOrComposerFocusRetainsFollowingpass with visual capture enabled.Change Type
Scope
winnodeRequired proof pools
windows-winui-interactive: chat transcript scrolling behavior in the isolated WinUI app (native proof below ran locally; interactive-pointer disclosure toggling is not yet proven natively).Validation
All on
d3d95fb8622f3027dc731abdf00c0fcd2f89b1a1(basemain3d5f14270dd6bd8b260a723ff2e73a68ea858ca8), with isolatedOPENCLAW_TRAY_DATA_DIR,OPENCLAW_TRAY_APPDATA_DIR,OPENCLAW_TRAY_LOCALAPPDATA_DIR:./build.ps1: all builds succeeded.dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj: 5,847 passed, 29 skipped, 0 failed.dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore: 6,359 passed, 0 failed.dotnet test ./tests/OpenClaw.Tray.UITests/OpenClaw.Tray.UITests.csproj -r win-x64 --filter "FullyQualifiedName~ReactorChatLayoutProofTests|FullyQualifiedName~ReactorToolActivityProofTests": 207 passed, 3 skipped, 0 failed.ConversationFeedback_*,ConversationScroll_*,ProgrammaticOrComposerFocusRetainsFollowing) withOPENCLAW_VISUAL_TEST=1: 18/18 across three consecutive runs.GatewayFixtureUiTests.SidebarSwitchesRealHistoriesAndShowsMessage240AtBothWidthswithOPENCLAW_RUN_GATEWAY_FIXTURE_UI=1andOPENCLAW_GATEWAY_FIXTURE_APPset to the freshly built x64 app: 1 passed..\scripts\validate-docs.ps1,.\scripts\validate-proof-pools.ps1,git diff --check: passed.%APPDATA%\OpenClawTrayand%LOCALAPPDATA%\OpenClawTraymetadata manifests before and after all runs: no drift.Real Behavior Proof
OpenClaw.Tray.UITests, isolated tray roots.d3d95fb8622f3027dc731abdf00c0fcd2f89b1a1.dotnet test tests\OpenClaw.Tray.UITests\OpenClaw.Tray.UITests.csproj -r win-x64 --filter "FullyQualifiedName~ConversationScroll_FollowingKeepsTheExactBottom|FullyQualifiedName~ConversationFeedback_ThinkingToolReviewsAndHistoryRetainComposerWithoutSearch|FullyQualifiedName~ProgrammaticOrComposerFocusRetainsFollowing"withOPENCLAW_VISUAL_TEST=1.|ScrollableHeight - VerticalOffset| <= 1, an idle view and a zero-opacity Jump to latest. CapturesScroll-owner-following-480and-1100show the conversation at the exact bottom after switching sessions back.No): captures are local to the validation session.Security Impact
No)No)No)No)No)Yes, explain the risk and mitigation: N/ACompatibility and Migration
Yes)No)No)Review Conversations