Skip to content

feat(ui): open linked subagents from stream tools, not sidebar - #2383

Merged
Astro-Han merged 9 commits into
mainfrom
feat/subagent-session-layout
Aug 7, 2026
Merged

feat(ui): open linked subagents from stream tools, not sidebar#2383
Astro-Han merged 9 commits into
mainfrom
feat/subagent-session-layout

Conversation

@Astro-Han

Copy link
Copy Markdown
Contributor

Summary

Linked subagent sessions no longer appear as nested rows in the sidebar. The session rail lists only root/user sessions; opening a child switches the main chat column (option A) and the titlebar shows project › parent › child so the parent stays one click away.

Entry point is the existing collapsible spawn_subagent tool group: expand a row and use Open session in the subagent tool detail when childSessionId is present. No parallel roster, composer drawer, strip, or custom card system.

Refs design lock in Storybook Product/Subagent Sessions.

Verification

  • npm run build -w @maka/core and @maka/ui
  • npm run build:main / build:renderer for @maka/desktop
  • Focused tests (all pass):
    • packages/core/dist/__tests__/subagent-session-parent.test.js
    • packages/ui/dist/__tests__/titlebar-session-identity.test.js
    • packages/ui/dist/__tests__/subagent-open-session.test.js
    • apps/desktop/dist/main/__tests__/session-project-view-contract.test.js
    • apps/desktop/dist/main/__tests__/stale-sessions.test.js
  • Biome check on touched TS sources
  • Not run: full workspace test suite, Playwright E2E

Review focus

  • Sidebar no longer receives childSessionsByParentId; tree projection still produces roots so children do not leak as top-level rows.
  • While a child is active, sidebar selection highlights the root ancestor via resolveLinkedSessionRootId.
  • Open affordance lives in tool detail (SubagentPreview) to avoid fighting ChatToolCalls row expand.

Linked child sessions no longer nest under parents in the session rail.
Open them from the spawn_subagent tool detail, and recover parent context
from the titlebar trail (project › parent › child).
Linked children no longer render in the session rail, so the lazy-children
sentinel class and data-subagent row styling are unused.
Filter promoted linked children out of the rail, keep open callbacks
identity-stable for memoized TurnViews, and offer the same open control
from agent_swarm tool detail. Tests and stories lock the new contracts.
Membership and active highlight now share projectRevisionLinkedSessionTree
roots plus a flat include filter, so orphans stay visible, linked children
never promote past filtered parents, and revision representatives highlight
correctly. Drop resolveLinkedSessionRootId — it walked bare parent ids.
Assert the host open callback reaches SubagentPreview through ToolCallDetail
when childSessionId is present, and stays hidden when the host omits it.
TitlebarSessionIdentity, SessionListPanel, and deriveSessionRail replace the
hand-rolled trail and sidebar so the design lock tracks shipped seams.
deriveSessionRail now returns activeParentSession from the same tree walk as
the rail highlight, so breadcrumbs track the revision representative rather
than a second physical parent-id lookup.
No production caller remained after the desktop flat-rail projection; CLI
uses projectRevisionLinkedSessionTree only. Drop the dead export and move
desktop contracts fully onto deriveSessionRail.
data-subagent no longer exists on rows; remove the always-true check and
trim a trailing blank line from the design-lock story.
@Astro-Han
Astro-Han marked this pull request as ready for review August 7, 2026 05:52
@Astro-Han
Astro-Han merged commit bcb84ac into mainAug 7, 2026
12 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@Astro-Han