feat(ui): width-derived sidebar visibility — hide at <=90 cols (#21, ADR-0046 DB1)
The schema sidebar (the left Tables column) is now shown only when the terminal is wider than 90 columns; at or below that it is hidden and the output/input panels span the full width. This reclaims horizontal space on narrow terminals — notably the 90-column screencasts, where the sidebar added little and cost the output panel its width. Visibility is a pure function of terminal width (sidebar_visible); the Ctrl-O peek-reveal lands in Phase C. render() splits the layout conditionally — full-width right column when the sidebar is hidden. Snapshots/tests that rendered at 80 wide now reflect the hidden sidebar; those whose intent IS the sidebar (populated_with_table, the items-panel and drop-table integration checks) render at 110 so the Tables list is actually exercised — one masked-intent integration check (matched "Customers" in the output, not the panel) is corrected the same way. New tests cover the width gate and the show/hide boundary.
This commit is contained in:
@@ -301,7 +301,8 @@ fn create_table_flow_updates_tables_list_and_structure_view() {
|
||||
assert_eq!(app.tables, vec!["Customers".to_string()]);
|
||||
assert_eq!(app.current_table, Some(desc));
|
||||
|
||||
let rendered = rendered_text(&mut app, &theme, 80, 24);
|
||||
// Width > 90 so the sidebar (items panel) is shown (ADR-0046 DB1).
|
||||
let rendered = rendered_text(&mut app, &theme, 110, 24);
|
||||
assert!(
|
||||
rendered.contains("Customers"),
|
||||
"items panel should list Customers:\n{rendered}"
|
||||
@@ -397,7 +398,8 @@ fn drop_table_flow_clears_items_list() {
|
||||
|
||||
assert!(app.tables.is_empty());
|
||||
assert!(app.current_table.is_none());
|
||||
let rendered = rendered_text(&mut app, &Theme::dark(), 80, 24);
|
||||
// Width > 90 so the (now-empty) sidebar is shown (ADR-0046 DB1).
|
||||
let rendered = rendered_text(&mut app, &Theme::dark(), 110, 24);
|
||||
assert!(rendered.contains("(none yet)"));
|
||||
// ADR-0040: `drop table` is content-less, so the echo's ✓ marker
|
||||
// is the entire success signal (replacing `[ok] drop table …`).
|
||||
|
||||
Reference in New Issue
Block a user