Commit Graph

3 Commits

Author SHA1 Message Date
Claude 755659c916 fix(tui): Sprint 1 — ProviderSwap fix, status race, memory bound, token tracking
S1-1: Fix ProviderSwap — use suspend()/resume() instead of restore_terminal()
so TUI re-enters cleanly after the setup wizard runs.

S1-2: Fix status message race — remove immediate ds.status_message.clear()
after set_status("Done") so the message is visible until next turn.

S1-4: Bound conversation memory — add MAX_CONVERSATION_LINES (10,000).
auto_scroll() now drains oldest entries and inserts a trim notice.

S1-5: Wire real token tracking — use runtime::UsageTracker::from_session()
to read cumulative TokenUsage (input, output, cache_creation, cache_read)
and pricing_for_model() to estimate cost. No more char÷4 guess.

Sprint 1 of 7. 218 tests pass.

Authored by TheArchitectit
2026-06-11 18:49:15 -05:00
Claude 7c34488042 feat(tui): Sprint 0 complete — panic hook, resize, TuiError, unicode-width
- S0-2: install_panic_hook() restores terminal on crash (disable raw mode,
  leave alt screen, show cursor) before printing panic message
- S0-3: Handle Event::Resize in TUI event loop via mark_resize()
- S0-4: Add unicode-width = "0.2" dependency for CJK-aware wrapping
- S0-5: Create src/tui_error.rs with TuiError enum (Io, Terminal, Runtime, Config)
- Wire panic hook into run_tui_repl with clean restore on exit
- Deprecation warnings fixed (PanicHookInfo instead of PanicHookInfo)

108 tests pass. 1 pre-existing failure (sandbox status contract) unrelated.

Authored by TheArchitectit
2026-06-11 18:42:21 -05:00
Claude 294ab2ab66 refactor(tui): extract ANSI stripper and dashboard update to tui_update module
- Create src/tui_update.rs with canonical strip_ansi() (handles CSI, OSC, DCS)
- Add DashboardUpdate struct to decouple from private LiveCli
- Remove duplicate strip_ansi_escapes from tui.rs and strip_ansi from main.rs
- update_dashboard() now delegates to tui_update::update_dashboard_from()
- 12 unit tests for ANSI stripping (CSI, OSC/BEL, OSC/ST, DCS, 256-color, RGB)

Sprint 0, Story S0-1. Pure extraction — no behavioral changes.

Authored by TheArchitectit
2026-06-11 18:37:39 -05:00