Skip to content

refactor(ui): use native menus for device actions - #170784

Merged
steipete merged 4 commits into
mainfrom
solid2/devices-wa-exit
Oct 13, 2026
Merged

steipete merged 4 commits into
mainfrom
solid2/devices-wa-exit

Conversation

@steipete

@steipete steipete commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The Devices row action menu still depended on Web Awesome after the shared native menu became available.

User Impact

Device actions now use the shared native menu while preserving action order, pairing permission explanations, clipboard feedback, alias editing, and removal. Focus stays on Copy device ID when an inventory refresh inserts approval actions before it.

Why This Change Was Made

Use the existing Menu owner for rendering, navigation, and activation. The Devices consumer retains its callbacks and live pairing-permission check. Update the two unit files and three directly coupled E2E callers to activate the native menu items.

Production menu code shrinks from 124 to 116 lines. The two unit files grow by 41 lines to exercise actual trigger/item buttons; the four E2E selector replacements add no lines.

Evidence

Check Result
Managed independent review of all six files Scoped clean, no actionable P0–P2 findings; the later test-only CI repair also received a clean independent delta review
pnpm tsgo:ui Passed; 136.66 s wall
pnpm test ui/src/pages/devices/devices-page.test.tsx --maxWorkers=1 37 passed; 226.71 s wall, 148.90 s Vitest
pnpm test ui/src/pages/devices/view.devices.test.ts --maxWorkers=1 25 passed; 186.09 s wall, 67.56 s Vitest
Production build at the merge base Passed; startup JavaScript 343,415 B gzip, one startup CSS request
Production build at ab20301e7e49e3a9067d75991b24cabb07989fc1 Passed; 163.67 s wall; production code is unchanged by the later test-only CI repair
Paired strict performance check Passed with no violations; startup JavaScript 343,415 → 343,410 B gzip, eight JS requests and one CSS request on both sides
Paired desktop and narrow read-only captures Passed with zero browser errors; synthetic fixtures at the exact merge base and ab20301e7e49e3a9067d75991b24cabb07989fc1
Exact-head CI, including browser and real-Gateway E2Es Run 38368850628 passed at ff17aa266869db483aa30a9bc9f0bc7281f716ec; lint, core test types, security-fast, and openclaw/ci-gate all passed, with no failed jobs

CI on ab20301e7e49e3a9067d75991b24cabb07989fc1 found two missing required expectDefined diagnostic-context arguments and formatting in the touched test file. The follow-up commit adds those two messages and applies the repository formatter; it changes no production behavior. The formatter check passed, and the repair received a separate managed review. Runtime, build, and screenshot results above were recorded at ab20301e7e49e3a9067d75991b24cabb07989fc1, before the later main integration. The Devices implementation itself is unchanged; the successful exact-head CI run covers the integrated graph.

The branch also merges main at e400b3a727c18ba13cd3edf80bf3adf83513ecc8, including the unrelated Subagents dialog test locator fix. The final head is ff17aa266869db483aa30a9bc9f0bc7281f716ec. Its six-file authored patch is byte-identical to the independently reviewed patch; the integration was conflict-free.

The local proof uses one private frozen install. The baseline build reuses its dependencies from a separate source checkout. Its first attempt exposed a missing package-local dependency link; after adding those dependency links, the unchanged baseline built successfully.

The desktop capture opens the actual row menu, focuses Copy device ID, publishes a mocked node-inventory refresh that inserts approval actions, and verifies retained item identity/focus, all six actions, clipboard output, menu closure, and trigger focus restoration. The narrow read-only capture verifies the disabled pairing actions and their reasons while Copy stays available. All four screenshots were inspected and contain synthetic data only.

The before/after desktop and narrow read-only screenshots are attached below.

Before: Devices desktop actions after inventory refresh

After: Native Devices desktop menu retains Copy focus

Before: Devices actions in narrow read-only view

After: Native Devices actions in narrow read-only view

Keep device action ordering, pairing permission reasons, trigger accessibility, callbacks, and focus across inventory refreshes while moving Devices onto the shared Menu owner.
@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 13, 2026
@clawsweeper

clawsweeper Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review October 13, 2026 07:30
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T08:26:47.295545Z ff17aa2 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@steipete
steipete merged commit 8815aa6 into main Oct 13, 2026
103 checks passed
@steipete
steipete deleted the solid2/devices-wa-exit branch October 13, 2026 10:31
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 14, 2026
* refactor(ui): use native menus for device actions

Keep device action ordering, pairing permission reasons, trigger accessibility, callbacks, and focus across inventory refreshes while moving Devices onto the shared Menu owner.

* test(ui): use native device menu selectors

* test(ui): add context to device action assertions
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 ci:full Keep ordinary native-locale CI selection on the next PR run. size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant