From 56fdebde77e1423c6663ddc488bb60d312b39b68 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 18 Nov 2026 23:06:27 -0500 Subject: [PATCH] app red 5 (g8) (swarm/red5); committed by the lead --- crates/ui-egui/src/canvas.rs | 4 ++++ crates/ui-egui/src/canvas/crop.rs | 21 ++++++++++++------- crates/ui-egui/src/canvas/page_tools.rs | 10 ++++----- crates/ui-egui/src/canvas/zoom_snap.rs | 16 +++++++------- crates/ui-egui/src/tools/comments/bridge.rs | 13 +++++++----- crates/ui-egui/src/tools/comments/tests.rs | 10 +++++---- crates/ui-egui/src/tools/content_ui.rs | 7 +++---- .../ui-egui/src/tools/fill_sign/type_box.rs | 11 +++++----- crates/ui-egui/src/tools/sign_ui/tool.rs | 9 ++++---- crates/ui-egui/tests/it/fill_sign.rs | 18 ++++++++-------- crates/ui-egui/tests/it/signing.rs | 4 ++-- 11 files changed, 70 insertions(+), 53 deletions(-) diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index 2256a8942c..13eb7f57c7 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -379,6 +379,9 @@ pub struct PageSession { /// The caret and selection in the Fill & Sign text being typed. pub fill_selection: craft::text::ui::editor::TextSelection, pub(crate) signature_drag: crate::signature_drag::SignatureDrag, + /// The rectangle being dragged on a page by Snapshot, Crop or a signature area: the page tools are built each + /// pass, so the drag lives here from its press to its release. + pub(crate) box_drag: PageBoxDrag, /// What the last secondary press on a page went to, and on which page (`None` off the pages): the page's menu /// shows its entries when it has a menu and is the one selected, or else the page's own. pub(crate) menu_for: Option<(usize, Owner)>, @@ -433,6 +436,7 @@ impl PageSession { fill_text: None, fill_selection: Default::default(), signature_drag: Default::default(), + box_drag: PageBoxDrag::default(), menu_for: None, } } diff --git a/crates/ui-egui/src/canvas/crop.rs b/crates/ui-egui/src/canvas/crop.rs index 9a1229ac55..ed7b302554 100644 --- a/crates/ui-egui/src/canvas/crop.rs +++ b/crates/ui-egui/src/canvas/crop.rs @@ -37,23 +37,30 @@ fn to_user(page: &pdfcraft_render::PageInfo, vx: f32, vy: f32) -> [f64; 2] { } /// The Crop tool, built per pass over the placed pages. -pub(crate) struct CropTool { +pub(crate) struct CropTool<'a> { allowed: bool, placed: Vec, /// Per placed page: its unrotated view-space size. sizes: Vec<(usize, (f32, f32))>, rotation: u16, - drag: PageBoxDrag, + /// The session's drag, kept from the press to the release. + drag: &'a mut PageBoxDrag, done: Option, open_boxes: Option, } -impl CropTool { +impl<'a> CropTool<'a> { // PLAN: pdf-canvas-w9 asked for `CropTool::new(allowed)`; the tool needs the placed pages to know which page a press is on. - /// A tool over `placed`; `allowed` is false when page editing is forbidden. - pub(crate) fn new(allowed: bool, placed: &[PlacedPage], rotation: u16, page_size_of: impl Fn(usize) -> (f32, f32)) -> Self { + /// A tool over `placed`, with its rectangle in `drag`; `allowed` is false when page editing is forbidden. + pub(crate) fn new( + allowed: bool, + drag: &'a mut PageBoxDrag, + placed: &[PlacedPage], + rotation: u16, + page_size_of: impl Fn(usize) -> (f32, f32), + ) -> Self { let sizes = placed.iter().map(|p| (p.page, page_size_of(p.page))).collect(); - Self { allowed, placed: placed.to_vec(), sizes, rotation, drag: PageBoxDrag::default(), done: None, open_boxes: None } + Self { allowed, placed: placed.to_vec(), sizes, rotation, drag, done: None, open_boxes: None } } /// The crop the last release made, once. @@ -72,7 +79,7 @@ impl CropTool { } } -impl CanvasTool for CropTool { +impl CanvasTool for CropTool<'_> { fn press(&mut self, pointer: &ToolPointer, _cx: &mut ToolContext<'_>) -> ToolAction { if !self.allowed { return ToolAction::Ignored; diff --git a/crates/ui-egui/src/canvas/page_tools.rs b/crates/ui-egui/src/canvas/page_tools.rs index 6cd55c9456..47de09d76e 100644 --- a/crates/ui-egui/src/canvas/page_tools.rs +++ b/crates/ui-egui/src/canvas/page_tools.rs @@ -147,9 +147,9 @@ enum Arm<'a> { /// The signature rectangle of Digitally sign. SignArea(SignAreaTool<'a>), /// Snapshot: the area to copy. - Snapshot(SnapshotTool), + Snapshot(SnapshotTool<'a>), /// Crop: the rectangle to crop the page to, or a double click for Set Page Boxes. - Crop(CropTool), + Crop(CropTool<'a>), } /// The page tool of a pass, handed to the tool host: every [`CanvasTool`] method forwards to the arm. @@ -303,7 +303,7 @@ pub(crate) fn page_tool<'a>( QuickTool::Measure(t) => { Arm::Measure(MeasureTool::new(&mut session.measure, cx.doc, map, cx.info, t, cx.units, cx.author, cx.host, cx.wake.clone())) } - QuickTool::Crop => Arm::Crop(CropTool::new(cx.can_crop, cx.pages, cx.rotation, size)), + QuickTool::Crop => Arm::Crop(CropTool::new(cx.can_crop, &mut session.box_drag, cx.pages, cx.rotation, size)), QuickTool::EnhanceCamera => Arm::Camera(CameraTool::new(cx.can_modify, cx.pages)), QuickTool::Fill(fill_tool) => { let input = FillInput { @@ -340,8 +340,8 @@ pub(crate) fn page_tool<'a>( None => Arm::Hand(HandTool::new(cx.navigation)), }, QuickTool::Link => Arm::Area(Box::new(LinkTool::new(session, cx.pages, cx.info, *press))), - QuickTool::SignArea { certify } => Arm::SignArea(SignAreaTool::new(certify, cx.pages, cx.rotation, cx.info)), - QuickTool::Snapshot => Arm::Snapshot(SnapshotTool::new(cx.pages, cx.rotation, size)), + QuickTool::SignArea { certify } => Arm::SignArea(SignAreaTool::new(certify, &mut session.box_drag, cx.pages, cx.rotation, cx.info)), + QuickTool::Snapshot => Arm::Snapshot(SnapshotTool::new(&mut session.box_drag, cx.pages, cx.rotation, size)), }; PageTool { arm, tool, selects_text, released: false, presenting: cx.presenting, presenter_keys: Vec::new() } } diff --git a/crates/ui-egui/src/canvas/zoom_snap.rs b/crates/ui-egui/src/canvas/zoom_snap.rs index 628325c470..026c77659a 100644 --- a/crates/ui-egui/src/canvas/zoom_snap.rs +++ b/crates/ui-egui/src/canvas/zoom_snap.rs @@ -27,20 +27,22 @@ pub enum AreaChoice { /// The Snapshot tool, built per pass over the placed pages. A drag reports the page and the /// rectangle in page view points; a click with no drag, or under 2 points either way, reports nothing. -pub(crate) struct SnapshotTool { +pub(crate) struct SnapshotTool<'a> { placed: Vec, /// Per placed page: its unrotated view-space size. sizes: Vec<(usize, (f32, f32))>, rotation: u16, - drag: PageBoxDrag, + /// The session's drag, kept from the press to the release. + drag: &'a mut PageBoxDrag, done: Option<(usize, [f32; 4])>, } -impl SnapshotTool { - /// A tool over `placed`, in a view turned by `rotation`; `page_size_of` gives a page's size in view points. - pub(crate) fn new(placed: &[PlacedPage], rotation: u16, page_size_of: impl Fn(usize) -> (f32, f32)) -> Self { +impl<'a> SnapshotTool<'a> { + /// A tool over `placed`, in a view turned by `rotation`, with its rectangle in `drag`; `page_size_of` gives a + /// page's size in view points. + pub(crate) fn new(drag: &'a mut PageBoxDrag, placed: &[PlacedPage], rotation: u16, page_size_of: impl Fn(usize) -> (f32, f32)) -> Self { let sizes = placed.iter().map(|p| (p.page, page_size_of(p.page))).collect(); - Self { placed: placed.to_vec(), sizes, rotation, drag: PageBoxDrag::default(), done: None } + Self { placed: placed.to_vec(), sizes, rotation, drag, done: None } } /// The area the last release made, once. @@ -54,7 +56,7 @@ impl SnapshotTool { } } -impl CanvasTool for SnapshotTool { +impl CanvasTool for SnapshotTool<'_> { fn press(&mut self, pointer: &ToolPointer, _cx: &mut ToolContext<'_>) -> ToolAction { match page_under(&self.placed, pointer.pos) { Some(placed) if self.drag.press(placed, pointer.pos) => ToolAction::Claimed, diff --git a/crates/ui-egui/src/tools/comments/bridge.rs b/crates/ui-egui/src/tools/comments/bridge.rs index 2db57018c2..c4d9b99202 100644 --- a/crates/ui-egui/src/tools/comments/bridge.rs +++ b/crates/ui-egui/src/tools/comments/bridge.rs @@ -361,8 +361,9 @@ pub(crate) fn parts( let markers = marker_boxes(info, &anns, icon_side); let Some(id) = pick_at(&anns, at, tolerance, icon_side, &markers) else { return Vec::new() }; let Some(found) = anns.iter().find(|a| a.id == id) else { return Vec::new() }; - let mut shapes: Vec = - if found.kind.is_markup() { found.points.chunks(4).filter_map(bounds).collect() } else { vec![found.extent(icon_side)] }; + // A markup's lines, or its box when it has none (a highlight with no /QuadPoints is picked by its box too). + let lines: Vec = if found.kind.is_markup() { found.points.chunks(4).filter_map(bounds).collect() } else { Vec::new() }; + let mut shapes = if lines.is_empty() { vec![found.extent(icon_side)] } else { lines }; shapes.extend(markers.iter().filter(|(m, _)| *m == id).map(|(_, r)| *r)); let screen_shapes: Vec = shapes .iter() @@ -414,7 +415,7 @@ pub(super) fn edited_user_rect(info: &DocInfo, a: &Annotation, edit: &Annotation pub(crate) fn edit(e: AnnotationEdit, map: &PageMap<'_>, view: &mut CommentView, info: &DocInfo, prefs: &CommentPrefs) -> Option { match e { AnnotationEdit::Create(a) => create(&a, map, prefs), - AnnotationEdit::Move { ids, delta } => moved(&ids, delta, info), + AnnotationEdit::Move { ids, delta } => moved(&ids, delta, map, info), AnnotationEdit::Resize { id, rect } => { let (page, index) = key_of(id); engine(info, page, index).filter(|a| resizable(a))?; @@ -463,7 +464,7 @@ pub(crate) fn edit(e: AnnotationEdit, map: &PageMap<'_>, view: &mut CommentView, } } -fn moved(ids: &[AnnotationId], delta: Vec2, info: &DocInfo) -> Option { +fn moved(ids: &[AnnotationId], delta: Vec2, map: &PageMap<'_>, info: &DocInfo) -> Option { if delta == Vec2::ZERO { return None; } @@ -481,7 +482,9 @@ fn moved(ids: &[AnnotationId], delta: Vec2, info: &DocInfo) -> Option { // moved with its comment. let a = engine(info, page, index).filter(|a| !a.is_reply() && !on_text(a) && !a.locked)?; let p = info.pages.get(page)?; - let (dx, dy) = user_delta(p, delta); + // The delta is in the page as shown, the view's turn included: the map takes it back to user space. + let (from, to) = (map.to_user(page, Point::ZERO), map.to_user(page, Point::ZERO + delta)); + let (dx, dy) = (to[0] - from[0], to[1] - from[1]); if !(dx.is_finite() && dy.is_finite()) { return None; } diff --git a/crates/ui-egui/src/tools/comments/tests.rs b/crates/ui-egui/src/tools/comments/tests.rs index e68e0e1f44..ee4b8bc08d 100644 --- a/crates/ui-egui/src/tools/comments/tests.rs +++ b/crates/ui-egui/src/tools/comments/tests.rs @@ -28,9 +28,11 @@ fn page_map<'a>(placed: &'a [PlacedPage], info: &'a DocInfo, rotation: u16) -> P PageMap::new(info, placed, rotation) } -/// A kurbo rectangle as an egui one, for comparing a marker with a page's screen rectangle. -fn screen(r: craft::behavior::kurbo::Rect) -> Rect { - Rect::from_min_max(pos2(r.x0 as f32, r.y0 as f32), pos2(r.x1 as f32, r.y1 as f32)) +/// A rectangle in page units of `page` on screen, through the page map, for comparing a marker with the page's +/// screen rectangle. +fn screen(map: &PageMap<'_>, page: usize, r: craft::behavior::kurbo::Rect) -> Rect { + let corner = |x, y| map.to_screen(page, Point::new(x, y)).expect("the page is placed"); + Rect::from_two_pos(corner(r.x0, r.y0), corner(r.x1, r.y1)) } /// A sticky note on a page turned a quarter is drawn upright beside its `/Rect`: an edit @@ -412,7 +414,7 @@ fn markup_comment_markers_stay_inside_turned_and_zoomed_pages() { let both = with(vec![top, a.clone()]); let markers = bridge::markers(&both, &map, side); let (_, marker) = *markers.last().expect("commented markup has a marker"); - let inside = screen(marker); + let inside = screen(&map, 0, marker); assert!(xf.rect.contains_rect(inside), "page/view rotation {page_rotation}/{rotation}, zoom {zoom}, anchor {rect:?}: {inside:?}"); let annotations = bridge::annotations(&both, &map, QuickTool::Select, true); let picked = pick_at(&annotations, marker.center(), tolerance_of(&map), side, &markers); diff --git a/crates/ui-egui/src/tools/content_ui.rs b/crates/ui-egui/src/tools/content_ui.rs index 7234e0bfd9..f57d1b35c7 100644 --- a/crates/ui-egui/src/tools/content_ui.rs +++ b/crates/ui-egui/src/tools/content_ui.rs @@ -26,6 +26,7 @@ use craft::ui::layout_components::Row; use craft::ui::primitives::textures::{CachedTexture, Revision, TextureStore, TextureStoreOptions}; use craft::ui::primitives::{ContentPainterCx, Draw}; use craft::ui::runtime::env::UnitKind; +use craft::ui::runtime::focus::FocusRequest; use craft::ui::sections::Section; use craft::ui::text::NumberField; use egui::{Color32, CornerRadius, Pos2, Rect}; @@ -1032,10 +1033,8 @@ fn draft_session( let mut selection = draft.selection.unwrap_or_else(|| TextSelection::caret_at(draft.text.chars().count())); let mut host = AddedTextHost { draft, ctx: ctx.clone(), view: body.view, layout, laid_out: None }; let paper = Rect::from_min_size(at, egui::vec2(width, host.galley().rect.height() + INSET.y * 2.0)); - let output = TextEditor::new(tl!("Added text"), &mut host, Bind::bound(&mut selection)).esc_commits(false).id(editor_id).show_at(ui, paper); - if fresh { - output.response.request_focus(); - } + let editor = TextEditor::new(tl!("Added text"), &mut host, Bind::bound(&mut selection)).esc_commits(false).id(editor_id); + let output = if fresh { editor.request_focus(FocusRequest::Take) } else { editor }.show_at(ui, paper); let ended = output.ended.filter(|end| !(fresh && *end == EditorEnd::Commit)); let galley = host.galley(); let paper = Rect::from_min_size(at, egui::vec2(width, galley.rect.height() + INSET.y * 2.0)); diff --git a/crates/ui-egui/src/tools/fill_sign/type_box.rs b/crates/ui-egui/src/tools/fill_sign/type_box.rs index 5b43824e4b..27ae52c9b5 100644 --- a/crates/ui-egui/src/tools/fill_sign/type_box.rs +++ b/crates/ui-egui/src/tools/fill_sign/type_box.rs @@ -5,7 +5,8 @@ use std::ops::Range; use craft::behavior::kurbo::Point; use craft::pages::ui::PageBody; use craft::text::ui::editor::{CaretLine, EditKind, EditorEnd, HostLine, HostRun, TextEditor, TextEditorHost, TextSelection}; -use craft::ui::contract::{Bind, Show as _}; +use craft::ui::contract::{Bind, Props as _, Show as _}; +use craft::ui::runtime::focus::FocusRequest; use egui::{Color32, FontId, Pos2, Rect, Stroke, vec2}; use pdfcraft_engine::{BorderShape, Edit}; use pdfcraft_render::DocInfo; @@ -254,11 +255,9 @@ pub(crate) fn show(ui: &mut egui::Ui, body: &PageBody<'_>, session: &mut PageSes // Escape cancels: the page's Escape belongs to the editor while a box is open. // A box still waiting for its focus was started in this pass by the press the editor also sees as a press on the // canvas background: that press is the one that opened it, not a click away from it. - let fresh = tb.focus; - let out = TextEditor::new(tl!("Text to place"), &mut host, Bind::bound(fill_selection)).esc_commits(false).show_at(ui, rect); - if std::mem::take(&mut tb.focus) { - out.response.request_focus(); - } + let fresh = std::mem::take(&mut tb.focus); + let editor = TextEditor::new(tl!("Text to place"), &mut host, Bind::bound(fill_selection)).esc_commits(false); + let out = if fresh { editor.request_focus(FocusRequest::Take) } else { editor }.show_at(ui, rect); match out.ended.filter(|end| !(fresh && *end == EditorEnd::Commit))? { EditorEnd::Cancel => { *fill_text = None; diff --git a/crates/ui-egui/src/tools/sign_ui/tool.rs b/crates/ui-egui/src/tools/sign_ui/tool.rs index 34ef5f8f11..796ba99c9a 100644 --- a/crates/ui-egui/src/tools/sign_ui/tool.rs +++ b/crates/ui-egui/src/tools/sign_ui/tool.rs @@ -15,7 +15,8 @@ const LEAST_SIDE: f32 = 8.0; /// Drags a signature rectangle on one page. The rectangle of a finished drag is taken with /// [`SignAreaTool::finished`], in user space of its page. pub(crate) struct SignAreaTool<'a> { - drag: PageBoxDrag, + /// The session's drag, kept from the press to the release. + drag: &'a mut PageBoxDrag, /// Certify (DocMDP) rather than sign: names the command that takes the same numbers. certify: bool, placed: &'a [PlacedPage], @@ -27,9 +28,9 @@ pub(crate) struct SignAreaTool<'a> { impl<'a> SignAreaTool<'a> { /// A tool over the placed pages that draws the area for a certification when `certify`, for a - /// signature otherwise. - pub(crate) fn new(certify: bool, placed: &'a [PlacedPage], rotation: u16, info: &'a DocInfo) -> Self { - Self { drag: PageBoxDrag::default(), certify, placed, rotation, info, drawn: None } + /// signature otherwise, with its rectangle in `drag`. + pub(crate) fn new(certify: bool, drag: &'a mut PageBoxDrag, placed: &'a [PlacedPage], rotation: u16, info: &'a DocInfo) -> Self { + Self { drag, certify, placed, rotation, info, drawn: None } } /// The (page, user-space rectangle) a drag finished with since the last call, once. diff --git a/crates/ui-egui/tests/it/fill_sign.rs b/crates/ui-egui/tests/it/fill_sign.rs index 630997affb..f11616906e 100644 --- a/crates/ui-egui/tests/it/fill_sign.rs +++ b/crates/ui-egui/tests/it/fill_sign.rs @@ -2177,7 +2177,7 @@ fn photos_and_images_dropped_on_the_signature_pad_are_imported_not_opened() { } /// #2149: the first save after Fill & Sign places a signature asks whether to lock it into the -/// page. Lock and save flattens it; Keep editable keeps it a comment; Don't ask again becomes +/// page. Lock and save flattens it; Keep editable keeps it a comment; Don't show again becomes /// the preference; the Fill & Sign panel has the switch too, once, and the Sign menu no longer /// does (review on #2348). #[test] @@ -2197,21 +2197,21 @@ fn the_first_save_after_placing_a_signature_asks_to_lock_it() { let ctx_h = h.ctx.clone(); assert!(!h.state_mut().save_active(&ctx_h, SaveTarget::InPlace), "asks first"); h.run_steps(2); - h.get_by_label("Lock your signature into the page?"); + h.get_by_role_and_label(egui::accesskit::Role::Dialog, "Lock your signature into the page?"); h.get_by_label("Keep editable").click(); h.run_steps(3); assert!(!h.state().session.get(h.state().views[0].id).unwrap().dirty, "saved"); assert_eq!(signed(&h), 1, "still a removable comment"); let ctx_h = h.ctx.clone(); assert!(h.state_mut().save_active(&ctx_h, SaveTarget::InPlace), "no new signature: no question"); - // A new signature asks again; Lock and save with Don't ask again flattens and remembers. + // A new signature asks again; Lock and save with Don't show again flattens and remembers. h.execute("sign.fill.signature"); h.run_steps(2); click(&mut h, 40.0, 200.0); let ctx_h = h.ctx.clone(); assert!(!h.state_mut().save_active(&ctx_h, SaveTarget::InPlace)); h.run_steps(2); - h.get_by_label("Don't ask again").click(); + h.get_by_role_and_label(egui::accesskit::Role::CheckBox, "Don't show again").click(); h.run_steps(1); h.get_by_label("Lock and save").click(); h.run_steps(3); @@ -2407,7 +2407,7 @@ fn locking_a_signature_clears_the_comment_selection() { } /// #2348 review: when locking the signature fails (here the document's security allows comments -/// but not changes), nothing is lost: the next save asks again, and "Don't ask again" isn't +/// but not changes), nothing is lost: the next save asks again, and "Don't show again" isn't /// remembered. #[test] fn a_lock_that_fails_keeps_the_question() { @@ -2437,7 +2437,7 @@ fn a_lock_that_fails_keeps_the_question() { let ctx_h = h.ctx.clone(); assert!(!h.state_mut().save_active(&ctx_h, SaveTarget::InPlace), "asks first"); h.run_steps(2); - h.get_by_label("Don't ask again").click(); + h.get_by_role_and_label(egui::accesskit::Role::CheckBox, "Don't show again").click(); h.run_steps(1); h.get_by_label("Lock and save").click(); h.run_steps(3); @@ -2446,7 +2446,7 @@ fn a_lock_that_fails_keeps_the_question() { let ctx_h = h.ctx.clone(); assert!(!h.state_mut().save_active(&ctx_h, SaveTarget::InPlace), "the next save asks again"); h.run_steps(2); - h.get_by_label("Lock your signature into the page?"); + h.get_by_role_and_label(egui::accesskit::Role::Dialog, "Lock your signature into the page?"); let _ = std::fs::remove_file(&out); } @@ -2518,7 +2518,7 @@ fn the_lock_question_is_skipped_or_kept_where_it_must_be() { let _ = std::fs::remove_file(&out); } -/// #2149: Cancel saves nothing, and Keep editable with Don't ask again turns the question off. +/// #2149: Cancel saves nothing, and Keep editable with Don't show again turns the question off. #[test] fn cancelling_the_lock_question_saves_nothing() { let out = std::env::temp_dir().join(format!("pdfcraft-lock-cancel-{}.pdf", std::process::id())); @@ -2538,7 +2538,7 @@ fn cancelling_the_lock_question_saves_nothing() { let ctx_h = h.ctx.clone(); assert!(!h.state_mut().save_active(&ctx_h, SaveTarget::InPlace), "asked again"); h.run_steps(2); - h.get_by_label("Don't ask again").click(); + h.get_by_role_and_label(egui::accesskit::Role::CheckBox, "Don't show again").click(); h.run_steps(1); h.get_by_label("Keep editable").click(); h.run_steps(3); diff --git a/crates/ui-egui/tests/it/signing.rs b/crates/ui-egui/tests/it/signing.rs index b3a583d272..4481a98260 100644 --- a/crates/ui-egui/tests/it/signing.rs +++ b/crates/ui-egui/tests/it/signing.rs @@ -122,7 +122,7 @@ fn create_signing_id(h: &mut Harness<'static, PdfCraftApp>) { assert_eq!(h.state().sign_draft.as_ref().map(|d| d.step), Some(SignStep::Configure), "no IDs yet: configure one"); // Create a new digital ID (P-256 keeps the test fast). - h.get_by_label("Configure a Digital ID for Signing"); + h.get_by_role_and_label(egui::accesskit::Role::Dialog, "Configure a Digital ID for Signing"); field(h, "Name").click(); h.run_steps(1); field(h, "Name").type_text("Grace Hopper"); @@ -870,7 +870,7 @@ fn an_imported_digital_id_can_be_removed() { assert!(p12.exists(), "the file itself is not deleted"); // With no IDs left the dialog offers to configure one. assert_eq!(h.state().sign_draft.as_ref().map(|d| d.step), Some(SignStep::Configure)); - h.get_by_label("Configure a Digital ID for Signing"); + h.get_by_role_and_label(egui::accesskit::Role::Dialog, "Configure a Digital ID for Signing"); } /// Sign-and-save must use the same destination metadata policy as Save As.