From 310439e6b428c6cd5eebb701c905674d3e0abeaa Mon Sep 17 00:00:00 2001 From: aiongg Date: Mon, 16 Nov 2026 15:52:34 +0000 Subject: [PATCH] Trial: only the last open group of a dock column fills it --- crates/ui-patterns/tests/it/docking/columns.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/crates/ui-patterns/tests/it/docking/columns.rs b/crates/ui-patterns/tests/it/docking/columns.rs index de27bdb15..e31b78cab 100644 --- a/crates/ui-patterns/tests/it/docking/columns.rs +++ b/crates/ui-patterns/tests/it/docking/columns.rs @@ -31,6 +31,21 @@ fn default_heights_give_way_to_the_group_that_fills_before_it_gets_less() { assert!(sum(&heights) <= ROOM, "the groups fit the room"); } +#[trial] +fn only_the_last_open_group_fills_the_column() { + let asks = || { + let mut group = open(MIN); + group.content = Some(DockHeights::new(100.0).compact(80.0).fill(150.0)); + group + }; + let mut minimized = asks(); + minimized.minimized = true; + let heights = group_heights(&[asks(), asks(), minimized], STRIP, ROOM); + assert_eq!(heights[0], 100.0, "an earlier group keeps its default although it asks for a fill"); + assert!(heights[1] > heights[0], "the last open group takes the rest"); + assert_eq!(sum(&heights), ROOM, "the column is filled"); +} + /// Canvas 1 beside an end dock: column A holds panel 2 (200 to 400 wide), column B panel 3 (at least 150), and /// column C, iconic, panel 4. fn end_dock_layout() -> Layout {