Skip to content

fix(ui): Settings switches drop keyboard focus while a change is saving - #178175

Merged
steipete merged 4 commits into
openclaw:mainfrom
etzelm:cui/15-settings-autosave-focus
Oct 23, 2026
Merged

steipete merged 4 commits into
openclaw:mainfrom
etzelm:cui/15-settings-autosave-focus

Conversation

@etzelm

@etzelm etzelm commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Closes #178174

What Problem This Solves

Fixes keyboard focus disappearing from Settings switches and segmented choices while an automatic save is in progress.

User Impact

Keyboard users can change a setting, wait for it to save, and continue from the same control. Further activation is ignored while the save is pending.

Why This Change Was Made

Native disabled moves focus away from the active control. Shared Settings controls now expose control-level unavailability with aria-disabled, cancel native activation while unavailable, and keep the existing disabled appearance. Disabled fieldsets and individually unavailable options retain native disabling.

Control-level locked settings also remain reachable with Tab so their label and unavailable state can be discovered. This changes their keyboard reachability, not permission to modify them; guarded callbacks still reject activation.

Thanks to @etzelm (Mitchell Etzel) for the fix and regression coverage.

Evidence

  • Chromium interaction regressions for a switch, radio choice, and segmented button failed on current main because focus moved to BODY; all three pass with this fix. Locked-control keyboard coverage also passes.
  • The real source-mode Control UI, using the existing synthetic mock Gateway, switched Memory engines with a deferred save. Before: focus moved to BODY; after: focus stayed on the selected radio through saving and completion. A second arrow key during saving sent no extra write; both runs sent exactly one plugin mutation.
  • All 399 targeted unit/browser cases passed (348 unit cases and 51 browser cases). Targeted oxlint, stylelint, formatting, direct UI typecheck, and all 11 selected test typecheck graphs passed. Independent Codex review found no actionable P0–P2 issues. The four focused keyboard cases also passed after integrating current main.
  • Exact-head CI run 39899988326 is green for e692239327bdc49a81577e863726af8d7bfdd9be; the watcher confirmed no pending current-head checks. ClawSweeper reviewed the same head with no findings.
  • Full CI also identified 20 remaining native-disabled assertions across 11 consumer suites. Those assertions now check the accessible unavailable state; the 104 cases in those suites pass, including unchanged save/rejection/retirement behavior and a repeated-activation check.
  • Production delta: +25/−15 lines (net +10); test delta: +300/−102 (net +198). The additional production lines cancel native activation and keep the existing disabled appearance without moving focus.
  • The changed-file checker passed its typechecks, i18n checks, and ratchets, then reported unused exports in untouched owners; this patch changes no production import/export surface.
  • Live proof uses the real Control UI against a synthetic Gateway. An authenticated Gateway and a new Safari/WebKit run were not exercised in this pass.

Before, while saving:

Memory setting loses keyboard focus while saving

After, while saving:

Memory setting retains keyboard focus while saving

- SettingsToggle, SettingsToggleRow and SettingsSegmented render the
  control-level disabled prop as aria-disabled instead of native disabled,
  so a focused control keeps focus when its page goes busy
- their click and key handlers cancel the native toggle or selection while
  disabled; radio arrow keys are ignored; button-mode onClick is skipped
- per-option disabled and fieldset disabling stay native
- the shared dimmed style also matches [aria-disabled="true"]
- browser tests cover switch, radio and button modes keeping focus and
  ignoring keys while busy, and a locked switch staying reachable but inert
- consumer tests that read native disabled on these controls now read
  aria-disabled
@clawsweeper

clawsweeper Bot commented Oct 20, 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. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 20, 2026
@clawsweeper

clawsweeper Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Shared Settings switches and choices retain keyboard focus while unavailable and reject further activation until saving finishes.

Example: In Settings > Memory, press ArrowLeft to change Memory LanceDB to OpenClaw Memory while the save response is deferred.

  • Before: Focus moves to BODY and stays there after saving.
  • After: Focus stays on OpenClaw Memory, and another arrow key sends no additional change while saving.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Focused shared-owner repair with directly inspected UI proof, distinct browser regressions, and no actionable findings.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after screenshots exercise the real source-mode Memory Settings UI against a synthetic Gateway with a deferred save: the selected radio retains its focus ring afterward, supported by the recorded one-write replay and blocked repeated navigation; production code is unchanged since the previously reviewed proof.
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 place when a Settings control becomes unavailable during saving.
Reason: The small shared-control repair restores a concrete accessibility contract; locked-control reachability is explicitly documented and retained by the feature owner's branch integration.

Merge readiness

✅ Ready for maintainer review

This PR fixes a current keyboard-accessibility bug in shared Settings controls; no actionable defects remain in the reviewed patch, and exact-head CI is still running.

Priority: P2
Reviewed head: e692239327bdc49a81577e863726af8d7bfdd9be

Before merge

None.

Findings

None.

Agent review details

How this fits together

Settings pages pass accepted values, availability, and callbacks into shared Solid controls, which render accessible inputs and forward permitted changes to existing mutation owners.

flowchart LR
  A[Keyboard or pointer] --> B[Shared Settings controls]
  C[Page availability and values] --> B
  B --> D[Activation guards]
  D --> E[Existing mutation owner]
  E --> F[Gateway or native settings]
  F --> C
Loading

Technical review

Best possible solution:

Keep availability handling in the existing shared controls, preserving focus, guarded activation, and native fieldset and option restrictions.

Do we have a high-confidence way to reproduce the issue?

Current-main native-disabled bindings establish the reported mechanism, supported by the linked report's DOM trace and inspected screenshots; this read-only review ran no target code.

Is this the best way to solve the issue?

The patch fixes the cause at the existing shared owner without adding state, focus-restoration machinery, or caller-specific workarounds.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 35cb5aaa4510.

Provenance checked

  • Shared native Settings controls changes intended behavior with a stated reason (eca633a: The Solid migration adopted native inputs while preserving keyboard behavior, rejected-change rollback, and disabled fieldsets.)
  • Activation handlers keeps the original intent (b8daeb2: The presentation refactor inlined handlers while retaining disabled behavior, reselection, rollback, and RTL navigation.)
  • Unavailable control styling keeps the original intent (2364e8d: Native control state selectors were consolidated under their shared stylesheet owner; the patch extends those selectors to preserve the same unavailable appearance.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source +10, Tests +198. Total +208 across 31 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 3 25 15 +10
Tests 28 300 102 +198
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 31 325 117 +208

Review metrics

Metric Value Why it matters
Production versus test delta Production +25/−15; tests +300/−102 Production growth supplies activation cancellation and matching unavailable styles; test growth covers distinct native-control behaviors and aligns existing consumer assertions.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #178174
Summary: This PR is the open fix candidate for the linked native-disabled focus-loss report.

Members:

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Settings changes disrupt keyboard navigation, but users can recover by navigating back to the control.
  • 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 (3 earlier review cycles)
  • reviewed 2026-10-20T06:58:29.812Z sha 6db21e0 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-20T09:11:27.416Z sha 6db21e0 :: blocked before merge. :: none
  • reviewed 2026-10-23T04:10:43.233Z sha a38df4a :: needs maintainer review before merge. :: none

Reviewed October 23, 2026, 12:29 AM ET / 04:29 UTC (Revision 4).

@etzelm

etzelm commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 20, 2026
@roboclaw-bot roboclaw-bot added the clawtributors PR from a clawtributor label Oct 22, 2026
Keep shared switches and choices focusable while unavailable and block
activation until the setting settles. Preserve native option and fieldset
disabling and align current-main consumers with the accessible state.

Co-authored-by: Mitchell Etzel <[email protected]>
@steipete

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 23, 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. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 23, 2026
@steipete

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 23, 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. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 23, 2026
@steipete
steipete merged commit b44f145 into openclaw:main Oct 23, 2026
115 of 118 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

shakkernerd added a commit that referenced this pull request Oct 23, 2026
Preserve keyboard focus for saving settings controls and keep non-saving restrictions natively disabled.

Related: #178175
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 24, 2026
…ng (openclaw#178175)

Keep keyboard focus on shared Settings switches, radio choices, and segmented controls during autosave. Use aria-disabled with activation guards while retaining native fieldset and per-option disabling.

Verified with keyboard regressions red on base and green on head, 399 distinct targeted cases, Chromium mock-Gateway interaction proof, and targeted lint, format, style, and type checks. Update consumer assertions to reflect accessible disabled state. No fresh provider-backed Gateway run.

Co-authored-by: Mitchell Etzel <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 24, 2026
Preserve keyboard focus for saving settings controls and keep non-saving restrictions natively disabled.

Related: openclaw#178175
tideclaw-bot pushed a commit that referenced this pull request Nov 6, 2026
…ng (#178175)

Keep keyboard focus on shared Settings switches, radio choices, and segmented controls during autosave. Use aria-disabled with activation guards while retaining native fieldset and per-option disabling.

Verified with keyboard regressions red on base and green on head, 399 distinct targeted cases, Chromium mock-Gateway interaction proof, and targeted lint, format, style, and type checks. Update consumer assertions to reflect accessible disabled state. No fresh provider-backed Gateway run.

Co-authored-by: Mitchell Etzel <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>

Backport: adapt busy guards to B shared settings-controls handlers, retain native option/fieldset disabling, use accessible parent busy state and preserve B style/layout. Include keyboard-focus regressions; not executed locally.

(cherry picked from commit b44f145)
Co-authored-by: RomneyDa <[email protected]>
tideclaw-bot added a commit that referenced this pull request Nov 6, 2026
Remove the unused avatar-cache test assert import, brace the unchanged async event collection loop, and apply the canonical settings selector wrapping. No assertions, transport behavior, CSS selectors, or declarations change.

Follow-ups to 7105904 (#185112), 5ddd59a (#177659), and a84f8f4 (#178175).

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Mitchell Etzel <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit 06ed73025cd0704a6f1d2778bbab23e682fa0efa)
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 clawtributors PR from a clawtributor 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: M 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]: Control UI: Settings switches and choices go natively disabled while busy and drop keyboard focus to the page

3 participants