From 1cc33aff329244de803ba33ee9680f32f312cde1 Mon Sep 17 00:00:00 2001 From: helgehelge123 <117832631+helgehelge123@users.noreply.github.com> Date: Mon, 9 Nov 2026 03:57:05 +0100 Subject: [PATCH] =?UTF-8?q?M12:=20the=20AI=20masks=20settings=20test=20scr?= =?UTF-8?q?olls=20to=20the=20foot=20of=20Settings=20=E2=96=B8=20Performanc?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Main's new rows on the tab (hot pixel limit, preview cache hints, Prepare photos in the background) push the AI masks lines below the dialog's scroll room at 1300×820, so the click on "CPU" was refused as not visible. The test now scrolls the page to its foot, as a user would, and checks the lines are in view before clicking. It only runs with the engine's `sam` feature, which the workspace build (CI) turns on but `cargo test -p lightcraft-ui-egui` alone does not. Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/tests/dialog_fit.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/crates/ui-egui/src/tests/dialog_fit.rs b/crates/ui-egui/src/tests/dialog_fit.rs index 6a534797fc..1301705514 100644 --- a/crates/ui-egui/src/tests/dialog_fit.rs +++ b/crates/ui-egui/src/tests/dialog_fit.rs @@ -161,6 +161,8 @@ fn gpu_status_never_moves_the_performance_controls() { /// Settings ▸ Performance says where AI masks run and how long the last photo took (issue #932): before the model /// loads, its two lines are there all the same, at the end of the tab, so nothing above them moves when it loads. +/// The tab is taller than the dialog, so the test scrolls to its foot first, as a user would, and clicks the +/// choice there (a press on a row scrolled out of view is refused, not delivered). #[test] fn performance_tab_shows_where_ai_masks_run() { let mut h = demo([1300.0, 820.0]); @@ -174,7 +176,16 @@ fn performance_tab_shows_where_ai_masks_run() { assert!(!has(&h, "settings:aiMasksDevice"), "a build without AI masks says nothing about them"); return; } + // (the AI masks lines end the page, below the room for it: scrolled to its foot) + let r = h.request("ui.hoverWidget", json!({"id": "settings:pageRoom"}), T); + assert_eq!(r["ok"], true, "{r}"); + h.request("ui.scroll", json!({"dy": -5000.0}), T); + h.settle(T); + let room = rect(&h, "settings:pageRoom"); let (device, time) = (rect(&h, "settings:aiMasksDevice"), rect(&h, "settings:aiMasksTime")); + for (what, r) in [("the choice", rect(&h, "button:settingsAiMasksRunOn-1")), ("the device line", device), ("the time line", time)] { + assert!(room.contains_rect(r), "{what} {r:?} is in view in {room:?}"); + } assert!(device.bottom() <= time.top() + 1.0, "the device line comes first: {device:?} {time:?}"); let choice = rect(&h, "button:settingsAiMasksRunOn-1"); assert!(choice.bottom() <= device.top() + 1.0, "the choice of where they run comes first: {choice:?} {device:?}");