Repository navigation
fix: preserve keyboard focus when navigating scheduled tasks - #168732
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 changesPreserves keyboard focus when opening, leaving, or deleting a scheduled task. Example: Keyboard-open Nightly digest, then activate All automations.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it repairs a current accessibility bug, resolves the prior finding, and has convincing browser proof; exact-head CI is still pending. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Automations view renders Gateway-owned tasks and panel state; this change hands keyboard focus between mounted list and detail controls while existing owners retain mutation admission. flowchart LR
A[Keyboard input] --> B[Automations view]
B --> C[Existing panel and mutation owners]
C --> D[Gateway task state]
D --> E[Mounted list or detail]
B --> F[One-shot focus request]
F --> E
Technical reviewBest possible solution: Land the focused native-ref handoff through the existing Automations presentation owner after required checks pass. Do we have a high-confidence way to reproduce the issue? Current-main source still replaces focused list/detail controls without choosing a destination, and the supplied built-UI baseline records BODY after Open, Back, and deletion; no target code was run during this review. Is this the best way to solve the issue? The patch fixes the missing presentation responsibility at the existing view boundary, preserves mutation ownership and lazy rendering, and uses mounted refs instead of DOM queries or a parallel focus manager. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against bf73e1aa8220. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +84, Tests 0, Docs +1. Total +85 across 6 files. Added test files: 0. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. 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 HistoryReviewed November 1, 2026, 5:07 AM ET / 10:07 UTC (Revision 3). |
Current Solid UI: keyboard focus proofMain baseline: Built Control UI, Linux Chromium, secretless
Controls pass twice per ref: mouse open/Back remains functional without forced Back-button focus; typing into inventory search preserves focus through the actual filtered cron.list request and committed render. Existing cancellation and stale-reconnect mutation protections remain covered by the focused bundled E2E regression, which passes. Targeted oxlint and the Solid controller/effect/DOM-query guard pass. The port uses current Solid owners and native refs/onSettled. No Lit component or rendering controller survives. It remembers visual row order only on selection, hands focus to mounted controls once, preserves another active control, and checks the current Gateway hello identity before applying a request. The existing virtualizer pins the return target so it can be materialized. Contributor @diregoblin's original commits remain in branch ancestry. Retired Lit code and duplicate old regression additions were removed during the current-main integration. Whole-port delta against main: 91 production lines added / 6 removed (net +85), tests 13 added / 14 removed (net -1), docs +1. No state, configuration, protocol, lifecycle authority, or layout change. Inspected before/after screenshots for Open, Back, and Delete are attached. This is mocked-Gateway Chromium proof, not a screen-reader or live deployment audit. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Current Solid UI: keyboard focus proofMain baseline: Built Control UI, Linux Chromium, secretless
Controls pass twice per ref: mouse open/Back remains functional without forced Back-button focus; typing into inventory search preserves focus through the actual filtered cron.list request and committed render. Existing cancellation and stale-reconnect mutation protections remain covered by the focused bundled E2E regression, which passes. Targeted oxlint and the Solid controller/effect/DOM-query guard pass. The port uses current Solid owners and native refs/onSettled. No Lit component or rendering controller survives. It remembers visual row order only on selection, hands focus to mounted controls once, preserves another active control, and checks the current Gateway hello identity before applying a request. The existing virtualizer pins the return target so it can be materialized. Contributor @diregoblin's original commits remain in branch ancestry. Retired Lit code and duplicate old regression additions were removed during the current-main integration. Whole-port delta against main: 90 production lines added / 6 removed (net +84), tests 19 added / 19 removed (net 0), docs +1. No state, configuration, protocol, lifecycle authority, or layout change. Inspected before/after screenshots for Open, Back, and Delete are attached. This is mocked-Gateway Chromium proof, not a screen-reader or live deployment audit. The earlier exact-head review correctly found a missing search ref when returning from creation to Run history. This head replaces unconditional control registration with owned native-ref factories, so only mounted controls participate, and returns to the existing New automation button on Run history. The rendered regression now covers that return. Both Back and Cancel also pass twice through the keyboard-only built-UI harness on a fresh page, with no browser error. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Landed in b807fb5. Thanks @diregoblin. Keyboard focus now stays in place when you open, leave or delete an automation. |
…w#168732) fix(ui): keep keyboard focus when opening, leaving and deleting automations Fixes openclaw#127324. In the Automations page, keyboard users lost focus: after opening an automation, pressing Back, or deleting one, focus fell to the page body and the user had to tab through the page again. Focus now moves to the detail Back button when an automation opens. Back returns focus to the row that was opened. Deleting the selected automation moves focus to a surviving neighbor, or to the search field when the list is empty. Back and Cancel from Run history creation return to the New automation control. Focus is not taken from a control the user has selected, and mouse flows are unchanged. The focus handoff is ported to the current Solid owners. Evidence: built Control UI in Linux Chromium with a mocked Gateway, keyboard only, twice per ref. On main, `document.activeElement` was BODY after Open, Back and Delete. With this change focus went to Back, the original row and the surviving neighbor, and to search for an empty list. Mouse-flow and search re-render controls passed. Details and screenshots: openclaw#168732 (comment). Thanks @diregoblin. Co-authored-by: Ayaan Zaidi <[email protected]>













Closes #127324
What Problem This Solves
Keyboard selection of a scheduled task removes the focused row without giving focus to detail. Back and selected-task deletion likewise leave focus on BODY. Keyboard users must restart navigation from the page boundary.
Why This Change Was Made
Port @diregoblin's focus handoff to the current Solid views, preserving the contributor's original commits and credit. The retired Lit page, view and rendering controller are not restored.
Native refs and settled mounts hand focus to Back, the originating row, or the next surviving visual neighbor (search when empty). Only mounted controls register handoffs; returning from creation to Run history focuses its existing New automation button. Requests are consumed once, leave a newer focused control alone, and reject a changed Gateway hello identity. The existing virtualizer can materialize the return row. Mouse navigation, mutation admission, transcript ownership and layout remain unchanged.
Evidence
Built Control UI in Linux Chromium with the existing mocked Gateway, secretless
node:24.22.1Docker. Maine721ca65bc1acb155c6d92498c5de471a261d5a5twice versus candidatea93ea0dffff0a62454ef42799cb943db69415f30twice. Open/Back/Delete use native keyboard input only;document.activeElementis captured after each transition.Mouse open/Back controls and search focus through an actual filtered response/render passed twice per ref. The focused bundled Chromium E2E passes, retaining cancellation and stale-reconnect assertions and adding Open/Back/empty-removal and Run history return focus checks. The earlier review's absent-search-ref finding is fixed and covered by the rendered regression; both Back and Cancel also pass in the built-UI harness. Targeted formatting, oxlint and the Solid controller guard pass.
Detailed terminal evidence and inspected screenshots. This is mocked-Gateway browser proof, not a live deployment or screen-reader audit.
Whole-PR delta: production +90/-6 (net +84), tests +19/-19 (net 0), docs +1. No baseline exceptions or new rendering controllers/effects/DOM queries.
Before / after: opening a task
Merge Danger
Two-way door: revert restores prior focus behavior. Blast radius is scheduled-task keyboard navigation in the Control UI; no Gateway, protocol, configuration, persisted state or lifecycle-authority changes.