Skip to content

feat: sidebar hierarchy view - #120

Merged
aterrylu merged 1 commit into
mainfrom
terry/sidebar-hierarchy
Apr 10, 2026
Merged

feat: sidebar hierarchy view#120
aterrylu merged 1 commit into
mainfrom
terry/sidebar-hierarchy

Conversation

@aterrylu

Copy link
Copy Markdown
Owner

Summary

  • Adds a toggleable hierarchy view to the Agents sidebar that organizes agents by their org chart parent-child relationships
  • Parents show a blue left border bar that acts as expand/collapse toggle (click bar to toggle, click row to switch pane)
  • Drag-to-reorder within sibling groups, persisted to localStorage
  • Stopped agents filtered from hierarchy when eye toggle is off (preserves parents with live descendants)

Changes

  • Sidebar.tsx: Extracted SessionRow/ExitedRow components; added HierarchyNodeRow with tree rendering, useOrgChartData hook, mergeOrgWithSessions tree builder with prune/order logic
  • store.ts: Added sidebarViewMode ("flat"/"hierarchy") and hierarchyOrder (per-group ordering) to persisted state
  • Codicon.tsx: Added chevron-down, chevron-right, list-flat, list-tree icons

Design decisions

  • Hierarchy data comes from GET /api/org (pre-built tree) merged with live sessions, not from the manager field on sessions (which isn't reliably populated)
  • No chevron icons for expand/collapse — uses colored left border bar + click-to-toggle on the bar zone
  • Drag reorder is scoped to sibling groups (can't drag across hierarchy levels)

Test plan

  • Toggle between flat and hierarchy view using the icon next to "AGENTS"
  • Verify parent agents show blue left border, children are indented
  • Click the blue bar area to collapse/expand children
  • Click an agent row to switch to its terminal (should NOT toggle children)
  • Toggle "show stopped" eye icon — hierarchy should filter stopped agents
  • Drag agents within a group to reorder — verify order persists on reload
  • Switch back to flat view — verify original behavior unchanged

🤖 Generated with Claude Code

…eorder

Add a toggleable hierarchy view to the Agents sidebar that organizes agents
by their org chart parent-child relationships.

- Toggle between flat (original) and hierarchy view via icon in Agents header
- Hierarchy data sourced from GET /api/org, merged with live sessions
- Parents show blue left border bar; click bar to expand/collapse children
- Stopped agents filtered from hierarchy when eye toggle is off (preserves
  parents that have live descendants)
- Drag-to-reorder within sibling groups (persisted to localStorage)
- Extracted SessionRow/ExitedRow components for reuse across both views
- Added chevron-down, chevron-right, list-flat, list-tree codicons
- New store state: sidebarViewMode, hierarchyOrder (both persisted)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@aterrylu
aterrylu force-pushed the terry/sidebar-hierarchy branch from 0756a89 to 5aa25be Compare April 10, 2026 11:00
@aterrylu
aterrylu enabled auto-merge (squash) April 10, 2026 11:00
@aterrylu
aterrylu merged commit 203d48f into main Apr 10, 2026
1 check passed
@aterrylu
aterrylu deleted the terry/sidebar-hierarchy branch April 10, 2026 11:00

@nox-0x nox-0x left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

/tmp/pr120-comment.txt

@nox-0x nox-0x left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Clean, well-scoped feature addition. Tree-based hierarchy view with drag-to-reorder, collapse/expand, and flat/hierarchy toggle is solid. Extracting SessionRow/ExitedRow/HierarchyNodeRow components reduces duplication and improves readability. Polling-based org chart merge is appropriate. Left one non-blocking warning about using node.org.name as React keys (potential duplicate-name collision) — worth addressing before shipping but not a blocker.

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