Skip to content

fix(ui): cap sidebar child sessions with show-more, drop Subagent prefix in tree - #110604

Merged
steipete merged 2 commits into
mainfrom
claude/child-sessions-cap
Jul 18, 2026
Merged

steipete merged 2 commits into
mainfrom
claude/child-sessions-cap

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Two child-session (subagent) issues in the sidebar tree, continuing the quiet-sidebar series (#110448/#110459/#110470/#110524):

  1. A parent with many subagents dumps its full child list into the sidebar — potentially dozens of rows.
  2. Every child row carried the hardcoded "Subagent:" prefix (session-display.ts prepends it), which is redundant under an indented child row and truncates the actual title ("Subagent: Reading rec…").

Why This Change Was Made

Maintainer request: show at most 4 children with a muted "Show {count} more" affordance, and drop the prefix where the hierarchy is already visible.

User Impact

  • Expanded parents show the first 4 children plus a gray "Show N more" row; clicking reveals the full list for that parent. Collapsing the parent's children resets the cap. Works per level for nested trees.
  • The cap never hides what matters: the active session's branch (visuallyActive/containsActiveDescendant) and any branch with live runs (hasActiveRun/status running/transitive runningChildCount) always render, even past the cap.
  • Child rows in the tree render their real title without "Subagent:"; flat surfaces (palette, search, chat header) keep the prefix via the default of the new includeSubagentPrefix option. Untitled subagents keep the "Subagent:" fallback rather than rendering an empty row.
  • One new i18n key sessionsView.showMoreChildren (English source; locales are bot-generated).

child row without prefix

Evidence

  • node scripts/run-vitest.mjs ui/src/components/app-sidebar.test.ts — 109 pass, including new cases: 6-child parent shows 4 + "Show 2 more"; reveal-all; collapse-reset; unprefixed child labels; and a quiet child past the cap with a running grandchild stays visible ("Show 1 more").
  • ui/src/lib/session-display.test.ts — 11 pass (prefix default, opt-out, fallback).
  • Live-verified in the mock harness: child row reads "Reading receipts" (screenshot above; fixture has one child, so cap behavior is proven by tests).
  • Codex autoreview (gpt-5.6-sol), three rounds: round 1 found the cap could hide the active session's branch — fixed; round 2 found nested running descendants could hide behind the cap — fixed via transitive runningChildCount; round 3's remaining claim (base-class TS2339) was verified false: the list element inherits from the navigation element (List → Menus → Groups → Mutations → Navigation), the same relationship existing isSessionChildrenExpanded calls use.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: M maintainer Maintainer-authored PR 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: da2d9ac242

ℹ️ 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 +258 to +260
child.hasActiveRun ||
child.status === "running" ||
child.runningChildCount > 0,

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 Keep live descendant branches visible past the cap

When a quiet child after the first four only has a live grandchild, runningChildCount is still 0 here because descendants are only counted from already-built children; fetchChildSessionRows asks sessions.list with spawnedBy: parentKey, and the server-side spawnedBy filter only returns direct children for that parent. In that common nested-subagent case the grandchild row is not in rowsByKey yet, so this filter hides the child that carries the only toggle needed to load/reveal the running branch.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Jul 18, 2026
@clawsweeper

clawsweeper Bot commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 18, 2026, 6:48 AM ET / 10:48 UTC.

Summary
The branch limits quiet child-session rows in the Control UI sidebar to four until “Show N more” is selected, while omitting the redundant Subagent: prefix from indented child labels.

PR surface: Source +210, Tests +29. Total +239 across 8 files.

Reproducibility: no. high-confidence live reproduction is supplied: the source and prior review identify a concrete lazy nested-child path, but the provided screenshot has only one child and does not exercise it.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: serialized state: ui/src/lib/session-display.test.ts, serialized state: ui/src/lib/session-display.ts. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🦐 gold shrimp
Result: blocked until stronger real behavior proof is added.

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

Rank-up moves:

  • [P1] Fix the nested descendant visibility path and add regression coverage that exercises the lazy direct-child fetch boundary.
  • Post redacted Control UI evidence showing four visible children, reveal-all, collapse-reset, and a quiet parent retained for a running grandchild.

Proof guidance:

  • [P1] Needs stronger real behavior proof before merge: The linked screenshot directly shows the removed child-label prefix, but it does not demonstrate the capped list, reveal control, collapse reset, or nested live-branch invariant; add redacted runtime evidence for those interactions before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Risk before merge

  • [P1] A nested running session can be hidden if its quiet direct parent falls after the first four children before the descendant activity is loaded; users then lose the sidebar path needed to expose that live branch.
  • [P1] The supplied screenshot does not show the capped-list, reveal, collapse-reset, or nested live-branch behavior in a running Control UI setup.

Maintainer options:

  1. Repair descendant visibility before merge (recommended)
    Resolve the lazy nested-session activity path and add direct Control UI proof that a running grandchild keeps its quiet parent visible past the cap.
  2. Pause the cap behavior
    Do not merge the cap if the sidebar cannot cheaply establish descendant run state without changing its data-loading contract.

Next step before merge

  • [P1] The protected maintainer label and unresolved sidebar data-loading choice require human review; contributor proof must also demonstrate the full interaction before merge.

Maintainer decision needed

  • Question: Should the sidebar fetch or otherwise propagate descendant run state before applying the child cap, so a quiet direct child cannot conceal a live nested session?
  • Rationale: The intended UX is clear, but choosing the authoritative source and timing for nested descendant activity crosses the sidebar data-loading boundary and needs owner confirmation.
  • Likely owner: steipete — Recent merged and proposed Control UI sidebar work makes this the best available owner for the data-loading boundary decision.
  • Options:
    • Preserve nested live branches before capping (recommended): Ensure each child branch carries authoritative descendant activity before filtering, then prove the lazy-loaded nested-running case.
    • Limit the initial cap to direct-child state: Accept that initially unfetched nested live sessions may remain hidden until the user expands more children.

Security
Cleared: The supplied diff is confined to Control UI rendering, localization, styles, and tests; it adds no dependency, permission, secret, workflow, or execution-path change.

Review findings

  • [P2] Preserve nested live branches before applying the cap — ui/src/components/app-sidebar-session-list.ts:253-262
Review details

Best possible solution:

Keep the cap only after the sidebar has authoritative descendant activity for each child branch, add regression coverage for the actual lazy-loading path, and post redacted Control UI evidence showing cap, reveal, reset, and a nested live branch remaining visible.

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

No high-confidence live reproduction is supplied: the source and prior review identify a concrete lazy nested-child path, but the provided screenshot has only one child and does not exercise it.

Is this the best way to solve the issue?

No. The four-row cap is a reasonable UI direction, but filtering must not precede authoritative nested run-state discovery; a test that prepopulates the field is not sufficient proof of the lazy-loading path.

Full review comments:

  • [P2] Preserve nested live branches before applying the cap — ui/src/components/app-sidebar-session-list.ts:253-262
    A quiet direct child after the first four can still carry the only path to an unfetched running grandchild. The direct-child query described in the existing review leaves runningChildCount at zero in that case, so this filter hides the branch despite the intended invariant. Ensure descendant activity is available before filtering and cover the actual lazy-load path.
    Confidence: 0.82

Overall correctness: patch is incorrect
Overall confidence: 0.76

AGENTS.md: unclear because the file could not be read completely.

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

Label changes

Label changes:

  • add merge-risk: 🚨 other: The new cap can suppress the only visible parent row that reveals a nested live session, a user-observability risk outside the specific merge-risk taxonomy.

Label justifications:

  • P3: This is a bounded Control UI sidebar refinement, though the remaining visibility defect should be resolved before merge.
  • merge-risk: 🚨 other: The new cap can suppress the only visible parent row that reveals a nested live session, a user-observability risk outside the specific merge-risk taxonomy.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The linked screenshot directly shows the removed child-label prefix, but it does not demonstrate the capped list, reveal control, collapse reset, or nested live-branch invariant; add redacted runtime evidence for those interactions before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The linked screenshot directly shows the removed child-label prefix, but it does not demonstrate the capped list, reveal control, collapse reset, or nested live-branch invariant; add redacted runtime evidence for those interactions before merge.
Evidence reviewed

PR surface:

Source +210, Tests +29. Total +239 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 6 213 3 +210
Tests 2 29 0 +29
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 242 3 +239

What I checked:

  • Prior concrete review finding remains relevant: The existing review comment explains that sessions.list filtered by spawnedBy: parentKey returns direct children, so a quiet fifth child whose live run is only in an unfetched grandchild can still have runningChildCount === 0 and be removed by the cap. (ui/src/components/app-sidebar-session-list.ts:253, da2d9ac2420b)
  • Current diff filters before nested descendants are guaranteed available: The cap retains a child only for the first four positions or local precomputed activity fields, including runningChildCount > 0; the shown patch does not establish that unfetched nested descendants populate that field before filtering. (ui/src/components/app-sidebar-session-list.ts:253, 8003a5b82149)
  • Real proof is partial: The PR body’s linked screenshot visibly demonstrates the unprefixed child label, while the author states that the fixture has one child; capped-list, reveal, collapse-reset, and nested-running-branch behavior are supported only by tests in the supplied context. (ui/src/test-helpers/app-sidebar-cases/child-sessions-cap.ts:1, 8003a5b82149)
  • Likely feature history owner: The same author previously merged the adjacent sidebar quieting work, which makes them the strongest available routing candidate for this Control UI sidebar behavior. (ui/src/components/app-sidebar-session-list.ts:1, 679f9fcc6819)

Likely related people:

  • steipete: Authored the current sidebar change and the merged adjacent sidebar-section refinement in the supplied related-item history. (role: recent area contributor; confidence: medium; commits: 679f9fcc6819, da2d9ac2420b; files: ui/src/components/app-sidebar-session-list.ts, ui/src/components/app-sidebar-session-navigation.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 (1 earlier review cycle)
  • reviewed 2026-07-18T10:18:45.805Z sha da2d9ac :: needs real behavior proof before merge. :: [P2] Preserve nested live branches before applying the child cap

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. label Jul 18, 2026
@steipete
steipete merged commit f57a875 into main Jul 18, 2026
100 checks passed
@steipete
steipete deleted the claude/child-sessions-cap branch July 18, 2026 10:56
@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 19, 2026
…fix in tree (openclaw#110604)

* fix(ui): cap sidebar child sessions at four with show-more, drop Subagent prefix in tree

* test(ui): split child-session cap cases under the max-lines budget
zooqueen pushed a commit to zooqueen/openclaw that referenced this pull request Sep 11, 2026
…fix in tree (openclaw#110604)

* fix(ui): cap sidebar child sessions at four with show-more, drop Subagent prefix in tree

* test(ui): split child-session cap cases under the max-lines budget
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. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant