From 4443f7511f70fdcc2955ca8753113193049c6e08 Mon Sep 17 00:00:00 2001 From: Maciej Myszkiewicz Date: Sun, 11 Oct 2026 22:16:29 +0200 Subject: [PATCH] fix(gui): the "and N more" notice was drawn where nothing can see it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The parameter list caps at 512 matches and then says how many it left out. It said it below the clip rect, every time, so an operator searching a definition of nine thousand parameters saw 512 rows and nothing to tell them the other 8 981 existed — which reads as a search that found everything. `ScrollArea::auto_shrink([false, false])` takes every remaining point of height, so a line added after it is laid out past the bottom edge. The notice is a bottom strip now, claiming its height before the scroll area takes the rest. No test covers this and none can: it is a property of where a thing is drawn, which is the gap `TODO(gs-gui-app)` describes. What covers it is that the station can now photograph itself — `--screenshot` against CTIM shows the line present where it was absent before. --- crates/xtce-gs-gui/src/panels/tree.rs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/crates/xtce-gs-gui/src/panels/tree.rs b/crates/xtce-gs-gui/src/panels/tree.rs index 79f5bb5..db87d89 100644 --- a/crates/xtce-gs-gui/src/panels/tree.rs +++ b/crates/xtce-gs-gui/src/panels/tree.rs @@ -260,6 +260,17 @@ pub fn show(ui: &mut egui::Ui, tree: &mut Tree, db: &XtceDb, now: Utc, plots: us // One buffer for the hover text of every row drawn this frame, rather than one per row. let mut hover = String::new(); + if truncated > 0 { + // Before the scroll area and not after it. `auto_shrink([false, false])` takes every + // remaining point of height, so a line added afterwards is laid out past the clip rect + // and never drawn — which is what happened: an operator searching a 9 493-parameter + // definition saw 512 rows and nothing to say the other 8 981 existed. A bottom strip + // claims its height first and leaves the rest to scroll. + egui::Panel::bottom("tree_truncated").show(ui, |ui| { + ui.weak(format!("… and {truncated} more, narrow the search")); + }); + } + egui::ScrollArea::vertical() .auto_shrink([false, false]) .show_rows(ui, ROW_HEIGHT, rows, |ui, range| { @@ -275,12 +286,6 @@ pub fn show(ui: &mut egui::Ui, tree: &mut Tree, db: &XtceDb, now: Utc, plots: us } }); - if truncated > 0 { - // The count is the whole point: an operator who cannot see it does not know whether - // to narrow the search. - ui.weak(format!("… and {truncated} more, narrow the search")); - } - action }