From 3840ca29652e3128ffbcdebd9f39f364e56079ea Mon Sep 17 00:00:00 2001 From: "sorokin.oleg.edu" Date: Sat, 12 Sep 2026 04:46:09 -0700 Subject: [PATCH] Verify tooltip inspection through the installed renderer overlay --- .../app/allocation_drag_full_tree_tests.rs | 38 ++++++++++++++++--- crates/oa-desktop/src/views.rs | 1 - 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/crates/oa-desktop/src/app/allocation_drag_full_tree_tests.rs b/crates/oa-desktop/src/app/allocation_drag_full_tree_tests.rs index 52eed885..5a8a8fab 100644 --- a/crates/oa-desktop/src/app/allocation_drag_full_tree_tests.rs +++ b/crates/oa-desktop/src/app/allocation_drag_full_tree_tests.rs @@ -625,12 +625,38 @@ async fn actual_toolbar_hover_inspects_last_full_name_without_authorizing_an_out assert!(f.app.allocation_drag.preview.is_none()); assert!(f.app.allocation_drag.active.is_some()); let inspected = mounted.pixels_at(&f.app, mouse::Cursor::Available(hover)); - let tooltip = mounted - .geometry(&f.app) - .bounds("allocation-destination-tooltip"); - assert!(tooltip.width > 0. && tooltip.height > 26.); - assert!(tooltip.y >= 0. && tooltip.x >= 0.); - assert!(tooltip.x + tooltip.width <= f.app.window_size.width); + // Iced's Tooltip overlay draws its child but exposes no Operation + // traversal. Compare the real rendered overlay instead of inventing + // container geometry that the installed widget cannot report. + let inspection = std::mem::take( + &mut f + .app + .allocation_drag + .feedback + .as_mut() + .unwrap() + .inspection_targets, + ); + let without_name = mounted.pixels_at(&f.app, mouse::Cursor::Available(hover)); + let width = f.app.window_size.width as usize; + assert_ne!( + inspected, without_name, + "full captured name changes the actual hovered tooltip" + ); + assert_eq!( + canvas_pixels(&inspected, width, canvas), + canvas_pixels(&without_name, width, canvas) + ); + assert_eq!( + canvas_pixels(&inspected, width, slot), + canvas_pixels(&without_name, width, slot) + ); + f.app + .allocation_drag + .feedback + .as_mut() + .unwrap() + .inspection_targets = inspection; assert_eq!(canvas_bounds(&mut mounted, &f.app), canvas); record_render_evidence( &format!("{layer:?}-name-inspection"), diff --git a/crates/oa-desktop/src/views.rs b/crates/oa-desktop/src/views.rs index ea94b05f..1a5fa47c 100644 --- a/crates/oa-desktop/src/views.rs +++ b/crates/oa-desktop/src/views.rs @@ -531,7 +531,6 @@ fn diagram(app: &App) -> View<'_, Message> { .size(13) .wrapping(widget::text::Wrapping::None), container(text(inspection).size(13)) - .id("allocation-destination-tooltip") .padding(10) .max_width(420) .style(style::card),