Skip to content

fix(ui): keep keyboard focus after removing a plugin - #161111

Merged
obviyus merged 4 commits into
openclaw:mainfrom
MoerAI:fix/plugin-uninstall-focus
Oct 12, 2026
Merged

obviyus merged 4 commits into
openclaw:mainfrom
MoerAI:fix/plugin-uninstall-focus

Conversation

@MoerAI

@MoerAI MoerAI commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #127327

What problem this solves

After keyboard-confirmed removal in Settings > Plugins, the focused Uninstall control disappears and focus falls to the page body. Keyboard and screen-reader users lose their place.

User-visible change

Focus moves to the remaining Plugins heading after successful removal in Settings. Canceling removal restores Uninstall on both the Settings page and Plugins hub. If the user moves focus elsewhere while removal is pending, the handoff leaves that focus alone.

The page captures the initiating control and, after the latest mutation settles and renders, focuses the surviving heading only when the initiating control has disconnected and focus is on the body. There are no Gateway, configuration, or stored-data changes.

Evidence

Real Chromium browser, rebuilt Control UI, isolated real Gateway, and a throwaway installed Demo Removal plugin:

Action Baseline 37aefbf936a9 PR 576e91181630
Confirm removal in Settings BODY H1 Plugins
Cancel removal in Settings Uninstall button Uninstall button
Cancel removal in Plugins hub Uninstall button Uninstall button
Move focus to Search settings while removal is pending — Input retains focus after settlement

Baseline after removal:

Baseline Settings removal leaves focus on BODY

This head after removal:

This head focuses the remaining Plugins heading

The diagnostic labels display the observed document.activeElement; screenshots contain only isolated synthetic state.

Focused checks

  • Published-head plugins-lifecycle.e2e.test.ts: 9/9 passed, 21.45 s wall; keyboard cases 635 ms (catalog-backed hub fixture) and 806 ms (Settings).
  • Focused oxfmt and oxlint passed on the three changed files.
  • Exact-head isolated OpenAI gpt-5-mini smoke returned P161111_LIVE_OK, without fallback.
  • Existing exact-head hosted openclaw/ci-gate is successful; ClawSweeper reports ready with no findings.

Known follow-up: Plugins hub removal of local/packed installs still drops focus because the retired route shows Unknown local plugin discovery identity. This is a separate pre-existing route-retirement bug, tracked separately; it is not repaired or claimed by this PR. No GitHub issue was opened for it.

Thanks to @steipete for the report and @MoerAI for the implementation and original proof. The contributor's commits are preserved, including the port to the Solid plugins page.

No overlap with Pash/Sarah changes.

Merge risk

Two-way door: reverting removes only the UI focus handoff. No persisted-state, schema, permission, or public API changes. Blast radius is keyboard focus during Control UI plugin removal.

Confirmed removal retires the Uninstall control that the shared
confirmation returned focus to, so keyboard focus fell back to the
document body on both the Plugins hub detail and the Settings detail.
The plugins page now remembers the control that started the removal
and, once the latest removal has settled and re-rendered, moves focus
that fell to the body onto the remaining view's heading. Cancel still
returns focus to Uninstall, and focus the user moved elsewhere is left
alone.

Real Gateway run with the rebuilt Control UI and a synthetic local
plugin: after keyboard removal from Settings, focus is on the Plugins
heading (main: document body).
@clawsweeper

clawsweeper Bot commented Sep 29, 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 Sep 29, 2026
@clawsweeper

clawsweeper Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR restores keyboard focus to the surviving page heading after successful plugin removal.

Example: Remove Demo Removal using the keyboard from /settings/plugins/demo-removal.

  • Before: After confirmation and removal, focus falls to document.body.
  • After: Focus moves to the Plugins heading; canceling still restores Uninstall.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A useful, focused accessibility repair with current-head shipped-entry-point evidence, meaningful regressions, and no actionable findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The refreshed current-head live output exercises PluginsPageController.uninstall through a rebuilt Control UI served by an isolated real Gateway, using keyboard confirmation on Settings and observing H1 Plugins afterward; baseline output observes BODY, while browser regressions additionally cover the hub destination and cancellation.
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 and screen-reader users lose their place when successful removal retires the focused Uninstall control.
Reason: The patch supplies the linked issue's remaining focus destination while preserving the existing confirmation and cancellation contract.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR repairs a current accessibility bug with a focused patch and sufficient refreshed behavior proof; no actionable findings remain.

Priority: P2
Reviewed head: 576e911816309035d25529f982f86af327c2ea0a

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Control UI plugin page initiates removal through the shared confirmation and mutation owners, then restores presentation focus after authoritative inventory refresh.

flowchart TD
  A[Keyboard user] --> B[Plugin detail page]
  B --> C[Shared confirmation dialog]
  C --> D[Plugin mutation owner]
  D --> E[Gateway uninstall and inventory refresh]
  E --> F[Surviving page heading]
Loading

Technical review

Best possible solution:

Land the focused page-owned focus handoff after the remaining required checks pass.

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

Current-main source exposes the failing removal path, and contributor-supplied baseline results show BODY focus after confirmation; this read-only review did not execute target code.

Is this the best way to solve the issue?

The plugin page owns the disappearing view and its surviving heading, so this handoff complements the shared modal without introducing a competing dialog or mutation owner.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 26a40f394894.

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source +23, Tests +69. Total +92 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 23 0 +23
Tests 1 69 0 +69
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 92 0 +92

Review metrics

Metric Value Why it matters
Production versus test LOC Production +23/-0; tests +69/-0 The small focus repair is supported by two table-driven browser cases covering distinct surviving views and cancellation.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • 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: 🦪 silver shellfish: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.
  • remove proof: 📸 screenshot: Current real behavior proof evidence kind is live_output.

Label justifications:

  • P2: Keyboard and assistive-technology users lose their place in a bounded plugin-management flow.
  • 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.

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-09-29T09:19:58.961Z sha 48a203d :: needs changes before merge. :: [P3] Record the new browser test's measured cost
  • reviewed 2026-09-29T09:40:02.669Z sha 48a203d :: needs maintainer review before merge. :: none
  • reviewed 2026-10-12T03:26:38.540Z sha b1cb11a :: needs real behavior proof before merge. :: none

Reviewed October 11, 2026, 11:48 PM ET / October 12, 2026, 03:48 UTC (Revision 4).

…l-focus

main's openclaw#168758 rewrote the plugins page on Solid with PluginsPageController. This merge takes main's plugins-page.ts; the next commit ports the post-removal focus repair onto the controller's uninstall flow.
…gins page (openclaw#127327)

main's openclaw#168758 moved the plugins page to PluginsPageController, so the merge took main's plugins-page.ts. Re-apply the removal focus repair in the controller's uninstall flow: remember the focused control inside the page before confirmation, and after the latest mutation's catalog refresh move focus that fell to the document body onto the remaining view's heading.
@MoerAI

MoerAI commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

Refreshed onto current main (670ad6a9b0f): #168758 moved the plugins page to Solid, so this head (b1cb11a406e) ports the fix into PluginsPageController.uninstall(); the focus helper and the keyboard tests are unchanged. Red/green on this head: plugins-lifecycle.e2e.test.ts passes 9/9 with the branch, and with plugins-page.ts restored to main exactly the two keyboard tests fail (expected false to be true).

Heads-up: main (checked at 670ad6a9b0f and 4d5e0379948) does not build the Control UI, because #169368 removed reactive modules and exports that are still imported, for example domain-board.ts from #168871. I reversed #169368's ui/ changes in the worktree for the local e2e runs only; UI jobs on this PR will fail for that reason until main is repaired. Details are in the PR body under "Port onto the Solid plugins page (2026-10-12)".

@MoerAI

MoerAI commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 12, 2026
…l-focus

Picks up da8802b, which restores the reactive projections main's Control UI build needs. No conflicts; the fix is unchanged.
@MoerAI

MoerAI commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

Added real-Gateway proof for the Solid integration. Current head 576e9118163 also merges main at 48d96b4e3b6, which carries da8802b, so the base no longer needs any local repair.

With the Control UI rebuilt from this head and served by an isolated Gateway, a keyboard-only removal of a synthetic Demo Removal plugin on /settings/plugins/demo-removal ends with focus on the H1 Plugins heading. The same flow against a build with plugins-page.ts restored to main ends on document.body. The per-step focus table is in the PR body under "Port onto the Solid plugins page (2026-10-12)". The browser-harness red/green now runs on unmodified main as well: 9/9 on this head, and exactly the two keyboard tests fail with the main page.

@MoerAI

MoerAI commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 12, 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. 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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. labels Oct 12, 2026
@obviyus
obviyus merged commit 6759726 into openclaw:main Oct 12, 2026
113 of 118 checks passed
@obviyus

obviyus commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator

Landed in 6759726. Thanks @MoerAI, plugin removal in Settings keeps keyboard focus.

@MoerAI
MoerAI deleted the fix/plugin-uninstall-focus branch October 13, 2026 01:29
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 13, 2026
Removing a plugin from Settings > Plugins retired the focused Uninstall button and left keyboard focus on the page body. Focus now moves to the Plugins heading after removal; Cancel returns focus to Uninstall on both the Settings page and the Plugins hub, and focus the user moved elsewhere while removal was pending is left alone. Proof: real isolated Gateway and browser. On main Settings removal left document.activeElement on BODY; with the PR it is the Plugins heading, and the Cancel and moved-focus controls passed. Known follow-up: removing a local or pack-installed plugin from the Plugins hub still drops focus, because the retired route shows Unknown local plugin discovery identity; tracked separately. Fixes openclaw#127327. Thanks @MoerAI.

Co-authored-by: Ayaan Zaidi <[email protected]>
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: 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]: plugin uninstall alertdialog has no focus lifecycle

2 participants