diff --git a/crates/app/src/tests/layout.rs b/crates/app/src/tests/layout.rs index 1295713..b5ee76e 100644 --- a/crates/app/src/tests/layout.rs +++ b/crates/app/src/tests/layout.rs @@ -4144,6 +4144,36 @@ fn the_settings_page_is_a_centred_modal_with_one_column_of_measure() { column with its rows scrolling" ); } + // One measure for every tab (user 2026-09-20: "switching between them + // feels weird" -- the plate hugged its rows, so PROJECT's seven and + // EXPORT's four resized it under the hand). The rows area wears the + // tallest section's fixed height, and that height is PROJECT's own + // arithmetic: count the section's rows out of its body rather than + // trusting the constant's comment. + assert!( + body.contains(".h(px(SETTINGS_ROWS_H))"), + "the settings rows lost their fixed measure -- a tab switch resizes the plate again" + ); + let project = &source[source + .find("fn project_section(") + .expect("the PROJECT section")..]; + let project = &project[..project.find("\n}\n").map_or(project.len(), |at| at + 2)]; + let rows = [ + "row(", + "row_ink(", + "row_static(", + "row_keyed(", + "row_full(", + "row_chord(", + ] + .iter() + .map(|call| project.matches(call).count()) + .sum::(); + assert_eq!( + crate::ui::settings_stance::SETTINGS_ROWS_H, + rows as f32 * CONTROL_H + (rows - 1) as f32 * 2., + "SETTINGS_ROWS_H no longer measures the PROJECT section's {rows} rows" + ); assert!( body.contains("this.close_card()"), "the settings scrim swallows the press without closing the modal" diff --git a/crates/app/src/ui/settings_stance.rs b/crates/app/src/ui/settings_stance.rs index 8d471b4..0a7bea4 100644 --- a/crates/app/src/ui/settings_stance.rs +++ b/crates/app/src/ui/settings_stance.rs @@ -795,6 +795,14 @@ const SETTINGS_EDGE: f32 = 24.; /// strip and a row under it -- the rows scroll from there. const SETTINGS_MIN_H: f32 = 160.; +/// The rows' one measure, spent by every tab alike: the tallest section's own +/// height (PROJECT's seven rows at [`CONTROL_H`], the sections' 2px gaps +/// between them), so a tab switch swaps the rows and never resizes the plate +/// under the hand (user 2026-09-20: "switching between them feels weird"). A +/// shorter section leaves air below its last row; a short window still +/// scrolls, the plate's `max_h` cap shrinking this from `min_h(0)`. +pub(crate) const SETTINGS_ROWS_H: f32 = 7. * CONTROL_H + 6. * 2.; + /// The page itself: a centred modal card, closed by a click away or `esc` /// through [`Player::close_card`] like every other card here. /// @@ -913,10 +921,13 @@ pub(crate) fn render( // column that began mid-screen. The strip above is the way // between them; there is one section in the tree at a time, so // a row that is not showing cannot be reached by a tab stroke - // or by the pointer either. + // or by the pointer either. The area's height is the tallest + // section's own ([`SETTINGS_ROWS_H`]), so a tab switch swaps + // the rows and never resizes the plate under the hand. .child( div() .id("settings-rows") + .h(px(SETTINGS_ROWS_H)) .min_h(px(0.)) .overflow_y_scroll() .child(match player.settings_tab {