From 452bf2013d796b6245a6799a00e7833b59c2f76d Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Sun, 29 Nov 2026 09:34:32 +0100 Subject: [PATCH] Constrain the paragraph Tabs action row to the form width Wrap the action buttons against the offered form width. Keep the accessibility lookup and pointer-click regression at both viewport sizes, and assert that the click target is inside the viewport. --- crates/ui-egui/src/dialogs/para_style_options.rs | 4 +++- crates/ui-egui/src/dialogs/para_style_options/tests.rs | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/dialogs/para_style_options.rs b/crates/ui-egui/src/dialogs/para_style_options.rs index 8522ee741c..609fca1dce 100644 --- a/crates/ui-egui/src/dialogs/para_style_options.rs +++ b/crates/ui-egui/src/dialogs/para_style_options.rs @@ -609,7 +609,9 @@ fn tabs_buttons(unit: Unit) -> Param { let (rows, _, _) = tab_rows(fields); let can_add = new_tab_position(&rows, unit).is_some(); let (mut add, mut delete, mut clear) = (false, false, false); - let line = Row::new().wrap(true).show(ui, |ui, _| { + // Wrap against the form's offered width rather than measuring an intrinsic-width + // strip that may be clipped by the property group on small screens. + let line = Row::new().fill_width().wrap(true).show(ui, |ui, _| { add = clicked(&Button::new(tl!("Add")).enabled(can_add).show(ui)); delete = clicked(&Button::new(tl!("Delete Tab")).enabled(!rows.is_empty()).show(ui)); clear = clicked(&Button::new(tl!("Clear All Tabs")).enabled(!rows.is_empty()).show(ui)); diff --git a/crates/ui-egui/src/dialogs/para_style_options/tests.rs b/crates/ui-egui/src/dialogs/para_style_options/tests.rs index 22802313ce..39d26bfb1a 100644 --- a/crates/ui-egui/src/dialogs/para_style_options/tests.rs +++ b/crates/ui-egui/src/dialogs/para_style_options/tests.rs @@ -576,9 +576,13 @@ fn clear_all_tabs_can_be_clicked_in_a_narrow_viewport() { } let out = frame(&mut app, vec![]); let nodes = out.platform_output.accesskit_update.unwrap().nodes; - let clear = nodes.iter().find(|(_, node)| node.role() == Role::Button && node.label() == Some("Clear All Tabs")).unwrap(); + let clear = nodes + .iter() + .find(|(_, node)| node.role() == Role::Button && node.label() == Some("Clear All Tabs")) + .unwrap_or_else(|| panic!("Clear All Tabs is missing at {width} points")); let bounds = clear.1.bounds().unwrap(); let at = pos2(((bounds.x0 + bounds.x1) * 0.5) as f32, ((bounds.y0 + bounds.y1) * 0.5) as f32); + assert!(screen.contains(at), "Clear All Tabs at {bounds:?} is outside the {width}-point viewport"); assert_eq!(tab_rows(&app).len(), 2); frame(&mut app, vec![Event::PointerMoved(at)]);