Commit Graph

3 Commits

Author SHA1 Message Date
TheArchitectit 0ca23dbdf4 test(tui): add regression tests for input corruption and output bleed
InputBar regression tests:
- Submit blocked during turn_in_progress
- Turn state properly cleared after turn completes
- Completions popup no-op when not showing
- Setting turn_in_progress marks dirty
- Cancel clears textarea and marks dirty

ConversationPane regression tests:
- wrap_line respects width in unicode-width terms
- Narrow width doesn't cause infinite loop
- Cache invalidated on width change (resize)
- mark_clean clears dirty flag

TerminalGuard tests:
- leave_for_turn no-op when already outside
- reenter_after_turn short-circuits when already inside
- EventBus sender and drain
2026-06-15 11:04:10 -05:00
TheArchitectit 9d066a0818 fix(tui): ConversationPane render cache via RefCell — actually renders now
The Component trait's render(&self) couldn't mutate the cache.
Switched to RefCell<RenderCache> for interior mutability so the
word-wrapped line cache rebuilds on dirty during render().

Also adds Dashboard::clear_dirty() and marks components clean
after each draw_screen() cycle.
2026-06-12 14:03:35 -05:00
TheArchitectit 55941ac6c8 feat(tui): component-based architecture, eliminates libc::dup hack
- Convert tui.rs → tui/ directory module with legacy.rs re-export
- Add Component + Overlay traits for clean separation of concerns
- Build component-based TuiApp (app.rs) with pre-borrow draw pattern
- Extract: ConversationPane, InputBar, Dashboard, CommandPaletteOverlay,
  AgentViewOverlay as independent components
- Add EventBus with crossbeam-channel for component communication
- Add SlashCommandDispatcher (testable, decoupled from main.rs)
- Add shared MarkdownAst + parser + shared markdown utilities
- Add StreamingMarkdownState stub for incremental rendering
- Wire new TuiApp into main.rs::run_tui_repl()
- ELIMINATE unsafe libc::dup/dup2 stdout suppression — replaced with
  suspend/resume pattern (same as provider swap flow)
- All 320 tests pass, 57 TUI-specific tests pass
2026-06-12 13:26:53 -05:00