From 3e777d2485833a2dfd3d5b05ca0aa1a5593f060a Mon Sep 17 00:00:00 2001 From: Rob Coenen <753704+rcoenen@users.noreply.github.com> Date: Wed, 14 Oct 2026 14:30:10 -0400 Subject: [PATCH] M7: home screen test waits for the recent-file reader The first-run test settled the home screen with a fixed 12 frames, but the recent files are looked at on a thread of their own and a card shows no name until that thread has answered. On a busy CI runner it hadn't yet, so "ridgeline" was still a grey placeholder and the test failed (seen on this PR and on codex/issue-250-async-dialog). settle() now waits until every recent file has been looked at, as home_recents_tests does. Checked with a reader slowed to 200 ms: the old test fails at the same line as CI, the new one passes. Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/home_tests.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/home_tests.rs b/crates/ui-egui/src/home_tests.rs index 1179b1c4..a8f06476 100644 --- a/crates/ui-egui/src/home_tests.rs +++ b/crates/ui-egui/src/home_tests.rs @@ -22,8 +22,18 @@ fn shapes(u: &mut Ui) -> Vec { flat(&u.frame_output(vec![]).shapes) } -/// Enough frames for every thumbnail in view (they render one a frame) and what follows a click. +/// Enough frames for every thumbnail in view (they render one a frame) and what follows a click, +/// after every recent file has been looked at (the reader is a thread of its own, and a card +/// shows no name until it has answered). fn settle(u: &mut Ui) -> Vec { + for _ in 0..400 { + u.frame(vec![]); + let files = u.app.inspect()["homeRecents"]["files"].as_array().cloned().unwrap_or_default(); + if files.iter().all(|f| !f["exists"].is_null()) { + break; + } + std::thread::sleep(std::time::Duration::from_millis(5)); + } for _ in 0..12 { u.frame(vec![]); }