Skip to content

feat(ui): add Person grouping mode for sessions sidebar and sessions page - #127346

Merged
steipete merged 2 commits into
mainfrom
steipete/identity-grouping-mode-dfac33
Aug 21, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/identity-grouping-mode-dfac33

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

The sessions sidebar can group by custom categories or nothing at all, but on multi-identity gateways there is no way to see sessions arranged by who owns them. The owner facet, the People sort, and the owner filter all exist — yet the sidebar cannot answer "show me Mira's sessions next to mine" at a glance. The sessions page similarly offers channel/kind/agent/date grouping but no owner mode.

Why This Change Was Made

Adds a Person grouping mode keyed on the durable, profile-resolved owner identity (session.owner.actor) — the same recorded fact the existing owner filter and People sort already use, so grouping, sorting, and filtering agree on what a "person" is.

Design decisions:

  • Gate: the Person option only appears when the gateway hello advertises hasMultipleSessionSharingIdentities — the same capability gate as the People sort, with the same reconnect resilience (stored preference survives a temporarily hidden capability; the UI renders Custom groups meanwhile).
  • Bucketing: owned rows form one section per owner — you first, then humans by label, then agent identities. Ownerless rows (system, unattributed) keep today's smart Threads/Groups/Coding zones, mirroring how an explicit category wins over smart zones in category mode. An owner bucket likewise wins for owned group/coding rows.
  • Headers render the owner avatar (openclaw-viewer-avatar) plus profile label. Person sections collapse like any section but are deliberately not drag-reorderable and not drop targets — dropping a session on a person would imply ownership reassignment, which stays owned by the owner-chip menu.
  • Sessions page parity: person joins SESSION_GROUP_MODES with owner-label section headers.
  • Mock fidelity: the mock dev server now advertises the multi-identity policy and carries explicit owner on rows the way the real gateway projects createdActor fallbacks — previously people-aware UI was unreachable in the mock.

Considered and rejected: migrating the session-catalog "Person" grouping from createdActor to owner — catalog sessions carry no owner in the protocol and the createdActor choice there is documented as intentional; not worth a protocol addition.

Production LOC: +142/−49 (new grouping branch, section headers, menu option, mock fixtures); tests +188/−1.

User Impact

Operators on multi-identity gateways get a third Group-by mode, "Person", in the sidebar Filter & sort menu and the sessions page. Sections show each owner's avatar and name, with your sessions first. Single-identity setups see no change.

Evidence

  • pnpm check:changed green (format, typecheck UI/scripts/core-tests, lint, i18n catalog, guards).
  • Unit + component suites green: ui/src/lib/sessions/grouping.test.ts, ui/src/pages/sessions/view.test.ts (80 tests), ui/src/components/app-sidebar.test.ts (full sidebar case suite, includes a new browser-level test covering the capability gate, self-first ordering, avatar header, non-draggable person sections, and capability loss/regain).
  • Codex autoreview (Sol, high): clean, no accepted findings.
  • Visual proof from the mocked Control UI dev server (synthetic multi-owner data: Riley = self, Mira, Peter, plus ownerless rows):

Before — Group by offers only Custom groups / None; no people-aware options:

before menu

After — Person appears under Group by (and Owners under Sort by, from the mock policy fix):

after menu

After, Person selected — self-first owner sections with avatars; ownerless rows fall to Other:

after grouped

After, menu reopened — Person checked:

after menu checked

…page

Sessions can now be grouped by their durable owner identity: the sidebar
Group-by menu gains a capability-gated Person mode (self first, humans by
label, agent identities after; ownerless rows keep their smart zones), and
the sessions page gains the matching person mode. Person section headers
render the owner avatar and profile label; the mock dev server now
advertises the multi-identity policy and carries explicit row owners the
way the gateway projects createdActor fallbacks.
@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.

@steipete
steipete marked this pull request as ready for review August 21, 2026 18:13
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui scripts Repository scripts size: M maintainer Maintainer-authored PR labels Aug 21, 2026
@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 21, 2026
@clawsweeper

clawsweeper Bot commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 21, 2026, 4:06 PM ET / 20:06 UTC.

ClawSweeper review

What this changes

Adds a capability-gated Person grouping option to the Control UI sidebar and Sessions page, grouping session rows by durable owner identity.

Merge readiness

⚠️ Needs maintainer review before merge - 3 items remain

Keep open: the updated head fixes the prior Sessions-page capability-gating finding, but two P2 behavior gaps remain in the new Person mode.

Priority: P2
Reviewed head: d2f84af60e1d5d5878a9a7c4cb5ecfc6ead0bca1

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The UI proof and focused coverage are useful, but two P2 behavior gaps keep the patch from merge readiness.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): The PR body supplies before/after Control UI screenshots that directly show the new menu option and owner-grouped result; the remaining blockers are source-level behavior gaps.
Patch quality 🦐 gold shrimp (3/6) 2 actionable review findings remain.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): The PR body supplies before/after Control UI screenshots that directly show the new menu option and owner-grouped result; the remaining blockers are source-level behavior gaps.
Evidence reviewed 6 items Prior finding fixed: The Sessions page now derives the multi-identity capability, hides Person when unavailable, and renders a stored Person preference as None; this addresses the previous review cycle’s gating concern.
Fallback drag mismatch: The new effective grouping converts stored Person to category while unavailable, but the category-drop admission path still reads the raw stored grouping and rejects category and ungrouped targets.
Sessions-page ordering gap: Person grouping is keyed by owner ID, then the shared non-date ordering lexically sorts those IDs. Unlike the sidebar’s dedicated owner ranking, the Sessions page receives no viewer ID and cannot put the viewer first.
Findings 2 actionable findings [P2] Use effective grouping for fallback drag targets
[P2] Order page Person groups by the viewer identity
Security None None.

Live Verification

Entry: /sessions

Result: PASS (completed)

Steps:

  • PASS goto /sessions
  • PASS wait_for .session-groupby__select
  • PASS click .session-groupby__select
  • PASS press Home
  • PASS press ArrowDown
  • PASS press ArrowDown
  • PASS press Enter
  • PASS expect_text Mira

Live proof recording

Recorded live on the PR head (d2f84af60e1d), 12.44s, browser surface.

How this fits together

Gateway hello policy and session ownership data feed the Control UI’s grouping controls. Those controls determine how the sidebar and Sessions page partition rows and which drag interactions remain valid.

flowchart LR
A[Gateway hello policy] --> B[Capability gate]
C[Session rows with owners] --> D[Owner grouping]
B --> E[Grouping controls]
D --> F[Sidebar sections]
D --> G[Sessions page sections]
E --> F
E --> G
Loading

Before merge

  • Use effective grouping for fallback drag targets (P2) - When a stored Person preference is temporarily unavailable, this new fallback renders category sections and enables their drop handlers. The organizer still tests the raw sessionsGrouping value, so it rejects drops onto the visible category or ungrouped targets until the capability returns. Route drag admission through the same effective grouping and add the capability-loss drag regression.
  • Order page Person groups by the viewer identity (P2) - This adds Person to the shared grouping resolver, whose generic ordering lexically sorts owner IDs. The sidebar separately ranks the viewer first, but the Sessions page never receives that identity, so another owner can appear above the viewer despite the PR’s stated self-first behavior. Thread the viewer ID into page grouping and cover that ordering.
  • Complete next step (P2) - This maintainer-labelled PR needs the two concrete feature corrections before normal exact-head validation; it is not a repair-dispatch candidate.

Findings

  • [P2] Use effective grouping for fallback drag targets — ui/src/components/app-sidebar-session-navigation.ts:123-127
  • [P2] Order page Person groups by the viewer identity — ui/src/lib/sessions/grouping.ts:140-141
Agent review details

Security

None.

PR surface

Source +170, Tests +131, Other +7. Total +308 across 14 files.

View PR surface stats
Area Files Added Removed Net
Source 11 220 50 +170
Tests 2 132 1 +131
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 8 1 +7
Total 14 360 52 +308

Review metrics

Metric Value Why it matters
Production versus test delta production +145/-50; tests/test support +215/-2 The positive production delta implements a new UI mode and owner presentation; the mock scenario and focused coverage account for the test-support growth.

Stored data model

Persistent data-model change detected: serialized state: ui/src/lib/sessions/grouping.test.ts, serialized state: ui/src/lib/sessions/grouping.ts, serialized state: ui/src/pages/sessions/sessions-page.ts, serialized state: ui/src/pages/sessions/view.test.ts, serialized state: ui/src/pages/sessions/view.ts, serialized state: ui/src/test-helpers/app-sidebar-cases/session-ownership.ts, and 5 more. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Use one effective grouping value for sidebar rendering and drag admission, and pass the viewer identity into Person-group ordering so both UI surfaces honor self-first behavior.

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

Not applicable as an existing-bug reproduction: this is a new UI mode, and the remaining defects are directly source-reproducible from its fallback and ordering paths.

Is this the best way to solve the issue?

No: capability gating is now correct, but the fallback must drive drag admission too and page ordering must receive the viewer identity to fulfill the intended self-first experience.

Full review comments:

  • [P2] Use effective grouping for fallback drag targets — ui/src/components/app-sidebar-session-navigation.ts:123-127
    When a stored Person preference is temporarily unavailable, this new fallback renders category sections and enables their drop handlers. The organizer still tests the raw sessionsGrouping value, so it rejects drops onto the visible category or ungrouped targets until the capability returns. Route drag admission through the same effective grouping and add the capability-loss drag regression.
    Confidence: 0.98
  • [P2] Order page Person groups by the viewer identity — ui/src/lib/sessions/grouping.ts:140-141
    This adds Person to the shared grouping resolver, whose generic ordering lexically sorts owner IDs. The sidebar separately ranks the viewer first, but the Sessions page never receives that identity, so another owner can appear above the viewer despite the PR’s stated self-first behavior. Thread the viewer ID into page grouping and cover that ordering.
    Confidence: 0.95

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body supplies before/after Control UI screenshots that directly show the new menu option and owner-grouped result; the remaining blockers are source-level behavior gaps.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The PR body supplies before/after Control UI screenshots that directly show the new menu option and owner-grouped result; the remaining blockers are source-level behavior gaps.

Label justifications:

  • P2: The remaining defects affect multi-identity session organization and drag behavior, without an urgent reliability or security impact.
  • 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 PR body supplies before/after Control UI screenshots that directly show the new menu option and owner-grouped result; the remaining blockers are source-level behavior gaps.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body supplies before/after Control UI screenshots that directly show the new menu option and owner-grouped result; the remaining blockers are source-level behavior gaps.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The PR body supplies before/after Control UI screenshots that directly show the new menu option and owner-grouped result; the remaining blockers are source-level behavior gaps.

Evidence

What I checked:

Likely related people:

  • Josh Lehman: Current-main blame places the category-drop admission path at the shallow-history boundary of this commit; fuller historical ownership is unavailable locally. (role: adjacent current-main contributor; confidence: low; commits: 6448550898c2; files: ui/src/components/session-organizer-controller.ts, ui/src/lib/sessions/grouping.ts)

Rank-up moves

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

  • Make sidebar category-drop admission use the effective fallback grouping and add the capability-loss drag case.
  • Pass the viewer identity to Sessions-page Person ordering and test that the viewer section is first.

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 (1 earlier review cycle)
  • reviewed 2026-08-21T18:58:59.157Z sha 66aaf87 :: needs changes before merge. :: [P2] Gate the Sessions-page Person option on identity capability

Mirrors the sidebar: the Person option hides without
hasMultipleSessionSharingIdentities and a stored Person preference
renders as None until the capability returns.
@steipete

Copy link
Copy Markdown
Contributor Author

Applied the rank-up moves in d2f84af:

  • The sessions page now receives the identity capability and hides the Person option without hasMultipleSessionSharingIdentities; a stored Person preference renders as None until the capability returns (same reconnect resilience as the sidebar).
  • Added false-capability selector coverage in ui/src/pages/sessions/view.test.ts; the true-capability path was already covered by the existing person-grouping test.
  • The failed checks-ui-e2e (7/12) shard was an unrelated flake in new-session-page.prompt-attachments.e2e.test.ts (draft restore); it passes locally on this branch and fresh CI is running on the new head.

@clawsweeper clawsweeper Bot added proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. labels Aug 21, 2026
@steipete
steipete merged commit 3ea90bd into main Aug 21, 2026
162 checks passed
@steipete
steipete deleted the steipete/identity-grouping-mode-dfac33 branch August 21, 2026 20:21
@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 22, 2026
…page (openclaw#127346)

* feat(ui): add Person grouping mode for sessions sidebar and sessions page

Sessions can now be grouped by their durable owner identity: the sidebar
Group-by menu gains a capability-gated Person mode (self first, humans by
label, agent identities after; ownerless rows keep their smart zones), and
the sessions page gains the matching person mode. Person section headers
render the owner avatar and profile label; the mock dev server now
advertises the multi-identity policy and carries explicit row owners the
way the gateway projects createdActor fallbacks.

* feat(ui): gate sessions-page Person grouping on the identity capability

Mirrors the sidebar: the Person option hides without
hasMultipleSessionSharingIdentities and a stored Person preference
renders as None until the capability returns.
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 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: 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