Skip to content

feat(ui): sidebar Project grouping and truly flat None mode - #131543

Merged
steipete merged 3 commits into
mainfrom
claude/groups-display-project-mode-c0c6ab
Aug 28, 2026
Merged

steipete merged 3 commits into
mainfrom
claude/groups-display-project-mode-c0c6ab

Conversation

@steipete

@steipete steipete commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where setting the sidebar sessions Group by to None still rendered the Other / Groups / Coding zone headers, so the list looked grouped despite the operator explicitly asking for no grouping. It also adds the missing Project grouping mode: there was no way to organize the session list by the repo/workspace a session works in, even though the Codex/Claude harness catalogs directly below already group by project.

Why This Change Was Made

Operator report (with screenshot): "why do i still see groups when I set groups to none? Also I miss a mode to group per project."

The zones-always-split behavior dates back to the five-zone sidebar redesign (#110259), where grouping: "none" was defined to only disable custom categories. That contradicts what the menu promises. None now means one flat list. Project buckets sessions by their resolved work checkout (worktree repo root, exec workspace, or spawned cwd), reusing the same .claude/worktrees/<name> → origin-repo fold the harness catalogs use, so gateway sessions and catalog sessions agree on what one project is. Checkout-less rows keep their smart zones, mirroring how Person mode treats ownerless rows. Project sections are derived (not stored), so they sort alphabetically, take no drags/drops, and show the full checkout path as a header tooltip.

User Impact

  • Group by → None: one flat, headerless session list (pinned rows and the harness catalogs keep their own sections).
  • Group by → Project (new): sessions bucket under their repo/workspace name; worktree checkouts fold into their origin repo; sessions without a checkout stay in Other/Groups.
  • Default (Custom groups) and Person modes are unchanged.
  • Docs: Control UI sidebar section now describes all four Group by modes.
Before (None still shows zones) After (None = flat) After (new Project mode)
before none after none after project

Menu before/after (Project option added):

Before After
menu before menu after

Default Custom-groups layout, unchanged: after category

Evidence

  • Unit coverage: ui/src/lib/sessions/grouping.test.ts — None flattens every zone; Project buckets by checkout with the worktree fold, alphabetical order ahead of stored zones, and residual smart zones; normalizeSidebarSessionsGrouping accepts project. ui/src/components/app-sidebar-session-projection.test.ts — flat list stays headerless beside catalog sections while category mode keeps its header.
  • node scripts/run-vitest.mjs ui/src/lib/sessions/grouping.test.ts ui/src/lib/sessions/catalog-project-grouping.test.ts ui/src/components/app-sidebar-session-projection.test.ts — green; plus the four sidebar component suites (333 tests) and ui/src/e2e/session-management.groups.e2e.test.ts.
  • node scripts/check-changed.mjs — all lanes green (format, tsgo UI typecheck, lint, guards).
  • Live proof: screenshots above captured with Playwright against the mocked Control UI dev server (pnpm dev:ui:mock), before = parent commit, after = this branch. The Project shot also proves the live worktree fold: the "Sidebar project grouping" session (spawned cwd under ~/Projects/openclaw/.claude/worktrees/…) lands in the openclaw section.

Accepted tradeoff: in flat (None) mode the native list renders headerless even if a stored section order places a harness catalog above it; the catalogs keep their own headers and default order keeps the flat list first.

Broken-main encounter

checks-ui-e2e (1/14) was red when this PR first ran: config-form-guidance.e2e.test.ts > keeps the one advanced disclosure browser-local failed at the then-current origin/main (reproduced locally at abf412aba47). Root cause: the collapse click used disclosure.locator("summary"), which after expansion also matches the nested collapsible Prefs object's <summary class="cfg-object__summary"> — a Playwright strict-mode violation, deterministic since the <details> disclosure landed in #131421. Main's #131541 landed the same-shaped fix (:scope > summary) while this was being diagnosed, so after rebasing this PR keeps only the companion hardening: settings-layout.e2e.test.ts carried the identical under-scoped locator (unfired only because its clicks happen pre-expansion) and now scopes to :scope > summary too. Both e2e suites pass locally on the rebased head.

@clawsweeper

clawsweeper Bot commented Aug 28, 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 August 28, 2026 04:56
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui scripts Repository scripts size: M maintainer Maintainer-authored PR labels Aug 28, 2026
Group by: None now renders one flat session list — no Other/Groups/Coding
zone headers — matching what None promises. New Group by: Project buckets
sessions by their resolved repo/workspace checkout, folding
.claude/worktrees checkouts into their origin repo via the same rule the
harness catalogs already use; checkout-less rows keep their smart zones,
mirroring Person mode.
… summary

Companion to #131541, which fixed the strict-mode violation in
config-form-guidance: settings-layout carries the same under-scoped
summary locator; scope it to :scope > summary before it can trip the
same way once its clicks happen against expanded advanced content.
@steipete
steipete force-pushed the claude/groups-display-project-mode-c0c6ab branch from fe771f8 to 90c8706 Compare August 28, 2026 05:16
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 28, 2026
@clawsweeper

clawsweeper Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 28, 2026, 1:24 AM ET / 05:24 UTC.

ClawSweeper review

What this changes

This PR adds sidebar Project grouping based on session checkout paths and makes the None option a single flat session list.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep this PR open: Project grouping currently treats checkout paths differing only by a trailing separator as separate projects, so the new mode can show duplicate identical headers.

Priority: P2
Reviewed head: 90c87061ed4d6a40dd1b46b15c5aa490a0cab191

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The feature has focused tests and a coherent UI integration, but a source-proven path-key defect remains.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied repository state identifies this as a maintainer-authored PR, so the external-contributor proof gate does not apply.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied repository state identifies this as a maintainer-authored PR, so the external-contributor proof gate does not apply.
Evidence reviewed 6 items Introduced grouping trigger: The introduced Project mode passes workContext.path through foldWorktreeCheckoutPath and uses the result directly as the project section map key.
Path producer contract: Resolved work contexts use normalizeOptionalString for paths; that helper removes whitespace but not trailing path separators.
Existing sibling behavior: Catalog project grouping trims trailing slash and backslash characters before applying the same worktree-fold helper, establishing the missing canonicalization at this shared boundary.
Findings 1 actionable finding [P2] Canonicalize project paths before using them as grouping keys
Security None None.

How this fits together

The Control UI sidebar projects Gateway session rows into user-facing sections. Project grouping consumes each row’s resolved work context and emits sections that lead to selectable session rows.

flowchart LR
  A[Gateway session rows] --> B[Resolved work context]
  B --> C[Sidebar grouping mode]
  C --> D[Project path grouping]
  D --> E[Sidebar project sections]
  E --> F[Session list rendering]
Loading

Before merge

  • Canonicalize project paths before using them as grouping keys (P2) - Project mode keys the new sections directly by workContext.path, but that value is only whitespace-trimmed by resolveSessionWorkContext. Consequently /repo/openclaw and /repo/openclaw/ become two identical-looking Project headers even though they are the same checkout. The catalog implementation this reuses strips trailing separators before grouping, so normalize the sidebar path the same way and add the mixed-separator regression case.
  • Complete next step (P2) - A focused P2 repair is required before merge; the protected maintainer label keeps it out of automatic repair routing.

Findings

  • [P2] Canonicalize project paths before using them as grouping keys — ui/src/lib/sessions/grouping.ts:288-290
Agent review details

Security

None.

PR surface

Source +66, Tests +69, Docs 0, Other +12. Total +147 across 10 files.

View PR surface stats
Area Files Added Removed Net
Source 5 102 36 +66
Tests 3 75 6 +69
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 12 0 +12
Total 10 190 43 +147

Review metrics

Metric Value Why it matters
Production versus test delta production +66, tests/test support +81, docs 0 The positive production delta implements a new sidebar grouping mode and needs the missing path-canonicalization regression coverage before merge.

Stored data model

Persistent data-model change detected: migration/backfill/repair: scripts/control-ui-mock-dev.ts, serialized state: ui/src/lib/sessions/catalog-project-grouping.ts, serialized state: ui/src/lib/sessions/grouping.ts, unknown-data-model-change: ui/src/lib/sessions/catalog-project-grouping.ts, unknown-data-model-change: ui/src/lib/sessions/grouping.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Normalize checkout paths once at the shared catalog/sidebar boundary, then verify direct and worktree paths with and without trailing separators converge to one Project section.

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

Yes, from source: two otherwise identical rows using /repo/openclaw and /repo/openclaw/ create distinct introduced map keys in Project mode; no test was run in this read-only checkout.

Is this the best way to solve the issue?

No. Reusing worktree folding without its sibling path canonicalization diverges from the catalog contract; normalize once in the shared helper rather than compensating in the renderer.

Full review comments:

  • [P2] Canonicalize project paths before using them as grouping keys — ui/src/lib/sessions/grouping.ts:288-290
    Project mode keys the new sections directly by workContext.path, but that value is only whitespace-trimmed by resolveSessionWorkContext. Consequently /repo/openclaw and /repo/openclaw/ become two identical-looking Project headers even though they are the same checkout. The catalog implementation this reuses strips trailing separators before grouping, so normalize the sidebar path the same way and add the mixed-separator regression case.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.94

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: The introduced UI grouping defect has a limited but concrete effect on operators with equivalent checkout paths.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: The supplied repository state identifies this as a maintainer-authored PR, so the external-contributor proof gate does not apply.

Label justifications:

  • P2: The introduced UI grouping defect has a limited but concrete effect on operators with equivalent checkout paths.
  • 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 supplied repository state identifies this as a maintainer-authored PR, so the external-contributor proof gate does not apply.

Evidence

Acceptance criteria:

  • [P1] Add a grouping test with /repo/openclaw and /repo/openclaw/ in Project mode and verify they produce one section.
  • [P1] Run the focused UI session-grouping test through the repository wrapper.

What I checked:

Likely related people:

  • steipete: Peter Steinberger authored the current grouping implementation and the Project grouping feature commit. (role: recent sidebar/session grouping contributor; confidence: high; commits: 19d61d9ada04, bfe3d683a7f3; files: ui/src/lib/sessions/grouping.ts, ui/src/lib/session-display.ts)

Rank-up moves

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

  • Normalize checkout paths in the shared catalog/sidebar helper and add trailing-separator coverage for Project sections.

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.

ClawSweeper P2: sidebar Project mode keyed sections by the raw
workContext.path, so /repo/openclaw and /repo/openclaw/ minted two
identical headers. Move trailing-separator stripping into
foldWorktreeCheckoutPath so the catalog and sidebar callers share one
canonicalization; regression case fails pre-fix.
@steipete

Copy link
Copy Markdown
Contributor Author

Addressed the P2 in 6b6a2ba: trailing-separator stripping now lives inside the shared foldWorktreeCheckoutPath, so the catalog and sidebar Project groupings canonicalize identically; the catalog caller dropped its local pre-trim. Added the trailing-separator regression case to the sidebar project test — verified it fails against the pre-fix helper and passes now.

On the stored-data-model flag: no persistent data model changes here — grouping.ts/catalog-project-grouping.ts are pure in-memory view projections and the control-ui-mock-dev.ts change only adds demo fixture rows. The one persisted surface is the browser-local localStorage grouping preference, which gains the project value; unknown values already normalize to the default, so older clients are unaffected.

@steipete
steipete merged commit 87122fa into main Aug 28, 2026
163 checks passed
@steipete
steipete deleted the claude/groups-display-project-mode-c0c6ab branch August 28, 2026 06:00
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 28, 2026
…#131543)

* feat(ui): sidebar project grouping and truly flat None mode

Group by: None now renders one flat session list — no Other/Groups/Coding
zone headers — matching what None promises. New Group by: Project buckets
sessions by their resolved repo/workspace checkout, folding
.claude/worktrees checkouts into their origin repo via the same rule the
harness catalogs already use; checkout-less rows keep their smart zones,
mirroring Person mode.

* test(ui): scope settings-layout advanced-disclosure clicks to its own summary

Companion to openclaw#131541, which fixed the strict-mode violation in
config-form-guidance: settings-layout carries the same under-scoped
summary locator; scope it to :scope > summary before it can trip the
same way once its clicks happen against expanded advanced content.

* fix(ui): canonicalize checkout paths inside the shared worktree fold

ClawSweeper P2: sidebar Project mode keyed sections by the raw
workContext.path, so /repo/openclaw and /repo/openclaw/ minted two
identical headers. Move trailing-separator stripping into
foldWorktreeCheckoutPath so the catalog and sidebar callers share one
canonicalization; regression case fails pre-fix.
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 P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: M 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