Compare commits

...
Author SHA1 Message Date
autocraft-bot[bot] aac21c8baf Merge main (4680b9a2) into the pull request
I resolved the one conflict, in crates/ui-egui/src/widgets/tests.rs, by 

I resolved the one conflict, in crates/ui-egui/src/widgets/tests.rs, by keeping the pull request's `scroll_fonts_until(&mut h, 20.0, ...)` call before the heading assertions in the `restores_recents` branch. The default branch's side of the conflict was empty, and the surrounding merged code already requires both section headings. No conflict markers remain in that file, and `cargo fmt --all --check` passes.

The test was not verified. A first run of `cargo test --offline -p wordcraft-ui-egui --lib the_typed_list` timed out while the build pod was starting. A second run was still unfinished after about 46 minutes, across runner restarts, so I stopped it. Its output was piped through `tail`, so I don't know how far it got. I did not run clippy.

One thing to check: the merged code before my resolution appears to require the headings without scrolling. With the pull request's call kept, the test scrolls up to find a missing heading before failing, so it would not catch headings that are merely out of view on the clearing frame.
2026-12-04 21:51:24 +00:00
batistalucasv bd5a4e8039 test(widgets): always require section headings on font_box clearing frames (#8774) 2026-12-03 23:46:01 -03:00
+27 -15
View File
@@ -283,6 +283,31 @@ fn the_typed_list_shows_on_the_frame_of_the_keystroke() {
}
}
fn scroll_fonts_until(
h: &mut egui_kittest::Harness<'static, ()>,
delta_y: f32,
mut ready: impl FnMut(&egui_kittest::Harness<'static, ()>) -> bool,
) {
if ready(h) {
return;
}
let list_center = h.get_by_role_and_label(Role::ListBox, "Fonts").rect().center();
h.event(egui::Event::PointerMoved(list_center));
for _ in 0..20 {
if ready(h) {
break;
}
h.event(egui::Event::MouseWheel {
unit: egui::MouseWheelUnit::Page,
delta: vec2(0.0, delta_y),
phase: egui::TouchPhase::Move,
modifiers: egui::Modifiers::NONE,
source: egui::MouseWheelSource::Unknown,
});
h.step();
}
}
for (n, (events, expected, excluded, restores_recents)) in frames.into_iter().enumerate() {
send(&mut h, events);
let mut texts = Vec::new();
@@ -296,6 +321,7 @@ fn the_typed_list_shows_on_the_frame_of_the_keystroke() {
assert!(texts.iter().all(|t| t != label), "keystroke {n}: expected {label:?} to be filtered out on the frame, got texts: {texts:?}");
}
if restores_recents {
scroll_fonts_until(&mut h, 20.0, |h| h.query_by_label("Recently Used Fonts").is_some() && h.query_by_label("All Fonts").is_some());
let recent_y = h.get_by_label("Recently Used Fonts").rect().min.y;
let all_y = h.get_by_label("All Fonts").rect().min.y;
assert!(
@@ -312,21 +338,7 @@ fn the_typed_list_shows_on_the_frame_of_the_keystroke() {
for _ in 0..3 {
send(&mut h, erase());
}
let list_center = h.get_by_role_and_label(Role::ListBox, "Fonts").rect().center();
h.event(egui::Event::PointerMoved(list_center));
for _ in 0..20 {
if h.query_by_role_and_label(Role::TreeItem, "Add Font…").is_some() {
break;
}
h.event(egui::Event::MouseWheel {
unit: egui::MouseWheelUnit::Page,
delta: vec2(0.0, -20.0),
phase: egui::TouchPhase::Move,
modifiers: egui::Modifiers::NONE,
source: egui::MouseWheelSource::Unknown,
});
h.step();
}
scroll_fonts_until(&mut h, -20.0, |h| h.query_by_role_and_label(Role::TreeItem, "Add Font…").is_some());
assert!(
h.query_by_role_and_label(Role::TreeItem, "Add Font…").is_some(),
"expected WordCraft's Add Font… action row at the end of font_box's cleared list"