Skip to content

feat: sidebar hierarchy tree-line connectors - #126

Merged
aterrylu merged 1 commit into
mainfrom
terry/tree-lines
Apr 12, 2026
Merged

feat: sidebar hierarchy tree-line connectors#126
aterrylu merged 1 commit into
mainfrom
terry/tree-lines

Conversation

@aterrylu

Copy link
Copy Markdown
Owner

Summary

  • Add CSS-drawn tree-line connectors (├─/└─) to the sidebar hierarchy view, giving a clear visual trace of agent parent-child relationships
  • Compact spacing (10px indent, 5px arm) to preserve sidebar width for long agent names
  • Guide lines recursively aligned with parent status icon centers at every depth
  • Preserves existing colored left border on parent nodes (blue=expanded, dim=collapsed)
  • Downward connector from parent icon to children, hidden when group is collapsed

Design

Dispatcher
  TeamLead@autonomOS          ← blue left bar (has reports)
  ├─ CronDesign@autonomOS     ← compact branch connector
  ├─ MultiProvider@autonomOS
  └─ TreeLines@autonomOS      ← elbow connector (last child)
TeamLead@homelab              ← blue left bar
  └─ HW-Inventory@homelab
TeamLead@workflow

Key decisions:

  • No connectors at root level (depth 0) — only children get tree lines
  • Recursive guideX/treePaddingLeft functions align guides with parent icon centers rather than using a fixed linear formula
  • TreeLineGuides component renders as a pointer-events-none overlay with z-index: 1
  • Exited/stopped rows wrapped in a borderless container for correct guide alignment (avoids 3px CSS border offset)

Test plan

  • make check passes (biome lint + tsc + 70 tests)
  • Visual verification in dev server (hierarchy view with multiple nesting levels)
  • Expand/collapse groups — connectors appear/disappear correctly
  • Colored left border preserved on parent nodes
  • Flat view unaffected (tree lines only render in hierarchy mode)
  • All three themes verified (Midnight dark theme tested, colors use page.statusFg)

🤖 Generated with Claude Code

@aterrylu
aterrylu marked this pull request as ready for review April 12, 2026 21:43
Add CSS-drawn tree-line connectors (├─/└─) to the hierarchy view in the
sidebar Agents section, giving a clear visual trace of parent-child
relationships between agents.

Key design decisions:
- Compact connectors (10px indent, 5px arm) to minimize sidebar space usage
- Guide lines aligned with parent status icon centers via recursive
  guideX/treePaddingLeft computation
- Colored left border preserved on parent nodes (blue=expanded, dim=collapsed)
- Downward connector from parent icon to children, hidden when collapsed
- No connectors at root level (depth 0) — only children get tree lines

Implementation:
- TreeLineGuides component renders vertical continuation lines + branch/elbow
  connectors as absolutely positioned divs in a pointer-events-none overlay
- HierarchyNodeRow passes isLastChild and ancestorIsLast[] through the tree
  recursion to determine which guides to draw
- SessionRow gains paddingLeftOverride prop for hierarchy-specific padding
- Exited/stopped rows wrapped in borderless div for correct guide alignment

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@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.

Solid implementation of tree-line connectors for the hierarchy view. The recursive geometry calculations (guideX / treePaddingLeft) are well-reasoned and produce consistent alignment with parent icon centers across all depth levels. ancestorIsLast propagation is correct, TreeLineGuides handles the last-child elbow vs branch case properly, and the pointer-events-none overlay avoids interaction conflicts. No critical issues found — LGTM ✅

@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.

Reviewed the full diff. The geometry functions (guideX, treePaddingLeft) are correctly recursive — icon center alignment is consistent at every depth. ancestorIsLast propagation is logically sound (i > 0 guard correctly skips depth-0 ancestor level in the reduce). The pointer-events-none overlay with zIndex:1 is safe, and indent={0} with paddingLeftOverride is the right split for SessionRow. No critical or blocking issues. LGTM ✅

@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.

LGTM ✅

@aterrylu
aterrylu merged commit 3e6bb3e into main Apr 12, 2026
1 check passed
@aterrylu
aterrylu deleted the terry/tree-lines branch April 12, 2026 21:54
aterrylu added a commit that referenced this pull request Apr 13, 2026
Add ghostty-web (Coder's WASM-based terminal emulator) as an alternative
renderer to xterm.js, switchable live via the Settings panel.

Architecture:
- terminal/ directory with typed TerminalInstance interface, factory pattern,
  and separate backend modules (xterm-backend.ts, ghostty-backend.ts)
- Live switching: changing renderer recreates terminals instantly via
  React effect lifecycle — PTY survives, output buffer replays
- Server-side persistence: setting stored in ~/.autonomos/settings.json
- Client-side reactivity: Zustand store triggers terminal re-creation

Key design decisions:
- Static imports (both renderers bundled) — localhost dashboard, bundle size irrelevant
- Typed interface catches API mismatches at compile time
- WASM init() uses promise deduplication to prevent race conditions
- Error feedback: failed backend shows message in terminal container + status bar

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
aterrylu added a commit that referenced this pull request Apr 13, 2026
Add ghostty-web (Coder's WASM-based terminal emulator) as an alternative
renderer to xterm.js, switchable live via the Settings panel.

Architecture:
- terminal/ directory with typed TerminalInstance interface, factory pattern,
  and separate backend modules (xterm-backend.ts, ghostty-backend.ts)
- Live switching: changing renderer recreates terminals instantly via
  React effect lifecycle — PTY survives, output buffer replays
- Server-side persistence: setting stored in ~/.autonomos/settings.json
- Client-side reactivity: Zustand store triggers terminal re-creation

Key design decisions:
- Static imports (both renderers bundled) — localhost dashboard, bundle size irrelevant
- Typed interface catches API mismatches at compile time
- WASM init() uses promise deduplication to prevent race conditions
- Error feedback: failed backend shows message in terminal container + status bar

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
aterrylu added a commit that referenced this pull request Apr 13, 2026
feat: swappable terminal renderer — xterm.js + ghostty-web (#126)

Add ghostty-web (Coder's WASM-based terminal emulator) as an alternative
renderer to xterm.js, switchable live via the Settings panel.

Architecture:
- terminal/ directory with typed TerminalInstance interface, factory pattern,
  and separate backend modules (xterm-backend.ts, ghostty-backend.ts)
- Live switching: changing renderer recreates terminals instantly via
  React effect lifecycle — PTY survives, output buffer replays
- Server-side persistence: setting stored in ~/.autonomos/settings.json
- Client-side reactivity: Zustand store triggers terminal re-creation

Key design decisions:
- Static imports (both renderers bundled) — localhost dashboard, bundle size irrelevant
- Typed interface catches API mismatches at compile time
- WASM init() uses promise deduplication to prevent race conditions
- Error feedback: failed backend shows message in terminal container + status bar

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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