Commit Graph

6 Commits

Author SHA1 Message Date
TheArchitectit 58e095a0c0 fix(tui): buffer output during turns — no more full-width bleeding
Architecture C from expert panel review: add run_turn_to<W: Write>
that writes all output (spinners, markdown, compaction logs) to a
custom writer instead of hardcoding stdout.

In the TUI path, we pass a Vec<u8> buffer. Zero bytes hit the real
terminal during a turn, so nothing bleeds past the conversation pane
boundary into the dashboard. After the turn, the buffer contents are
stripped of ANSI codes and pushed into the conversation pane where
wrap_line() constrains them to the pane width.

Key changes:
- run_turn() is now a thin wrapper: run_turn_to(input, stdout, true)
- run_turn_to<W: Write>(input, out, emit_output) is the real impl
- All println! → writeln!(out, ...), &mut stdout → out
- emit_output=false in TUI mode prevents runtime tool-stream output
- Add strip_ansi() helper for cleaning captured buffer text
- Remove Clear(ClearType::All) from redraw_after_turn (no debris to wipe)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 16:25:34 -05:00
TheArchitectit e9f09d7fed feat(tui): wire up /tui command with split-pane dashboard
- Add 'mod tui;' to main.rs (was missing — TUI code was dead)
- Add /tui slash command that switches from the plain REPL to the
  split-pane TUI mode at runtime
- Show startup hint: 'Tip: type /tui for the split-pane dashboard view'
- Add run_tui_repl() that manages the TuiApp event loop, captures
  assistant output from the session, and feeds it to the conversation pane
- Add update_dashboard() helper that syncs runtime stats (model, session,
  turns, provider) into the shared dashboard state
- ProviderSwap and TeamToggle work inside TUI mode

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 10:59:33 -05:00
TheArchitectit 8fb40350e4 fix(tui): word-wrap conversation lines and align dashboard columns
Three fixes for the rendering mess when output goes off-screen:

1. Word-wrap conversation pane lines — long output no longer bleeds
   into the dashboard. The wrap_line() function soft-wraps at word
   boundaries and hard-breaks long tokens. The viewport math is
   updated to count *visual* rows (not logical Line items).

2. Dashboard kv() aligned columns — keys are right-padded to a
   fixed 12-char column (KV_KEY_WIDTH) so values line up cleanly
   regardless of key length.

3. Context gauge positioned by row tracking, not hard-coded y offset.
   The gauge_row counter moves with the section content, so it stays
   correct whether git_branch, LSP, or Team sections are shown/hidden.
   Also switched dashboard Wrap to trim: false to preserve spacing.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 10:27:17 -05:00
TheArchitectit 28155a331f fix: resolve rebase conflicts, clean TUI alignment, and sync with upstream
- Split multi-line user input and system messages on newlines so each
  visual line gets its own ConversationLine (same pattern push_output
  already used). This fixes text misalignment when Enter is pressed.
- Don't enable Wrap on the conversation Paragraph — the FIFO viewport
  counts Line items to fill the pane, so soft-wrapping would throw off
  the row count and misalign content.
- Restore non-TUI files from upstream/main to clear conflict artifacts.
- Fix clippy warnings in lsp_client, lsp_process/parse, and trident.
- Add HandlerSwap and TeamToggle match arms in main.rs ReadOutcome.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 10:03:16 -05:00
TheArchitectit 2971728abb refactor: TUI, setup wizard, and main CLI improvements
- Refactored TUI rendering and state management
- Updated setup wizard flow
- CLI main entry point cleanup
2026-06-10 16:49:35 -05:00
TheArchitectit eb717bc11a feat: TUI split-pane layout with ratatui dashboard
Replace web dashboard with ratatui + crossterm + tui-textarea TUI:
- Left pane: scrollable conversation + input area with cursor indicator
- Right pane: live dashboard (model, tokens, context gauge, LSP, team, session)
- Auto-activates when stdout is a terminal, falls back to rustyline REPL
- Suspend/resume pattern: TUI suspends for run_turn (normal stdout), resumes after
- Key bindings: Enter/Shift+Enter, Ctrl+P/T/C/D, Tab completions, PageUp/Down
- 16ms poll interval with dirty-flag optimization
- CLAW ASCII art banner in styled colors

Dependencies added: ratatui 0.29, tui-textarea 0.7

💘 Generated with Crush

Assisted-by: GLM 5.1 FP8 via Crush <crush@charm.land>
2026-06-10 16:49:35 -05:00