Skip to content

improve(ui): make agent switching faster and more visual - #126968

Merged
vyctorbrzezowski merged 4 commits into
openclaw:mainfrom
vyctorbrzezowski:brzezowski/agent-switcher-visual-intent
Aug 22, 2026
Merged

vyctorbrzezowski merged 4 commits into
openclaw:mainfrom
vyctorbrzezowski:brzezowski/agent-switcher-visual-intent

Conversation

@vyctorbrzezowski

@vyctorbrzezowski vyctorbrzezowski commented Aug 21, 2026 •

Copy link
Copy Markdown
Member

Closes #126672

What Problem This Solves

Switching agents from the sidebar requires an explicit click into a row-oriented menu whose entries have similar visual weight. With several configured agents, the active agent is harder to recognize and the roster is slower to scan than this frequent action should be.

Why

In this PR, the existing sidebar agent card opens after 300 ms of fine-pointer hover intent while retaining immediate click, touch, Enter, and Space behavior. The menu uses an explicit closed / hover-pending / open-hover / open-click interaction state so click never competes with hover timers: click-open menus stay pinned, hover-open menus allow a 200 ms trigger-to-menu grace period, and clicking a hover-open menu pins it.

The existing agent-menu owner now presents the canonical agent list as a compact three-column grid. It gives the active avatar a subtle accent ring, mutes inactive avatars until hover or keyboard focus, keeps one- and two-line labels aligned, filters larger rosters, and limits the roster viewport to two complete rows before internal scrolling. Selection still uses the existing agent-switch path; this does not add a second selector or a parallel source of agent state.

Before the final push, technical-deslop consolidated avatar state through shared CSS properties, derived the grid viewport from shared tile metrics, removed redundant roster coverage, and eliminated assertion debt. The focused behavior remained unchanged and was rerun after cleanup.

User Impact

Fine-pointer users can pause over the agent chip and scan a visual roster without an extra click. Click, touch, and keyboard users keep an immediate, deterministic open path; large rosters remain compact and searchable; custom photos, emoji avatars, initials, long names, hover, focus, and active state share the same geometry.

Evidence

  • Head: de51d71e842bb008ff0784c26b349601adc8823a, rebased on ea1cd39d6c9ac880eaa531e57c98219d8c559e57.
  • node scripts/run-vitest.mjs run ui/src/components/app-sidebar.test.ts -t 'AppSidebar agent chip' — 38 passed, 249 skipped.
  • node scripts/run-vitest.mjs ui/src/e2e/sidebar-interactions.e2e.test.ts -t 'one row per agent' — 1 passed, 5 skipped; verified active-item focus, ArrowDown navigation into the nested grid, and Enter selection.
  • Headless Chromium visual proof below covers the unchanged styling diff; the keyboard-only follow-up is covered by the focused E2E above. The mock returned repeated 200 responses for /chat, the Vite client, and the dynamic module with no console or page errors during capture.
  • The already-running check:changed completed its pre-typecheck stages, then was terminated during the full typecheck stage. Full typecheck and lint are intentionally left to the external lander.
  • Production LOC: +438/-58. Test LOC: +161/-53. Assertion-safety baseline: -1.

Three-agent roster

Active Molty, hovered Atlas, and inactive long-name Forge in both themes:

Dark Light
Three-agent roster in dark mode Three-agent roster in light mode

Eight-agent roster

The filter appears above a two-complete-row scroll viewport; the remaining agents stay available through internal scrolling.

Dark Light
Eight-agent roster in dark mode Eight-agent roster in light mode

Custom photo states

Theme Inactive Hover Active
Dark Custom photo inactive in dark mode Custom photo hovered in dark mode Custom photo active in dark mode
Light Custom photo inactive in light mode Custom photo hovered in light mode Custom photo active in light mode

Hover intent

The short capture shows delayed hover opening, pointer travel into the menu, and grace-close after leaving both surfaces:

Agent-switcher hover intent

@vyctorbrzezowski vyctorbrzezowski self-assigned this Aug 21, 2026
@clawsweeper

clawsweeper Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: M maintainer Maintainer-authored PR labels Aug 21, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 21, 2026
@clawsweeper

clawsweeper Bot commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 22, 2026, 9:52 AM ET / 13:52 UTC.

ClawSweeper review

What this changes

This PR makes the Control UI agent switcher open after deliberate hover and replaces its row list with a visual, scrollable agent grid.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep open: the current head still hides unpinned agents in large pinned rosters, and the protected feature needs maintainer product direction after that repair.

Priority: P3
Reviewed head: de51d71e842bb008ff0784c26b349601adc8823a
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch has useful, visually documented intent but retains a concrete large-roster correctness blocker.
Proof confidence 🌊 off-meta tidepool Not applicable: The author is a repository member, so the external-contributor proof gate does not apply; the PR body nevertheless includes visual evidence for the intended UI states.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The author is a repository member, so the external-contributor proof gate does not apply; the PR body nevertheless includes visual evidence for the intended UI states.
Evidence reviewed 5 items Pinned-roster bug on PR head: For a large roster with valid pins and no filter query, the row builder returns only pins plus the active agent, omitting every other agent.
Full roster reaches the affected owner: The menu renderer passes the complete configured agent list and pinned IDs to the row builder, so no upstream truncation explains the omission.
Test currently preserves the regression: The large pinned-roster test explicitly expects only the two pins and active agent, contrary to the PR’s promised scrollable full roster.
Findings 1 actionable finding [P2] Keep unpinned agents in pinned rosters
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs ui/src/e2e/sidebar-interactions.e2e.test.ts -t 'one row per agent'

Result: FAIL (partial) — step 2 expect_output 1 passed: expected terminal output was not visible within 30 seconds: "1 passed"

node scripts/run-vitest.mjs ui/src/e2e/sidebar-interactions.e2e.test.ts -t 'one row per agent'
runner@runnervm76f27:/tmp/clawsweeper-live-proof-126968-8vtaTz/target$ node scripts/run-vitest.mjs ui/src/e2e/sidebar-interactions.e2e.test.ts -t 'one row per a
gent'
[test] starting test/vitest/vitest.ui-e2e.config.ts
[test] preflight test/vitest/vitest.ui-e2e.config.ts
node scripts/run-vitest.mjs ui/src/e2e/sidebar-interactions.e2e.test.ts -t 'one row per agent'
[ui-e2e] Using system Chromium at /usr/bin/chromium-browser.
Downloading FFmpeg (playwright ffmpeg v1011) from https://cdn.playwright.dev/dbazure/download/playwright/builds/ffmpeg/1011/ffmpeg-linux.zip
|                                                                                |   0% of 2.3 MiB
|■■■■■■■■                                                                        |  10% of 2.3 MiB
|■■■■■■■■■■■■■■■■                                                                |  20% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■                                                        |  30% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■                                                |  40% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■                                        |  50% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■                                |  60% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■                        |  70% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■                |  80% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■        |  90% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■| 100% of 2.3 MiB
FFmpeg (playwright ffmpeg v1011) downloaded to /tmp/clawsweeper-live-proof-126968-8vtaTz/profile/cache/ms-playwright/ffmpeg-1011

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-126968-8vtaTz/target





























Assertions:

  • FAIL expect_output: 1 passed

How this fits together

The Control UI sidebar receives the configured agent roster and renders an agent chip. Opening that chip produces the existing agent-selection menu, whose chosen agent is passed back into the sidebar’s canonical switch flow.

flowchart LR
  A[Configured agent roster] --> B[Sidebar agent chip]
  B --> C[Hover or click interaction]
  C --> D[Agent switcher menu]
  D --> E[Agent selection]
  E --> F[Active agent workspace]
Loading

Decision needed

Question Recommendation
After the pinned-roster repair, should the Control UI adopt delayed hover opening and a tile-grid agent switcher as its default multi-agent interaction? Sponsor the scoped interaction: Keep click, touch, and keyboard behavior, repair the pinned-first full roster, and accept hover-plus-grid switching as the Control UI default.

Why: This is a deliberate default interaction change, and the linked feature issue remains marked for maintainer product direction.

Before merge

  • Keep unpinned agents in pinned rosters (P2) - For a large roster with valid pins, this branch returns only pinned agents plus the active agent, so every unpinned agent disappears from the grid and cannot be reached through its scroll viewport. Return the full pinned-first list instead; the adjacent test currently locks in the regression.
  • Resolve merge risk (P1) - Merging as-is makes unpinned agents unreachable from a large pinned workspace unless the operator knows to search for them.
  • Complete next step (P2) - The protected maintainer label and unresolved product direction require human handling; the identified code repair is narrow but should not be auto-dispatched.

Findings

  • [P2] Keep unpinned agents in pinned rosters — ui/src/components/app-sidebar-agent-menu.ts:203-210
Agent review details

Security

None.

PR surface

Source +480, Tests +8, Other -1. Total +487 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 7 572 92 +480
Tests 1 27 19 +8
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 0 1 -1
Total 9 599 112 +487

Review metrics

Metric Value Why it matters
Production versus test LOC production +438/-58; tests and test support +161/-53; assertion baseline -1 The feature materially expands the sidebar interaction and visual-menu surface, so the complete-roster invariant needs coverage for pinned as well as unpinned workspaces.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #126672
Summary: This PR is the candidate implementation for the linked multi-agent switcher feature request.

Members:

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

Merge-risk options

Maintainer options:

  1. Restore the full pinned-first roster (recommended)
    Return every configured agent in pinned-first order and revise the pinned-roster test to require an unpinned tile.

Technical review

Best possible solution:

Adopt one complete pinned-first roster for large menus, with the grid viewport providing compactness rather than suppressing agents, after a maintainer confirms the hover-and-grid interaction direction.

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

Yes—source provides a high-confidence path: configure more than six agents, pin at least one non-active agent, and open the menu without filtering; only pins and the active agent render.

Is this the best way to solve the issue?

No—the current patch keeps the prior pinned-only shortcut despite changing the intended design to a scrollable full roster; a pinned-first complete list is the narrower canonical fix.

Full review comments:

  • [P2] Keep unpinned agents in pinned rosters — ui/src/components/app-sidebar-agent-menu.ts:203-210
    For a large roster with valid pins, this branch returns only pinned agents plus the active agent, so every unpinned agent disappears from the grid and cannot be reached through its scroll viewport. Return the full pinned-first list instead; the adjacent test currently locks in the regression.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.99

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against ea1cd39d6c9a.

Labels

Label justifications:

  • P3: This is a scoped Control UI ergonomics feature, not a current workflow outage.
  • merge-risk: 🚨 other: The new roster policy can suppress valid agent choices in existing pinned multi-agent workspaces.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: The author is a repository member, so the external-contributor proof gate does not apply; the PR body nevertheless includes visual evidence for the intended UI states.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Introduced the scalable Control UI agent switcher and later maintained its placement and menu behavior. (role: original feature owner and recent area contributor; confidence: high; commits: 9086389527b1, c1987081c7d8, 1bd5f22b1341; files: ui/src/components/app-sidebar-agent-menu.ts, ui/src/components/sidebar-menus-controller.ts, ui/src/components/app-sidebar-render.ts)
  • joshavant: Maintained configured agent-label behavior in the same agent-menu surface. (role: recent adjacent contributor; confidence: medium; commits: 2fbf4fdbe6aa; files: ui/src/components/app-sidebar-agent-menu.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Render all large-roster agents in pinned-first order and revise the pinned-roster assertion to include an unpinned tile.
  • Rerun the focused sidebar unit and browser interaction checks after the repair.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (6 earlier review cycles)
  • reviewed 2026-08-21T03:18:33.841Z sha 36cd53634b7865f0fad9db850c8dc9309262e1e2 :: found issues before merge. :: [P2] Update the sidebar browser contract for tile markup
  • reviewed 2026-08-21T03:29:11.150Z sha 36cd53634b7865f0fad9db850c8dc9309262e1e2 :: found issues before merge. :: [P2] Update the sidebar E2E contract for tile markup | [P2] Keep the 264px menu inside the viewport
  • reviewed August 21, 2026, 12:00 AM ET / 04:00 UTC sha unknown :: found issues before merge. :: [P2] Update the sidebar E2E contract for tile markup | [P2] Clamp the widened menu using its actual width
  • reviewed 2026-08-22T08:59:49.325Z sha 36cd53634b7865f0fad9db850c8dc9309262e1e2 :: found issues before merge. :: [P2] Update the sidebar E2E contract for tile markup | [P2] Clamp the widened menu using its actual width
  • reviewed 2026-08-22T12:20:03.105Z sha b656b8c9c157611c237721b005eb9332017670e0 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-22T13:09:19.137Z sha b656b8c9c157611c237721b005eb9332017670e0 :: needs changes before merge. :: [P2] Keep unpinned agents in pinned rosters

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. label Aug 21, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 22, 2026
@vyctorbrzezowski
vyctorbrzezowski force-pushed the brzezowski/agent-switcher-visual-intent branch from 36cd536 to b656b8c Compare August 22, 2026 12:13
@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 22, 2026
@vyctorbrzezowski
vyctorbrzezowski marked this pull request as ready for review August 22, 2026 12:26
@clawsweeper

clawsweeper Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@clawsweeper clawsweeper Bot added status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 22, 2026
@vyctorbrzezowski
vyctorbrzezowski force-pushed the brzezowski/agent-switcher-visual-intent branch from b656b8c to de51d71 Compare August 22, 2026 13:45
@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@vyctorbrzezowski
vyctorbrzezowski merged commit 4371090 into openclaw:main Aug 22, 2026
168 checks passed
@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

Merged via squash.

@vyctorbrzezowski
vyctorbrzezowski deleted the brzezowski/agent-switcher-visual-intent branch August 22, 2026 15:56
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 23, 2026
…6968)

* improve(ui): refine agent switching

* test(ui): cover agent switcher behavior

* fix(ui): preserve agent menu keyboard navigation

* fix(ui): keep full agent roster reachable
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 maintainer Maintainer-authored PR merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: L status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Make multi-agent switching faster and more visual

1 participant