Repository navigation
fix(ui): keep Ask OpenClaw answer focus during background updates - #169349
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 maintainer review before merge. What this changesThis PR preserves answer-button identity during background refreshes so keyboard focus stays on the chosen answer. Example: Pause is focused when Ask OpenClaw receives a routine health event.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review Keep open: this PR fixes a current keyboard-focus regression with a focused repair and useful regression coverage; no actionable patch defects were found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherGateway events refresh the Custodian view, which maps question options into the shared Solid option card; selecting a button sends its corresponding answer through the existing session store. flowchart LR
A[Gateway event] --> B[Custodian session store]
B --> C[Custodian surface]
C --> D[Keyed option card]
D --> E[Focused answer button]
E --> B
Technical reviewBest possible solution: Merge the shared option-card identity repair once the required checks pass. Do we have a high-confidence way to reproduce the issue? The caller recreates option objects on refresh and current main keys their buttons by object identity; the supplied browser images and reported failing mounted-page regression corroborate the focus loss. Is this the best way to solve the issue? Stable answer keys repair DOM identity at the existing shared owner, while reactive item accessors keep rendered content and click behavior current. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 56d559212a09. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource 0, Tests +36. Total +36 across 2 files. Added test files: 0. View PR surface stats
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 October 11, 2026, 4:45 PM ET / 20:45 UTC. |
|
Merged via squash.
|
What Problem This Solves
Fixes: keyboard focus disappears from an Ask OpenClaw answer when a routine Gateway event refreshes the page.
User Impact
Users can keep navigating answer choices and press Enter to submit the focused answer while background updates arrive.
Why This Change Was Made
The Solid conversion recreated answer buttons when their caller supplied fresh option objects. Keying each button by its stable answer value preserves focus while keeping its label, description, selection, and click behavior current.
Evidence
The mounted Custodian page regression failed on the original component when a health event moved focus from Pause to the document body. The fix retains focus and sends the correct answer. Isolated Chromium and WebKit flows against the real UI with a synthetic Gateway also preserve focus and submit Pause with Enter.
pnpm test ui/src/pages/custodian/custodian-page.nudges.test.ts ui/src/components/option-card.test.ts --maxWorkers=1: 23 tests passed; 13.517 seconds wall, with the new regression taking 450 ms under host load. The earlier main Custodian page and option-card run passed all 34 tests.Production UI and owning UI page-test types, scoped formatting, lint, styles, line-count/assertion/timer/mock-export/Lit ratchets, and independent review through P2 pass. Before/after screenshots show the answer focus ring after the same background event.
Hosted verification: exact-head CI run 38173163354 passed all 28 executed checks, including the aggregate gate. ClawSweeper reported zero findings and no before-merge requirements. In checks-ui (1/3), the modified test file took 2.794 seconds and the new regression took 166 ms.