From b48dbdff3bd4ae380589bbc13617a91c82e3b4d5 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sat, 21 Nov 2026 14:55:44 -0500 Subject: [PATCH 1/6] Inset the find bar in the page view --- crates/ui-egui/src/canvas/find.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ui-egui/src/canvas/find.rs b/crates/ui-egui/src/canvas/find.rs index b9301d9393..fa06a85cd0 100644 --- a/crates/ui-egui/src/canvas/find.rs +++ b/crates/ui-egui/src/canvas/find.rs @@ -185,7 +185,7 @@ pub(super) fn find_bar(view: &mut DocView, pages: usize, area: Rect, editing: bo // One id per pane, so two panes' bars do not share a field id (and so the focus). let shown = ui .push_id(("find-bar", key), |ui| { - TaskBar::at_edge(tl!("Find"), Align::End).show(ui, area, |ui, _cx| { + TaskBar::at_edge(tl!("Find"), Align::End).show(ui, area.shrink2(egui::vec2(6.0, 12.0)), |ui, _cx| { let Find { query, options, matches, bar, replacement, replacing, .. } = &mut *find; let mut find_bar = FindBar::new(query, options, matches).state(bar).progress(searched, pages); if editing { From 23d6b1162159b6b9281aad4345d87e9fe646d1a5 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sat, 21 Nov 2026 14:56:20 -0500 Subject: [PATCH 2/6] Give the rail zoom field its available width --- crates/ui-egui/src/chrome/view_rail.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/chrome/view_rail.rs b/crates/ui-egui/src/chrome/view_rail.rs index 29a2500cdb..ad0f464ca1 100644 --- a/crates/ui-egui/src/chrome/view_rail.rs +++ b/crates/ui-egui/src/chrome/view_rail.rs @@ -71,7 +71,9 @@ pub(crate) fn show(app: &mut PdfCraftApp, ui: &mut Ui) { IconButton::command(IconId::new("chevron_up"), "view.previous_page").show(ui); IconButton::command(IconId::new("chevron_down"), "view.next_page").show(ui); - let (zoom_rect, _) = ui.allocate_exact_size(field_size, egui::Sense::hover()); + // The percent suffix and three digits need the rail's full width, not an icon button's width. + let zoom_size = egui::vec2(ui.available_width(), field_size.y); + let (zoom_rect, _) = ui.allocate_exact_size(zoom_size, egui::Sense::hover()); let field = ZoomField::new("Zoom", view.canvas_view(), page_size).scale(ZoomScale::Points).show_at(ui, zoom_rect); if let Some(edited) = field.view.committed() { view.apply_canvas_view(edited); From 254a0ff7892c226c1cfd8120db629397161adb8c Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sat, 21 Nov 2026 14:58:49 -0500 Subject: [PATCH 3/6] Float the toolbar in the default workspace --- crates/ui-egui/src/panels/side_panels.rs | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/crates/ui-egui/src/panels/side_panels.rs b/crates/ui-egui/src/panels/side_panels.rs index 9a0ec2ed05..426e76d8fb 100644 --- a/crates/ui-egui/src/panels/side_panels.rs +++ b/crates/ui-egui/src/panels/side_panels.rs @@ -6,7 +6,7 @@ use craft::automation::dock as dock_rpc; use craft::behavior::dock::{ - Action, Column, DockEdge, DockError, DockPlacement, Group, Layout, Node, PanelState, Permissions, SplitSize, Target, Workspace, + Action, Column, DockEdge, DockError, DockPlacement, Floating, Group, Layout, Node, PanelState, Permissions, SplitSize, Target, Workspace, }; use craft::behavior::{Axis, DockSide, IconId}; use craft::keymap::CommandRef; @@ -168,19 +168,20 @@ const PAGE_SHARE: f32 = 0.8; /// The Tools pane's default width, as production opened it. const TOOLS_WIDTH: f32 = 272.0; -/// The arrangement of a new install: Tools at the start edge, the side-panel rail at the window edge, the toolbar inward of it, and the page area between -/// the docks. The side panels form one group, collapsed to their icons. +/// The arrangement of a new install: Tools at the start edge, the side-panel rail at the window edge, +/// and the toolbar floating at the start of the page area. The side panels form one collapsed group. pub fn default_workspace(rail_side: DockSide) -> Workspace { let single = |panel| Column::new(vec![Group::new(vec![panel], 0)]); // The rail is one tool column wide: its column keeps the toolbar's grid, never the theme's column width. // The Tools pane opens at production's width (272 points, the old `TOOLS_WIDTH`), not the theme's column width. let (tools, toolbar) = (single(PanelId::Tools).with_width(TOOLS_WIDTH), single(PanelId::Toolbar).with_steps(1)); let side = Column::new(vec![Group::new(SIDE.to_vec(), 0)]).with_iconic(true); - let (start, end) = - if rail_edge(rail_side) == DockEdge::Start { (vec![side, toolbar, tools], Vec::new()) } else { (vec![tools], vec![side, toolbar]) }; + let (start, end) = if rail_edge(rail_side) == DockEdge::Start { (vec![side, tools], Vec::new()) } else { (vec![tools], vec![side]) }; let page = Node::split(Axis::X, SplitSize::Ratio(PAGE_SHARE), Node::tabs(vec![PanelId::Document], 0), Node::dock(DockEdge::End, end)); let root = Node::split(Axis::X, SplitSize::Ratio(START_SHARE), Node::dock(DockEdge::Start, start), page); - Workspace::new(Layout::new(Some(root), Vec::new())) + let rect = egui::Rect::from_min_size(egui::pos2(TOOLS_WIDTH + 14.0, 96.0), egui::vec2(48.0, 400.0)); + let floating = Floating::new(toolbar, rect).with_id(1); + Workspace::new(Layout::new(Some(root), vec![floating])) } /// The window edge whose dock holds `panel`, `None` when it is closed or floating. @@ -888,6 +889,16 @@ mod tests { use super::*; + #[test] + fn new_workspace_floats_the_toolbar() { + for side in [DockSide::Start, DockSide::End] { + let workspace = default_workspace(side); + assert!(workspace.layout.validate().is_ok()); + assert_eq!(edge_of(&workspace, PanelId::Toolbar), None); + assert!(workspace.layout.floating.iter().any(|window| window.contains(&PanelId::Toolbar))); + } + } + fn tabs(panels: &[&str]) -> Value { json!({"Tabs": {"panels": panels, "active": 0}}) } From 50d1a350f3bcfe15722bc2c4505ec674369dccb0 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sat, 21 Nov 2026 14:59:39 -0500 Subject: [PATCH 4/6] Use comfortable rail width in short-window test --- crates/ui-egui/tests/it/ui.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/tests/it/ui.rs b/crates/ui-egui/tests/it/ui.rs index eda90a4cce..96443df76a 100644 --- a/crates/ui-egui/tests/it/ui.rs +++ b/crates/ui-egui/tests/it/ui.rs @@ -1844,7 +1844,9 @@ fn short_window_rail_buttons_scroll_clear_of_page_navigation() { h.get_by_label("Dock navigation rail on Left").click(); crate::support::settle(&mut h); } - let in_rail = |r: egui::Rect| if on_left { r.right() <= 48.0 } else { r.left() >= width - 48.0 }; + // The comfortable-density rail is 50 points wide. + let rail_width = 50.0; + let in_rail = |r: egui::Rect| if on_left { r.right() <= rail_width } else { r.left() >= width - rail_width }; let rail = |h: &Harness<'static, PdfCraftApp>, label: &str| { h.query_all_by_label(label).map(|n| n.rect()).find(|r| in_rail(*r)).unwrap_or_else(|| panic!("{label} in the rail")) }; From d136cca083ab463e1d2a1a0745541d14372832de Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sat, 21 Nov 2026 15:02:27 -0500 Subject: [PATCH 5/6] Hide the quick toolbar while organizing pages --- crates/ui-egui/src/panels/side_panels.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/panels/side_panels.rs b/crates/ui-egui/src/panels/side_panels.rs index 426e76d8fb..080a131c54 100644 --- a/crates/ui-egui/src/panels/side_panels.rs +++ b/crates/ui-egui/src/panels/side_panels.rs @@ -476,7 +476,8 @@ pub fn dock(app: &mut PdfCraftApp, ui: &mut Ui) { // Full screen shows the document alone, and a document can hide the toolbars, the menu and the panels around it // in its tab (ISO 32000-2 Table 147); the tab strip stays, and F8 brings the rest back (`viewer_prefs`). let bare = app.full_screen_document() || app.hidden_interface().window_ui; - let toolbar = active && !app.hotbar_hidden(); + let organizing = app.active_ids().and_then(|(index, _)| app.views.get(index)).is_some_and(|view| view.organize); + let toolbar = active && !app.hotbar_hidden() && !organizing; let anchor = rail_anchor(app); let workspace = app.dock.clone(); // The rail lists the Accessibility Checker once the document has a report, and Search and Compare only while From 2696fce039e793119771e64b8a088c29d2f5dc27 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sat, 21 Nov 2026 15:03:38 -0500 Subject: [PATCH 6/6] Keep the default toolbar clear of the page --- crates/ui-egui/src/panels/side_panels.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ui-egui/src/panels/side_panels.rs b/crates/ui-egui/src/panels/side_panels.rs index 080a131c54..b1fd7c94af 100644 --- a/crates/ui-egui/src/panels/side_panels.rs +++ b/crates/ui-egui/src/panels/side_panels.rs @@ -179,7 +179,7 @@ pub fn default_workspace(rail_side: DockSide) -> Workspace { let (start, end) = if rail_edge(rail_side) == DockEdge::Start { (vec![side, tools], Vec::new()) } else { (vec![tools], vec![side]) }; let page = Node::split(Axis::X, SplitSize::Ratio(PAGE_SHARE), Node::tabs(vec![PanelId::Document], 0), Node::dock(DockEdge::End, end)); let root = Node::split(Axis::X, SplitSize::Ratio(START_SHARE), Node::dock(DockEdge::Start, start), page); - let rect = egui::Rect::from_min_size(egui::pos2(TOOLS_WIDTH + 14.0, 96.0), egui::vec2(48.0, 400.0)); + let rect = egui::Rect::from_min_size(egui::pos2(TOOLS_WIDTH + 3.0, 96.0), egui::vec2(48.0, 400.0)); let floating = Floating::new(toolbar, rect).with_id(1); Workspace::new(Layout::new(Some(root), vec![floating])) }