Skip to content

feat: add arbor-tui terminal dashboard with pluggable terminal capture#88

Open
edmondop wants to merge 1 commit intopenso:mainfrom
edmondop:feat/arbor-tui
Open

feat: add arbor-tui terminal dashboard with pluggable terminal capture#88
edmondop wants to merge 1 commit intopenso:mainfrom
edmondop:feat/arbor-tui

Conversation

@edmondop
Copy link
Copy Markdown
Contributor

@edmondop edmondop commented Mar 18, 2026

Summary

Adds a new arbor-tui crate — a terminal dashboard for monitoring Arbor agent sessions, built with ratatui.

Core features

  • Agents view with split list/detail layout, collapsible panels, and a help overlay
  • Daemon polling — connects to arbor-httpd on a configurable port, polls agent sessions and health status on a timer
  • Configurable agent header — printf-style format strings (${field:-width}) with two-layer field resolution: built-in DTO fields (session_id, cwd, status, elapsed) fall back to freeform metadata JSON keys. Supports static or value-mapped colors per field
  • Auto-discovered columns — metadata keys not in the header format are automatically added as extra table columns
  • Detail overlay (Enter) — full agent info + pretty-printed metadata
  • Metadata panel — side panel showing scalar metadata fields with configurable colors
  • Keybinding system — fully configurable via tui.toml (XDG or ~/.arbor/), with defaults for navigation, toggles, and quit. Supports custom action hooks that run shell commands with agent context as env vars

Pluggable terminal capture

The TUI can display live terminal output from agent panes and forward input to them. This is implemented via a TerminalCapture trait with a dispatcher (capture_for) that reads the agent's metadata.terminal.type field and returns the appropriate backend:

pub trait TerminalCapture: Send + Sync {
    fn capture(&self, agent: &AgentSessionDto) -> Option<String>;
    fn send_keys(&self, agent: &AgentSessionDto, text: &str) -> bool;
}

Currently shipped with a tmux backend that uses tmux capture-pane -p -e (with ANSI colors) and tmux send-keys. Adding support for other terminal multiplexers (kitty, zellij, etc.) is just a new trait impl + a match arm in the dispatcher.

  • Press i to enter input mode, type text, press Enter to send to the agent's terminal pane

Configuration

Default config is embedded at compile time (config/default.toml). Users can override any section via $XDG_CONFIG_HOME/arbor/tui.toml or ~/.arbor/tui.toml:

  • [tui] — tick rate, poll interval, agent header format, field colors, status icons, hidden columns
  • [keys] — rebind any built-in action (quit, nav, toggle panels, etc.)
  • [actions.*] — custom shell hooks triggered by key press, scoped to a tab

Test coverage

  • 58 tests covering: header format parsing, field resolution (built-in + metadata), elapsed time formatting, color resolution (static + map), config parsing/merging, keybinding parsing, action hooks, status bar rendering, and 17 snapshot tests for all UI states (empty, single/multi agent, metadata panel, detail overlay, collapsed panels, help overlay, input bar, terminal pane, auto-discovered columns)
  • Snapshots are deterministic regardless of serde_json/preserve_order — metadata keys are sorted before rendering to handle Cargo workspace feature unification

Test plan

  • just test — all workspace tests pass
  • just lint — zero clippy warnings
  • just format — formatted
  • Tests pass with --features serde_json/preserve_order (CI feature unification)
  • Run arbor-tui --port 8787 with daemon running, verify agents list populates
  • Verify terminal pane output streams in detail panel with ANSI colors
  • Test input mode (i → type → Enter sends to agent terminal)
  • Test custom action hooks via tui.toml

@edmondop edmondop marked this pull request as draft March 18, 2026 01:14
@edmondop edmondop force-pushed the feat/arbor-tui branch 4 times, most recently from 0b0b0a9 to bc7d9e5 Compare March 18, 2026 15:33
@edmondop edmondop marked this pull request as ready for review March 18, 2026 15:54
Add a new ratatui-based TUI crate (arbor-tui) that provides a terminal
dashboard for monitoring Claude Code agents. Features include:

- Live agent table with configurable header columns
- Metadata panel showing agent-published key/value pairs
- Auto-discovery of metadata columns from agent data
- Terminal pane capture via tmux integration
- Input forwarding to agent terminal panes
- Detail overlay popup for full agent inspection
- Collapsible table and metadata panels
- Help overlay with keybinding reference
- Configurable keybindings, field colors, and status icons
- TOML-based configuration with sensible defaults
- SVG screenshot generation for documentation
- Insta snapshot tests for all UI states

Also fixes formatting in arbor-daemon-client/types.rs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@edmondop edmondop changed the title feat: add arbor-tui terminal dashboard with metadata support feat: add arbor-tui terminal dashboard with pluggable terminal capture Mar 18, 2026
@codspeed-hq
Copy link
Copy Markdown
Contributor

codspeed-hq bot commented Mar 21, 2026

Merging this PR will not alter performance

✅ 21 untouched benchmarks


Comparing edmondop:feat/arbor-tui (677b466) with main (768a49a)

Open in CodSpeed

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.

1 participant