Skip to content

feat(ui): rename, delete, and toggle sidebar session groups - #101117

Merged
steipete merged 5 commits into
mainfrom
claude/zealous-booth-70d16a
Jul 6, 2026
Merged

steipete merged 5 commits into
mainfrom
claude/zealous-booth-70d16a

Conversation

@steipete

@steipete steipete commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Closes #101116

What Problem This Solves

Sidebar session groups (added in #100814/#100648) are write-once: a group can be created and sessions assigned to it, but there is no way to rename a group, delete one, keep an empty group visible, or turn grouping off. Stale group names linger in the move-to-group submenu forever, and reorganizing means re-assigning every member session by hand.

Why This Change Was Made

Group headers get the same management affordance session rows already have: a hover kebab plus right-click menu with Rename group, New group, and Delete group. Rename and delete enumerate every member session with unbounded sessions.list queries (active + archived, across agents) and patch category per session — the windowed sidebar list can miss members, and archived sessions must keep the new name so restores land in the right group. Delete keeps the sessions and moves them back to Ungrouped. Stored-but-empty groups now render as sections so a freshly created group is a usable move target. The sidebar sort popover gains a Group by toggle (Custom groups / None) persisted per browser profile; None flattens categories into one list while Pinned stays separate. No gateway/protocol changes: group membership is already per-session server state via sessions.patch category.

Non-goals: the Sessions page table keeps its existing group-by UI (it reflects renames automatically since categories are server-side), and iOS/Android group-management parity is follow-up work.

User Impact

Sidebar groups are now maintainable: rename a group in place, delete it without losing sessions, create an empty group before filling it, and switch the sidebar to one flat recent list when grouping is unwanted. Group renames carry archived sessions along, so restoring an archived session lands in the renamed group.

Screenshots

Group sections with the header kebab Group header menu Group by / Sort by popover (after renaming Research → Projects; the empty renamed group stays visible)
Sidebar group sections Group header menu with Rename, New, and Delete group Group by and Sort by popover

Evidence

  • Unit (Blacksmith Testbox): pnpm test ui/src/lib/sessions/custom-groups.test.ts ui/src/lib/sessions/grouping.test.ts — 19/19 passed (run 28813504291).
  • E2E, mock gateway + Playwright (Testbox): pnpm test ui/src/e2e/session-management.e2e.test.ts — 4/4 passed, including the new renames, deletes, and toggles sidebar session groups case asserting per-member sessions.patch calls (archived member included) and the flat-list toggle (run 28811188010).
  • Types (Testbox): pnpm tsgo:core:all and pnpm check:test-types both green. pnpm check:changed guard lanes green; its diff-based warning lane aborts on the known Testbox no-merge-base sync quirk, so the type/test lanes above were run explicitly.
  • i18n: pnpm ui:i18n:sync regenerated locale bundles + .i18n metadata for the new strings (English fallbacks recorded in fallbackKeys, same as prior sidebar strings); pnpm ui:i18n:check clean on Testbox (run 28814349995).
  • Docs: sidebar section of docs/web/control-ui.md updated.
  • Autoreview (Codex, gpt-5.5, final tree): clean — no findings, "patch is correct" (confidence 0.84).

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: XL maintainer Maintainer-authored PR labels Jul 6, 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: 85bcd65a74

ℹ️ 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 thread ui/src/lib/sessions/custom-groups.ts Outdated
Comment on lines +49 to +50
sessions.list({ activeMinutes: 0, limit: 0 }),
sessions.list({ activeMinutes: 0, limit: 0, showArchived: true }),

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.

P1 Badge Page through all group members before patching

For groups with more than the default sessions.list page, rename/delete only updates the first page of active and archived rows: SessionCapability.list drops nonpositive limit/activeMinutes before sending the RPC, while the protocol requires limit and activeMinutes to be at least 1 and the gateway applies a bounded default. In a group with, for example, 101 active sessions named Research, the 101st session is never returned here, so it keeps the old category after Rename group or Delete group and the sidebar/store ends up split between old and new group names; this needs pagination using hasMore/nextOffset or another real unbounded/bulk path instead of limit: 0.

Useful? React with 👍 / 👎.

@clawsweeper

clawsweeper Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 6, 2026, 7:41 PM ET / 23:41 UTC.

Summary
The PR adds sidebar group-header menus for new/rename/delete, keeps empty groups visible, adds a browser-local Group by toggle, updates docs/i18n/styles, and covers the behavior with unit and Playwright tests.

PR surface: Source +670, Tests +286, Docs 0. Total +956 across 49 files.

Reproducibility: yes. Current main source shows the missing group-header controls, empty-group sidebar sections, and grouping-off preference, while the latest PR source and tests exercise those paths; I did not run a browser repro in this read-only review.

Review metrics: 1 noteworthy metric.

  • Persisted UI preference: 1 added. The sidebar Group by choice is stored per browser profile, so reviewers should notice the new user preference before merge.

Stored data model
Persistent data-model change detected: serialized state: ui/src/e2e/session-management.e2e.test.ts, serialized state: ui/src/lib/sessions/custom-groups.test.ts, serialized state: ui/src/lib/sessions/custom-groups.ts, serialized state: ui/src/lib/sessions/grouping.test.ts, serialized state: ui/src/lib/sessions/grouping.ts, unknown-data-model-change: ui/src/e2e/session-management.e2e.test.ts, and 2 more. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #101116
Summary: This PR is the open candidate fix for the sidebar group-management issue; the earlier merged session-management PR is predecessor context.

Members:

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

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🌊 off-meta tidepool
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

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

Rank-up moves:

  • [P2] Let required CI settle or rerun the failing shard before merge.
  • Have the likely owner confirm the sidebar UX and browser-local grouping preference are the intended product direction.

Risk before merge

  • [P1] The PR adds user-initiated bulk rename/delete paths that rewrite persisted session category metadata across active and archived sessions, so maintainers should explicitly accept that behavior before merge.
  • [P1] One current live CI shard is failing on the latest head, so merge should still wait for required check gating or a rerun even though no source-level blocker was found.

Maintainer options:

  1. Accept user-initiated category rewrites after review (recommended)
    Land after maintainers accept that sidebar rename/delete pages all active and archived sessions and patches their category metadata via the existing sessions.patch path.
  2. Pause for a different state model
    Hold the PR if maintainers want gateway-owned atomic group mutation before exposing rename/delete in the sidebar.

Next step before merge

  • [P1] No repair lane is needed from this review: the prior pagination blocker is fixed, and the protected-label feature PR now needs maintainer product/merge handling plus normal CI gating.

Maintainer decision needed

  • Question: Should OpenClaw accept this Control UI-only group-management UX and browser-local grouping preference for the sidebar?
  • Rationale: The PR adds visible sidebar controls and a persisted browser preference, and it carries a protected maintainer label, so automation should not treat product acceptance as settled by code review alone.
  • Likely owner: steipete — steipete owns the linked issue/PR pair and the recent sidebar grouping feature history.
  • Options:
    • Accept this PR shape (recommended): Proceed with the current Control UI implementation after exact-head checks pass because it now uses the existing paginated sessions.list plus sessions.patch category contract.
    • Narrow the UX: Ask for a smaller UI surface if maintainers want rename/delete but not the separate sidebar grouping toggle or empty-group rendering behavior.
    • Require a gateway bulk API first: Pause this PR if maintainers want atomic server-owned group rename/delete semantics instead of UI enumeration and per-session patching.

Security
Cleared: No concrete security or supply-chain concern found; the diff stays in Control UI code, tests, docs, styles, and generated locale output without dependency, workflow, auth, or secret-surface changes.

Review details

Best possible solution:

Land the Control UI implementation after maintainer product acceptance and exact-head checks, preserving paginated active/archive enumeration and the existing gateway category contract.

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

Yes. Current main source shows the missing group-header controls, empty-group sidebar sections, and grouping-off preference, while the latest PR source and tests exercise those paths; I did not run a browser repro in this read-only review.

Is this the best way to solve the issue?

Yes, as a patch shape. Keeping this in Control UI on top of the existing sessions.list pagination and sessions.patch category contract is narrower than adding a gateway bulk API, but maintainers still need to accept the new UX and preference.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The external contributor proof gate is not applied because this PR carries the protected maintainer label; the screenshots and E2E evidence were still reviewed as supporting context.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This is a bounded Control UI session-organization feature with limited blast radius, not an emergency runtime or setup failure.
  • merge-risk: 🚨 session-state: Rename and delete group actions can rewrite persisted session category metadata across active and archived sessions.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The external contributor proof gate is not applied because this PR carries the protected maintainer label; the screenshots and E2E evidence were still reviewed as supporting context.
Evidence reviewed

PR surface:

Source +670, Tests +286, Docs 0. Total +956 across 49 files.

View PR surface stats
Area Files Added Removed Net
Source 45 760 90 +670
Tests 3 286 0 +286
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 49 1047 91 +956

What I checked:

Likely related people:

  • steipete: Authored the merged session-management PR that introduced sidebar grouping, authored recent sidebar follow-ups, opened the linked issue, and authored this candidate implementation. (role: feature owner and recent area contributor; confidence: high; commits: 88f1ec38d4a5, add5c513aed8, e9464313b728; files: ui/src/components/app-sidebar.ts, ui/src/lib/sessions/grouping.ts, ui/src/lib/sessions/custom-groups.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-06T19:56:20.871Z sha 85bcd65 :: needs real behavior proof before merge. :: [P1] Page through all group members before patching
  • reviewed 2026-07-06T23:14:25.528Z sha f071547110440c17f76dc8a30e006718cb4f3da2 :: needs real behavior proof before merge. :: [P1] Page through all group members before patching

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. labels Jul 6, 2026
steipete added 4 commits July 6, 2026 16:19
Sidebar group headers gain a kebab + right-click menu with Rename group,
New group, and Delete group. Rename/delete enumerate every member session
(active + archived, across agents) via unbounded sessions.list queries and
patch category per session; delete keeps sessions and moves them to
Ungrouped. Stored-but-empty groups render as sections, and the sidebar
sort popover gains a persisted Group by toggle (Custom groups / None).
…fault

sessions.list caps an absent limit at SESSIONS_LIST_DEFAULT_LIMIT (100), so
the rename/delete member enumeration now walks nextOffset pages explicitly;
a silent cap would strand members in the old group on stores >100 sessions.
@steipete
steipete force-pushed the claude/zealous-booth-70d16a branch from f071547 to 6b7ccd5 Compare July 6, 2026 23:21
@clawsweeper clawsweeper Bot added 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. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jul 6, 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: 6b7ccd51a9

ℹ️ 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 +98 to +99
members.map((row) =>
sessions.patch(row.key, { category }, { agentId: parseAgentSessionKey(row.key)?.agentId }),

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 Preserve the current session-list scope after bulk patches

When a group contains sessions from multiple agents, each member patch refreshes the shared SessionCapability state with the member's parsed agentId (ui/src/lib/sessions/index.ts:666-688). For example, renaming a group while viewing agent:main:* but with an archived agent:work:* member can leave context.sessions.state.agentId and sessionsResult hydrated for work if that patch finishes last, after which AppSidebar filters that result against the current main session and most recent rows disappear until another refresh. The group mutation should avoid per-member scoped refreshes or restore the original/current list scope once the bulk patch completes.

Useful? React with 👍 / 👎.

@steipete
steipete merged commit 5157446 into main Jul 6, 2026
72 checks passed
@steipete
steipete deleted the claude/zealous-booth-70d16a branch July 6, 2026 23:54
@steipete

steipete commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 7, 2026
…#101117)

* feat(ui): rename, delete, and toggle sidebar session groups

Sidebar group headers gain a kebab + right-click menu with Rename group,
New group, and Delete group. Rename/delete enumerate every member session
(active + archived, across agents) via unbounded sessions.list queries and
patch category per session; delete keeps sessions and moves them to
Ungrouped. Stored-but-empty groups render as sections, and the sidebar
sort popover gains a persisted Group by toggle (Custom groups / None).

* test(ui): capture sidebar group management UI proof shots

* fix(ui): page session-group enumeration past the gateway's 100-row default

sessions.list caps an absent limit at SESSIONS_LIST_DEFAULT_LIMIT (100), so
the rename/delete member enumeration now walks nextOffset pages explicitly;
a silent cap would strand members in the old group on stores >100 sessions.

* chore(i18n): restore fallback-key tracking for new sidebar group strings after rebase

* chore(i18n): translate new sidebar group strings across locales
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 docs Improvements or additions to documentation 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. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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.

Sidebar session groups cannot be renamed, deleted, kept empty, or turned off

1 participant