Skip to content

fix: preserve keyboard focus when navigating scheduled tasks - #168732

Merged
obviyus merged 4 commits into
openclaw:mainfrom
diregoblin:fix/cron-keyboard-focus-127324
Nov 1, 2026
Merged

obviyus merged 4 commits into
openclaw:mainfrom
diregoblin:fix/cron-keyboard-focus-127324

Conversation

@diregoblin

@diregoblin diregoblin commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

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.1 Docker. Main e721ca65bc1acb155c6d92498c5de471a261d5a5 twice versus candidate a93ea0dffff0a62454ef42799cb943db69415f30 twice. Open/Back/Delete use native keyboard input only; document.activeElement is captured after each transition.

Action Main, both runs Candidate, both runs
Open task BODY Back button
Back BODY Originating task button
Delete selected task BODY Surviving task button
Delete last task — Search input
Run history → New automation → Back or Cancel BODY New automation button

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

Main keyboard Open loses focus

Candidate keyboard Open focuses Back

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.

@clawsweeper

clawsweeper Bot commented Oct 10, 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.

@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: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 10, 2026
@clawsweeper

clawsweeper Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Preserves keyboard focus when opening, leaving, or deleting a scheduled task.

Example: Keyboard-open Nightly digest, then activate All automations.

  • Before: Focus falls to BODY after each transition.
  • After: Focus moves to Back, then returns to Nightly digest.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused, useful accessibility repair with inspected browser proof, preserved owner boundaries, and the previous blocker resolved.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): The exact-head report exercises the built Control UI in secretless Linux Chromium with the existing mocked Gateway, recording keyboard focus after Open, Back, deletion, and Run history creation returns; inspected screenshots corroborate the changed focus ring, and baseline runs show the original failures.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Keyboard users lose their position when scheduled-task navigation removes the focused control.
Reason: The repair fulfills the linked issue's explicit accessibility expectation without introducing configuration, persistence, or public API changes.

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
Reviewed head: a93ea0dffff0a62454ef42799cb943db69415f30

Before merge

None.

Findings

None.

Agent review details

How this fits together

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

Technical review

Best 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

  • Solid overview/detail rendering keeps the original intent (f49b7cd: The Solid port preserved existing routes, selectors, workflows, and plain domain ownership.)
  • Lazy detail rendering keeps the original intent (40f1601: Defer the optional Cron editor while retaining the existing state owners and retry boundary.)
  • Virtualized task rows keeps the original intent (db59290: Window large inventories while preserving native keyboard entry targets and focus behavior.)
  • Removal browser regression keeps the original intent (af3550d: Require destructive confirmation and reject stale decisions after connection or task changes.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source +84, Tests 0, Docs +1. Total +85 across 6 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 4 90 6 +84
Tests 1 19 19 0
Docs 1 1 0 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 110 25 +85

Review metrics

Metric Value Why it matters
Production versus test delta Production +90/-6; tests +19/-19 Production growth supplies the missing focus lifecycle and reuses existing panel, mutation, and virtualization owners; the regression extends the existing browser scenario.

Root-cause cluster

Relationship: same_root_cause
Canonical: #127324
Summary: This PR implements the canonical overview/detail focus repair; refresh-button blur is a distinct interaction defect.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • 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.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: Routine scheduled-task navigation loses keyboard position in a bounded accessibility workflow.
  • 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.

History

Review history (2 earlier review cycles)
  • reviewed 2026-10-10T23:44:21.829Z sha 0ab65d7 :: needs maintainer review before merge. :: none
  • reviewed 2026-11-01T09:57:01.214Z sha 3f494c4 :: needs changes before merge. :: [P2] Choose a mounted fallback when returning to Run history

Reviewed November 1, 2026, 5:07 AM ET / 10:07 UTC (Revision 3).

@obviyus

obviyus commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

Current Solid UI: keyboard focus proof

Main baseline: e721ca65bc1acb155c6d92498c5de471a261d5a5. Candidate: 3f494c44c6c268753c2a796af47dbcfbab1460f0.

Built Control UI, Linux Chromium, secretless node:24.22.1 Docker, existing mocked-Gateway browser helper, synthetic scheduled tasks. Each ref runs twice with a fresh browser context. Open, Back, and selected-task deletion use only native keyboard input: Tab, Enter, and the menu's End key. The harness records document.activeElement after every transition; no scripted focus() is used for these proof steps.

Transition Main, both runs Candidate, both runs
Open Nightly digest BODY BUTTON.cron-back (All automations)
Back BODY BUTTON.cron-table__name (Nightly digest)
Delete Nightly digest BODY BUTTON.cron-table__name (Morning digest)
Remove last remaining task — INPUT.settings-input (inventory search)

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.

Main keyboard Open loses focus

Candidate keyboard Open focuses Back

Main Back loses focus

Candidate Back restores task focus

Main deletion loses focus

Candidate deletion focuses surviving task

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: S and removed size: M labels Nov 1, 2026
@obviyus

obviyus commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 1, 2026
@obviyus

obviyus commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

Current Solid UI: keyboard focus proof

Main baseline: e721ca65bc1acb155c6d92498c5de471a261d5a5. Candidate: a93ea0dffff0a62454ef42799cb943db69415f30.

Built Control UI, Linux Chromium, secretless node:24.22.1 Docker, existing mocked-Gateway browser helper, synthetic scheduled tasks. Each ref runs twice with a fresh browser context. Open, Back, and selected-task deletion use only native keyboard input: Tab, Enter, and the menu's End key. The harness records document.activeElement after every transition; no scripted focus() is used for these proof steps.

Transition Main, both runs Candidate, both runs
Open Nightly digest BODY BUTTON.cron-back (All automations)
Back BODY BUTTON.cron-table__name (Nightly digest)
Delete Nightly digest BODY BUTTON.cron-table__name (Morning digest)
Remove last remaining task — INPUT.settings-input (inventory search)
Run history → New automation → Back BODY BUTTON.cron-new-task
Run history → New automation → Cancel BODY BUTTON.cron-new-task

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.

Main keyboard Open loses focus

Final candidate Open focuses Back

Main Back loses focus

Final candidate Back restores task focus

Main deletion loses focus

Final candidate deletion focuses surviving task

Run history creation Back returns to mounted New automation control

@obviyus

obviyus commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 1, 2026
@obviyus
obviyus merged commit b807fb5 into openclaw:main Nov 1, 2026
103 of 105 checks passed
@obviyus

obviyus commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

Landed in b807fb5. Thanks @diregoblin. Keyboard focus now stays in place when you open, leave or delete an automation.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 2, 2026
…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]>
@diregoblin
diregoblin deleted the fix/cron-keyboard-focus-127324 branch November 3, 2026 11:53
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 docs Improvements or additions to documentation 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.

[Bug]: cron overview and detail transitions lose keyboard focus

2 participants