Skip to content

feat(ui): five-zone sidebar — agent identity card, threads/groups/coding, footer bar - #110259

Merged
steipete merged 11 commits into
mainfrom
claude/sidebar-agent-zones
Jul 18, 2026
Merged

steipete merged 11 commits into
mainfrom
claude/sidebar-agent-zones

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

The sidebar treated the agent's main session as just another row (Main Session) in a flat, channel-partitioned list, with the product logo claiming the top slot and the agent identity relegated to a footer chip. For a personal-agent product the hierarchy is backwards: the agent is the primary object, its rolling main session is the primary conversation, and coding/CLI sessions are background noise.

Why This Change Was Made

Owner-directed redesign into five zones (design mockups reviewed in-session):

  1. Agent identity card (top) — new openclaw-sidebar-agent-card replaces both the brand-bar identity and the footer agent chip. Avatar + name + presence + live subtitle; card body opens the agent's main session (the main-session row leaves the list — its spawned children are promoted to top-level threads); trailing button opens the existing agent menu, labeled as a switcher when 2+ agents exist. Main-session unread/running state surfaces on the card.
  2. Threads — the tree-projected chat sessions (renamed from "Chats"; channel-based top-level sections removed, DM channel sessions fold in). Pinned rows and custom drag-and-drop categories preserved.
  3. Groups — kind: "group" sessions as quiet compact rows.
  4. Coding — one collapsed-by-default muted zone unifying the old "Work" section (worktree/exec-node), the Codex/Claude CLI catalogs, and live ACP sessions (new isAcpSessionKey classifier). Collapsed header shows true count + running dot.
  5. Footer bar — product logo (with lobster stand-in intact), version build chip, gateway connection dot, settings gear. Product chrome recedes; the agent owns the top.

Zone partition rules (groupSidebarSessionRows) rewritten accordingly; collapsed zones no longer consume the visible page budget, and headers use pre-pagination counts so paged-out zones stay visible.

User Impact

The web sidebar reads as "my agent, its threads, the places it listens, background coding work" instead of a session dump. Collapse state, pins, categories, catalog interactions, and the agent menu all keep working. First run starts with Coding collapsed. Removed: the empty-chat fallback row (redundant with the card) and the chat.sidebar.chats/workSessions labels (i18n keys replaced by threads/groups/coding).

Evidence

  • ui/src/components/app-sidebar.test.ts: 104/104 passing (structure rewritten for zones; new regression test: main-session children promoted to top-level threads incl. alias parent keys)
  • ui/src/lib/sessions/grouping.test.ts: 12/12 zone-partition cases
  • Full ui/src/lib/sessions: 104 passing; pnpm tsgo:ui clean; pnpm ui:i18n:verify clean; git diff --check clean
  • Local failures in lobster-pet/lobster-dex/dock-panel-layout reproduce with pristine origin/main files (Node 26 jsdom env; CI Linux/Node 24 is truth)
  • 4 autoreview rounds (codex/gpt-5.6-sol): fixed alias-key child promotion, promoted-row filtering/ordering, collapsed-zone page budget, pre-pagination counts, offline aria-label, nested role=list. One repeated finding rejected with code-site proof: adoptedCatalogSessionKeys contains only catalog-bound keys; catalog-adopted children intentionally dedupe into the Coding catalog (invariant now documented inline)
  • Screenshots: follow-up comment (mock harness capture)

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: XL maintainer Maintainer-authored PR labels Jul 18, 2026
@steipete

steipete commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor Author

Before/after (mock-dev harness, pnpm dev:ui:mock — the branch now ships five-zone session fixtures so these are reproducible):

Before (main) After — fresh first run After — Coding expanded
before after fresh after expanded

Visible in the after states: agent identity card (Molty, presence, switcher chevron) replacing the main-session row; Threads with a running tree (child toggle + spinner) and a promoted main-session child with unread dot; Groups as quiet rows with unread; Coding collapsed by default on empty storage (count badge) and expanded showing the worktree row (openclaw ⎇ claude/sidebar-agent-zones); footer bar with logo, version chip, connection dot, settings.

Storage-state coverage per review request: fresh run (no stored collapse state) starts with Coding collapsed — after3-fresh-sidebar; after expanding, a reload preserves the stored expanded preference — after3-reload-sidebar. Full window: after3-full.

Product direction: owner-directed design (five zones, agent card as main-session entry, Coding collapsed by default) — confirmed by @steipete in the working session that produced this PR.

@clawsweeper

clawsweeper Bot commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed July 17, 2026, 9:30 PM ET / July 18, 2026, 01:30 UTC.

Summary
The branch replaces the Control UI’s flat sidebar session list with an agent identity card, Threads, Groups, a collapsed-by-default Coding zone, and a compact footer bar.

PR surface: Source +298, Tests +72, Other +60. Total +430 across 20 files.

Reproducibility: yes. from source: configure global agent scope with two agents that each have children whose parentSessionKey is global, then open the selected agent’s hidden main card; the eager fetch lacks the selected-agent scope needed to prevent cross-agent promotion.

Review metrics: 1 noteworthy metric.

  • Sidebar persistence default: 1 changed first-run collapse default. Absent or malformed local storage now initializes the Coding zone as collapsed, changing the initial navigation state for users without a saved preference.

Stored data model
Persistent data-model change detected: serialized state: ui/src/components/app-sidebar-session-types.ts, serialized state: ui/src/components/app-sidebar.test.ts, serialized state: ui/src/lib/session-display.ts, serialized state: ui/src/lib/sessions/grouping.test.ts, serialized state: ui/src/lib/sessions/grouping.ts, serialized state: ui/src/lib/sessions/session-key.ts, and 2 more. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🦐 gold shrimp
Proof: 🐚 platinum hermit ✨ media proof bonus
Patch quality: 🦐 gold shrimp
Result: needs maintainer review before merge.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Scope the global main-child fetch to the selected agent.
  • [P2] Add a regression test with two agents sharing parentSessionKey: "global" and prove no cross-agent child appears.

Risk before merge

  • [P1] In a multi-agent global-scope setup, opening the identity card’s hidden main session can promote another agent’s global-parented children into the selected agent’s Threads, mis-associating session state in the navigation UI.
  • [P1] The branch intentionally changes first-run sidebar persistence by defaulting the Coding zone to collapsed; maintainers should confirm that this product behavior is desired for fresh and malformed local storage states.

Maintainer options:

  1. Scope global main-child loading (recommended)
    Pass the selected agent id to the eager global main-session child fetch and prove that another agent’s children cannot appear in the selected agent’s Threads.
  2. Accept shared-global behavior
    Land the current behavior only if maintainers explicitly define global-parented child sessions as intentionally cross-agent in the Control UI.
  3. Pause the redesign
    Pause this PR if the intended ownership semantics for global main-session children are not yet settled.

Next step before merge

  • [P2] The remaining repair is concrete, but this PR carries the protected maintainer label and needs owner-level review rather than ClawSweeper repair dispatch.

Security
Cleared: The diff changes Control UI rendering, fixtures, styling, translations, and tests; no concrete security or supply-chain regression is evident.

Review findings

  • [P2] Scope global main-child loads to the selected agent — ui/src/components/app-sidebar-session-navigation.ts:91-99
Review details

Best possible solution:

Pass the selected agent id through the hidden global-main child-session fetch, filter/promote only that agent’s children, and add a multi-agent global-scope regression test before the owner-reviewed UI redesign lands.

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

Yes from source: configure global agent scope with two agents that each have children whose parentSessionKey is global, then open the selected agent’s hidden main card; the eager fetch lacks the selected-agent scope needed to prevent cross-agent promotion.

Is this the best way to solve the issue?

No. The five-zone design is an established owner-directed choice, but the current implementation is not the safest form because its global-main child fetch must retain selected-agent ownership before rendering promoted Threads.

Full review comments:

  • [P2] Scope global main-child loads to the selected agent — ui/src/components/app-sidebar-session-navigation.ts:91-99
    When global scope makes the hidden main key global, this eager fetch does not carry the selected agent id. The gateway can therefore return global-parented children for every agent, and the sidebar promotes them into the selected agent’s Threads. Pass the selected agent through this path and add a multi-agent global-scope regression test.
    Confidence: 0.97

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add merge-risk: 🚨 session-state: The current global-main child fetch can combine children from multiple agents before the sidebar promotes them into one selected agent’s thread view.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (screenshot): The contributor supplied after-fix browser screenshots from the mock-dev Control UI that directly show the new sidebar zones and both fresh and persisted collapse behavior; the remaining global-scope defect requires targeted regression coverage rather than additional general UI media.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.
  • remove status: 👀 ready for maintainer look: Current PR status label is status: ⏳ waiting on author.

Label justifications:

  • P2: The defect can mis-associate visible session threads in a bounded multi-agent Control UI configuration, but it is not an availability or data-loss emergency.
  • merge-risk: 🚨 session-state: The current global-main child fetch can combine children from multiple agents before the sidebar promotes them into one selected agent’s thread view.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (screenshot): The contributor supplied after-fix browser screenshots from the mock-dev Control UI that directly show the new sidebar zones and both fresh and persisted collapse behavior; the remaining global-scope defect requires targeted regression coverage rather than additional general UI media.
  • proof: sufficient: Contributor real behavior proof is sufficient. The contributor supplied after-fix browser screenshots from the mock-dev Control UI that directly show the new sidebar zones and both fresh and persisted collapse behavior; the remaining global-scope defect requires targeted regression coverage rather than additional general UI media.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The contributor supplied after-fix browser screenshots from the mock-dev Control UI that directly show the new sidebar zones and both fresh and persisted collapse behavior; the remaining global-scope defect requires targeted regression coverage rather than additional general UI media.
Evidence reviewed

PR surface:

Source +298, Tests +72, Other +60. Total +430 across 20 files.

View PR surface stats
Area Files Added Removed Net
Source 13 661 363 +298
Tests 6 164 92 +72
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 76 16 +60
Total 20 901 471 +430

What I checked:

  • Exact-head global-scope defect: The eager child-load added for the hidden main-session card calls the loader with only the literal main key; under global scope that key is global, so the selected agent is not available to scope the resulting child list before promotion. (ui/src/components/app-sidebar-session-navigation.ts:91, 2283888d70ff)
  • Gateway contract cited in review discussion: The exact-head review discussion identifies that an absent agentId reads the combined session store, while agent filtering is applied only when an agent id is supplied; agent-specific children may share parentSessionKey: "global". (src/gateway/server-methods/sessions-read.ts:133, c08ce42cefc9)
  • Prior global-key fix: The earlier review finding was addressed by resolving the canonical global main key so the identity card hides and reflects the global main row; the remaining concern is the separate child-fetch scoping path. (ui/src/lib/sessions/session-key.ts:185, ad14ae5287ea)
  • Visible behavior proof: The follow-up comment supplies before/after Control UI screenshots showing the identity card, zones, Coding collapse state, and persisted expanded preference; this directly demonstrates the redesigned sidebar surface, though it does not exercise the multi-agent global-scope defect. (scripts/control-ui-mock-dev.ts:952, 2283888d70ff)

Likely related people:

  • steipete: The PR discussion records this five-zone redesign as owner-directed by steipete, and the branch history contains the global-main handling and sidebar implementation changes relevant to the remaining repair. (role: product-direction confirmer and recent area contributor; confidence: high; commits: 98cafe02bfe6, ad14ae5287ea, 2283888d70ff; files: ui/src/components/app-sidebar-session-navigation.ts, ui/src/lib/sessions/session-key.ts, ui/src/components/app-sidebar.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.
Review history (2 earlier review cycles)
  • reviewed 2026-07-18T00:21:04.122Z sha cbf3a9a :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-18T00:46:31.640Z sha ad14ae5 :: needs maintainer review before merge. :: none

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cbf3a9a701

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +572 to +579
protected selectedAgentMainSessionKey(agentId?: string): string {
return buildAgentMainSessionKey({
agentId: agentId ?? this.expandedAgentId(),
mainKey: resolveUiConfiguredMainKey({
agentsList: this.context?.agents.state.agentsList,
hello: this.context?.gateway.snapshot.hello,
}),
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Honor global main sessions in the agent card

When session.scope is global, the gateway advertises the canonical main session as global (src/config/sessions/main-session.ts:18-24 and src/gateway/server/health-state.ts:41-45), but this new helper always synthesizes agent:<id>:<mainKey>. The new identity card uses this value to hide the main row and to find the row for active/run/unread state, so global-scope users can still get the global main row in Threads while the card does not show that main session as active/running/unread. Resolve the canonical main key from the gateway defaults, or map global scope to global, before comparing/rendering the card.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed across b3e13b1 + ad14ae5 — selectedAgentMainSessionKey now resolves the canonical key via resolveUiCanonicalMainSessionKey when global scope is configured (advertised mainSessionKey first, global sentinel fallback pre-hello), so the identity card owns the global main row's active/running/unread state and it no longer leaks into Threads. Regression test: "treats the global key as the main session under global scope" (row hidden, sibling listed, card unread dot asserted).

@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Jul 18, 2026
@clawsweeper clawsweeper Bot added 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. P2 Normal backlog priority with limited blast radius. labels Jul 18, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2283888d70

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

!this.failedChildSessionKeys.has(mainRow.key) &&
!this.loadingChildSessionKeys.has(mainRow.key)
) {
void this.loadChildSessions(mainRow.key);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Scope global main-child loads to the selected agent

When agents.scope is global, the hidden main row key is the literal global, so this eager load calls sessions.list with only spawnedBy: "global". The gateway loads the combined session store when agentId is absent (src/gateway/server-methods/sessions-read.ts:133-164) and only filters rows by agent when opts.agentId is set (src/gateway/session-utils.ts:2516-2548), while sessions.create supports agent-specific children with parentSessionKey: "global" (src/gateway/server.sessions.create.test.ts:1300-1308). In a multi-agent global-scope setup, expanding/promoting the card's hidden-main children can therefore pull another agent's global children into the selected agent's Threads; pass the selected agent id through this main-child fetch (at least for global main) before promoting those rows.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jul 18, 2026
@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 Jul 18, 2026
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. label Jul 18, 2026
@steipete
steipete merged commit 75e4103 into main Jul 18, 2026
127 of 133 checks passed
@steipete
steipete deleted the claude/sidebar-agent-zones branch July 18, 2026 01:39
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 18, 2026
…ing, footer bar (openclaw#110259)

* feat(ui): five-zone sidebar with agent identity card, threads/groups/coding zones, and footer bar

* fix(ui): promote main-session children via the gateway row's literal key

* fix(ui): filter and sort promoted main-session threads; hide empty Coding count

* fix(ui): collapsed zones no longer consume the visible session page budget

* fix(ui): a11y — offline card label and catalog lists outside the Coding list container

* fix(ui): zone headers use pre-pagination counts so paged-out zones stay visible

* chore(ui): document catalog-adoption dedup invariant on promoted threads

* chore(ui): seed five-zone sidebar fixtures in the mock-dev harness

* fix(ui): resolve the canonical global main key for the identity card under global scope

* fix(ui): global scope resolves the global sentinel as canonical main even pre-hello

* fix(ui): drop dead channelDisplayLabel, avoid map-spread, type zone test helper
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: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. 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: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: XL 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.

1 participant