Skip to content

fix(ui): keep Ask OpenClaw answer focus during background updates - #169349

Merged
steipete merged 1 commit into
mainfrom
codex/qa1055-option-focus
Oct 11, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/qa1055-option-focus

Conversation

@steipete

@steipete steipete commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

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.

Before: background update loses answer focus

After: answer focus survives the background update

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.

@clawsweeper

clawsweeper Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review October 11, 2026 20:40
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 11, 2026
@clawsweeper

clawsweeper Bot commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This 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.

  • Before: The answer button is recreated and focus falls to the document body.
  • After: Pause retains focus and can submit the reply "pause".

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A narrow root-cause repair with inspected browser evidence, useful page-level coverage, and no actionable findings.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after screenshots show the changed option-card behavior in the running Ask OpenClaw UI with synthetic Gateway data; the accompanying report describes Chromium and WebKit retaining Pause focus after a background event and submitting it with Enter.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A routine background update removes keyboard focus from the answer the user is navigating.
Reason: The repair restores intended interaction behavior with no new setting, API, or competing state owner.

Regression provenance

Possible 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
Reviewed head: 71334f24779dab73ef04c3ffa9d6785c64c22174

Before merge

None.

Findings

None.

Agent review details

How this fits together

Gateway 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
Loading

Technical review

Best 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

  • Option-card rendering and focus keeps the original intent (ed684fc: The Solid migration intended to preserve existing option-card selection, focus, and interaction behavior.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source 0, Tests +36. Total +36 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 8 8 0
Tests 1 36 0 +36
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 44 8 +36

Labels

Label changes:

  • add P2: Routine background updates interrupt keyboard navigation in Ask OpenClaw, but users can recover focus and continue.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Routine background updates interrupt keyboard navigation in Ask OpenClaw, but users can recover focus and continue.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 11, 2026, 4:45 PM ET / 20:45 UTC.

@steipete
steipete merged commit 5b5515f into main Oct 11, 2026
141 of 142 checks passed
@steipete
steipete deleted the codex/qa1055-option-focus branch October 11, 2026 21:00
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant