//! The terminal app's first screen carries a decision (improvise-4ibz). //! Why this is not a rendered-frame test: `context/test-evidence/tui.md`. use improvise::ui::app::{App, Panel}; use improvise::workbook::Workbook; fn launched() -> App { App::new(Workbook::new("launch"), None) } /// The user's ruling, 2026-09-20: the category sidebar is visible at launch in /// the TUI as well as the browser. `src/draw.rs` draws it off this flag. #[test] fn the_terminal_app_launches_with_the_category_panel_open() { let app = launched(); assert!( app.view_state.category_panel_open, "improvise model.improv opens with the category sidebar showing" ); } /// The ruling names one panel. Without this, "open everything at launch" would /// pass the test above, and the sidebar would be three panels tall. #[test] fn the_other_two_panels_are_shut_at_launch() { let app = launched(); assert!(!app.view_state.formula_panel_open, "formulas stay shut"); assert!(!app.view_state.view_panel_open, "views stay shut"); } /// `App::new` could override the shared default without the protocol test /// noticing. PROSPECTIVE with three panels — see the evidence file. #[test] fn the_terminal_constructor_inherits_the_shared_default_rather_than_setting_it() { let shared = improvise::ui::app::ViewState::default(); let app = launched(); for panel in Panel::ALL { let (in_app, in_default) = (open(&app.view_state, panel), open(&shared, panel)); assert_eq!( in_app, in_default, "{} differs between App::new and ViewState::default: a TUI-only \ launch default is the divergence improvise-wsaw closed", panel.name() ); } } fn open(view: &improvise::ui::app::ViewState, panel: Panel) -> bool { match panel { Panel::Formula => view.formula_panel_open, Panel::Category => view.category_panel_open, Panel::View => view.view_panel_open, } }