Skip to content

feat(sidebar): collapse subagent thread trees#510

Closed
puls-com-leon-komarovsky wants to merge 2 commits intoDimillian:mainfrom
puls-com-leon-komarovsky:feat/sidebar-collapse-subagent-tree
Closed

feat(sidebar): collapse subagent thread trees#510
puls-com-leon-komarovsky wants to merge 2 commits intoDimillian:mainfrom
puls-com-leon-komarovsky:feat/sidebar-collapse-subagent-tree

Conversation

@puls-com-leon-komarovsky
Copy link
Contributor

What

Adds a disclosure arrow to sidebar thread rows that have child threads (subagents), allowing per-node collapse/expand of the child subtree.

UX

  • Arrow is shown only for nodes with children.
  • Hidden by default; appears on row hover / focus (and always visible on no-hover devices).
  • Toggle is recursive: any node with children gets its own arrow.
  • Click stops propagation so it does not select the thread.

Implementation

  • Extend useThreadRows to compute hasChildren + isCollapsed and skip recursion when collapsed.
  • Store collapse state in Sidebar (in-memory, per workspace/worktree).
  • Render toggle in both main thread list and pinned thread list.

Testing

  • npm run test -- src/features/app/hooks/useThreadRows.test.tsx src/features/app/components/ThreadList.test.tsx src/features/app/components/PinnedThreadList.test.tsx src/features/app/components/WorktreeSection.test.tsx
  • npm run typecheck
  • npm run lint (existing warnings only)

@puls-com-leon-komarovsky puls-com-leon-komarovsky force-pushed the feat/sidebar-collapse-subagent-tree branch from 36b63de to 56db944 Compare February 24, 2026 17:50
@Dimillian
Copy link
Owner

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

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: 56db94490d

ℹ️ 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 +105 to +109
onClick={(event) => {
event.preventDefault();
event.stopPropagation();
onToggleThreadCollapsed(workspaceId, thread.id);
}}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Stop keyboard events from bubbling out of collapse toggle

The new tree toggle only stops propagation on click, but the row still has an onKeyDown handler for Enter/Space. When a keyboard user focuses this button and presses Enter or Space, the key event bubbles to the parent row, which selects the thread (and can prevent the button activation), so collapse/expand cannot be reliably triggered from the keyboard. This regresses keyboard accessibility for the new control.

Useful? React with 👍 / 👎.

@Dimillian
Copy link
Owner

Don't like the UI, IMO a bit unecessary

@Dimillian Dimillian closed this Feb 25, 2026
Sign up for free to 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.

2 participants