Update litmus-cli to render TermOutput (litmus-0uoe)
Migrate litmus-cli mockup views from Scene to TermOutput:
- Load TermOutput data (bundled or from fixtures directory)
- Render TermSpan using crossterm colors:
- TermColor::Default → crossterm reset
- TermColor::Ansi(n) → crossterm AnsiValue
- TermColor::Indexed(n) → crossterm AnsiValue
- TermColor::Rgb → crossterm Rgb
- Minimal changes — CLI is simpler than web
Depends on: TermOutput types, fixture pipeline generating output files
Plan
- Add
resolve_with_theme()toTermColorin litmus-model (reuses existingindexed_color()) - Add
serde_jsondep to litmus-cli - Write tests:
resolve_with_themeunit tests, TermOutput-to-ratatui-Lines conversion test - Embed 3 fixture output.json files (git-diff, ls-color, shell-prompt) via
include_str!() - Rewrite MockupsWidget to parse embedded fixtures, map TermSpan → ratatui Span using theme colors
- Add
term_color_to_ratatui()helper in util.rs
Summary of Changes
- Added
TermColor::resolve_with_theme()to litmus-model for resolving terminal colors against a Theme (5 tests) - Rewrote
MockupsWidgetto render real parsed TermOutput from embedded fixture JSON files - Embedded 5 fixtures: git-diff, git-log, ls-color, cargo-build, shell-prompt
- Added Up/Down arrow keys to cycle between fixtures in the TUI
- Used
LazyLockto cache parsed fixture data (avoids re-parsing on every frame) - 8 new tests for color resolution, line conversion, modifier handling, and fixture loading
Commits: d3a0818, d5b902d, 64d5917, f45b930