From 3c8489795a4ff68f252fe1b522c87b4a8ce9c893 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sun, 22 Nov 2026 04:55:06 -0500 Subject: [PATCH 1/4] Restore the lookfix/edit marquee and field tints that the merge dropped from prepare/tool.rs --- crates/ui-egui/src/tools/prepare/tool.rs | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/crates/ui-egui/src/tools/prepare/tool.rs b/crates/ui-egui/src/tools/prepare/tool.rs index 9b4cdf96bf..bff7abf431 100644 --- a/crates/ui-egui/src/tools/prepare/tool.rs +++ b/crates/ui-egui/src/tools/prepare/tool.rs @@ -318,7 +318,7 @@ impl CanvasTool for PrepareTool<'_> { Gesture::Draw { drag, .. } => drag.paint(cx), Gesture::Marquee { marquee, .. } => { let r = marquee.rect(); - cx.marching_ants(&[r.left_top(), r.right_top(), r.right_bottom(), r.left_bottom()], true); + marquee_fill(_draw, cx, r); } Gesture::Move { .. } | Gesture::Idle => {} } @@ -411,9 +411,6 @@ struct OverlayField { selected: bool, } -/// How much of the accent the prepare overlay's field fill keeps over the page. -const FIELD_FILL_SHARE: f32 = 89.0 / 255.0; - /// The fields of one page with their fill, outline, selection and name tags, and the tab-order /// badges while they are on. A field being moved is drawn at the moved place. #[derive(Component, Props)] @@ -507,11 +504,13 @@ impl Component for PrepareOverlay { let colors = &cx.tokens.color; PrepareOverlayStyle { metrics: Metrics::new(), + // Production tints a field over the page with the accent at about a third, not the soft surface (dark navy). fill: cx.color(colors.accent.solid), outline: cx.color(colors.line.control_edge), selected: cx.color(colors.accent.solid), - tag: cx.color(colors.text.normal), - tag_text: cx.color(colors.surface.sunken), + // Production's name tag: light text on a dark plate, over the light page. + tag: cx.color(colors.surface.sunken), + tag_text: cx.color(colors.text.normal), selected_tag: cx.color(colors.accent.solid), selected_tag_text: cx.color(colors.text.on_strong), badge: cx.color(colors.accent.solid), @@ -527,8 +526,7 @@ impl Component for PrepareOverlay { let draw = ui.draw(); for field in &self.fields { let r = field.rect; - // A tint of the accent over the page, as production's (89/255), so the page shows through. - draw.faded(FIELD_FILL_SHARE, |draw| draw.fill(&PaintShape::Rect(r, CornerRadius::ZERO), style.fill)); + draw.faded(89.0 / 255.0, |draw| draw.fill(&PaintShape::Rect(r, CornerRadius::ZERO), style.fill)); if !field.selected { draw.stroke(&PaintShape::Rect(r, CornerRadius::ZERO), StrokeWidth::Thin, style.outline); } @@ -563,3 +561,12 @@ impl Component for PrepareOverlay { cx.response.clone() } } + +/// A marquee as production draws it: the accent over the page at about a quarter, with a solid accent edge. +pub(crate) fn marquee_fill(draw: &Draw<'_>, cx: &ToolContext<'_>, r: Rect) { + let Some(style) = cx.style() else { return }; + let shape = PaintShape::Rect(r, CornerRadius::ZERO); + let accent = style.color(style.tokens.color.accent.solid); + draw.faded(0.3, |draw| draw.fill(&shape, accent)); + draw.stroke(&shape, StrokeWidth::Thin, accent); +} From b533521af98a9226164c3dfac744ac9a43f8b464 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sun, 22 Nov 2026 04:58:56 -0500 Subject: [PATCH 2/4] Combine preview counts and numbers the pages the range adds (Page 1 of 3) --- .../src/workflows/combine_grid/card.rs | 37 ++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/workflows/combine_grid/card.rs b/crates/ui-egui/src/workflows/combine_grid/card.rs index fa027a0840..ae3140db2a 100644 --- a/crates/ui-egui/src/workflows/combine_grid/card.rs +++ b/crates/ui-egui/src/workflows/combine_grid/card.rs @@ -263,6 +263,39 @@ impl PageSource for FilePages { } } +/// The pages a file adds as the preview's whole document: it counts and numbers them 1..n as the production +/// preview does ("Page 1 of 3" for a range of three), where `pages` maps each one to its page in the file. +struct RangePages<'a> { + inner: &'a FilePages, + pages: &'a [usize], +} + +impl ThumbSource for RangePages<'_> { + fn revision(&self, page: &usize, request: &ThumbRequest) -> Revision { + match self.pages.get(*page) { + Some(real) => self.inner.revision(real, request), + None => Revision::of(&u8::MAX), + } + } + + fn render(&self, page: &usize, request: &ThumbRequest) -> ThumbRender { + match self.pages.get(*page) { + Some(real) => self.inner.render(real, request), + None => ThumbRender::Blank, + } + } +} + +impl PageSource for RangePages<'_> { + fn page_count(&self) -> usize { + self.pages.len() + } + + fn page_size(&self, page: usize) -> Size { + self.pages.get(page).map_or_else(|| Size::new(612.0, 792.0), |real| self.inner.page_size(*real)) + } +} + /// The file a tile's Preview opened, shown large over the window: one of the pages it adds at a time, /// stepped with the buttons or the keys; Escape or Close closes it. It closes by itself when the file /// leaves the list, is locked again or has nothing to show. @@ -302,7 +335,9 @@ pub(crate) fn preview(app: &mut PdfCraftApp, ui: &mut egui::Ui) { documents: app.combine_tab.open_documents.clone(), }; let mut at = p.at; - let shown = PagePreview::new(&source, &pages, &mut at, DataColor::new(egui::Color32::WHITE)).show(ui); + let numbered: Vec = (0..pages.len()).collect(); + let ranged = RangePages { inner: &source, pages: &pages }; + let shown = PagePreview::new(&ranged, &numbered, &mut at, DataColor::new(egui::Color32::WHITE)).show(ui); p.at = at; p.page = pages.get(at).copied(); if shown.closed { From db8a0b656e9102d9aab047cc70189e3fae97d300 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sun, 22 Nov 2026 05:05:22 -0500 Subject: [PATCH 3/4] Space Audit: the explanation sits under the title without the repeated row label; save conflict prompt in production's words and buttons --- crates/ui-egui/src/editing/save.rs | 12 +++++- crates/ui-egui/src/workflows/optimize_ui.rs | 47 ++++++++++++--------- 2 files changed, 37 insertions(+), 22 deletions(-) diff --git a/crates/ui-egui/src/editing/save.rs b/crates/ui-egui/src/editing/save.rs index d7aea74624..881764b63b 100644 --- a/crates/ui-egui/src/editing/save.rs +++ b/crates/ui-egui/src/editing/save.rs @@ -179,7 +179,17 @@ impl PdfCraftApp { SaveStep::AskChangedOnDisk { key, .. } => { // The file on disk is another version than the document came from (#2166). let name = self.session.get(key).map(|d| d.name.clone()).unwrap_or_default(); - let prompt = crate::dialogs::host::open(self, StandardPrompt::changed_on_disk(name)); + // Production's wording and buttons: Save anyway is an ordinary answer, not a red Replace. + let message = crate::i18n::fmt( + tl!("“{name}” changed on disk after it was opened or last saved. Saving now replaces that newer version with this one."), + &[("name", &name)], + ); + let prompt = StandardPrompt::custom(message) + .title(tl!("Save over the changed file?").to_string()) + .button(PromptChoice::Proceed, tl!("Save anyway").to_string()) + .button(PromptChoice::Alternate, tl!("Save as…").to_string()) + .button(PromptChoice::Cancel, tl!("Cancel").to_string()); + let prompt = crate::dialogs::host::open(self, prompt); if let Some(pending) = self.pending_save.as_mut().filter(|p| p.key == key) { pending.prompt = Some(prompt); } diff --git a/crates/ui-egui/src/workflows/optimize_ui.rs b/crates/ui-egui/src/workflows/optimize_ui.rs index ce388d8629..2210d27f52 100644 --- a/crates/ui-egui/src/workflows/optimize_ui.rs +++ b/crates/ui-egui/src/workflows/optimize_ui.rs @@ -9,9 +9,10 @@ use std::sync::{Arc, Mutex, PoisonError, RwLock}; use craft::behavior::{ColumnKey, ColumnWidth, DisplayOrder, ItemSource}; use craft::host::queue::{JobQueue, Priority}; -use craft::ui::contract::{Bind, ColumnSpec, Props as _, SelectMode, Show as _, ShowCollection as _, Sizing}; +use craft::ui::contract::{Bind, ColumnSpec, Props as _, SelectMode, Show as _, ShowCollection as _, ShowContainer as _, Sizing}; use craft::ui::dialog::{DialogResult, dialog_id}; use craft::ui::display::Text; +use craft::ui::layout_components::Stack; use craft::ui::list::ListRow; use craft::ui::patterns::form_dialogs::{DialogFields, FieldValue, HostedParamDialog, Param, ParamDialog, ParamKind, ParamTab, SharedRows}; use craft::ui::table::Table; @@ -499,27 +500,31 @@ impl ItemSource for AuditRows<'_> {} fn audit_row(rows: Arc>>) -> Param { Param::custom("space-audit", tl!("Space Audit"), move |ui, _fields, _cx| { let lines = audit_lines(&rows.read().unwrap_or_else(PoisonError::into_inner)); - Text::new(tl!("What takes up the space in this file, by kind of content.")).show(ui); - let columns = vec![ - ColumnSpec::new(DESCRIPTION, tl!("Description"), ColumnWidth::Content), - ColumnSpec::new(BYTES, tl!("Bytes"), ColumnWidth::Content).numeric(), - ColumnSpec::new(PERCENTAGE, tl!("Percentage"), ColumnWidth::Content).numeric(), - ]; - Table::::new(tl!("Space Audit"), columns) - .select(SelectMode::None) - .sizing(Sizing::Content) - .natural_height(true) - .striped(true) - .show_items(ui, &AuditRows(&lines), &mut |at, icx| { - let Some(line) = lines.get(*at) else { return ListRow::new("") }; - ListRow::new(line.description.clone()) - .cells(icx.cells()) - .striped(icx.row.striped) - .cell(BYTES, line.bytes.clone()) - .cell(PERCENTAGE, line.percentage.clone()) - }) - .response + let shown = Stack::new().fill_width().show(ui, |ui, _| { + Text::new(tl!("What takes up the space in this file, by kind of content.")).show(ui); + let columns = vec![ + ColumnSpec::new(DESCRIPTION, tl!("Description"), ColumnWidth::Content), + ColumnSpec::new(BYTES, tl!("Bytes"), ColumnWidth::Content).numeric(), + ColumnSpec::new(PERCENTAGE, tl!("Percentage"), ColumnWidth::Content).numeric(), + ]; + Table::::new(tl!("Space Audit"), columns) + .select(SelectMode::None) + .sizing(Sizing::Content) + .natural_height(true) + .striped(true) + .show_items(ui, &AuditRows(&lines), &mut |at, icx| { + let Some(line) = lines.get(*at) else { return ListRow::new("") }; + ListRow::new(line.description.clone()) + .cells(icx.cells()) + .striped(icx.row.striped) + .cell(BYTES, line.bytes.clone()) + .cell(PERCENTAGE, line.percentage.clone()) + }) + .response + }); + shown.inner.unwrap_or(shown.output) }) + .full_width() } /// The Space Audit row, for a dialog that shows the audit among other rows (Properties ▸ Space Audit): reads the app's shared From 21489c6f86150ed3b2150a70bdd34bbcf3ba29b9 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sun, 22 Nov 2026 05:08:01 -0500 Subject: [PATCH 4/4] Compare side by side: each half's notice bars lie within that half --- crates/ui-egui/src/workflows/compare_ui.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/workflows/compare_ui.rs b/crates/ui-egui/src/workflows/compare_ui.rs index 64cf04f30f..af0e173f6e 100644 --- a/crates/ui-egui/src/workflows/compare_ui.rs +++ b/crates/ui-egui/src/workflows/compare_ui.rs @@ -402,7 +402,10 @@ pub(crate) fn compare_area(app: &mut PdfCraftApp, old: usize, new: usize, ui: &m if let Some(v) = app.views.get_mut(index) { std::mem::swap(&mut v.view, state); } - let output = crate::canvas::document_area_at(app, index, rect, ui); + // Each half's notices lie within its own half: draw in a child ui bounded by the half. + let mut half_ui = ui.new_child(egui::UiBuilder::new().max_rect(rect).id_salt(("compare-half", index))); + half_ui.shrink_clip_rect(rect); + let output = crate::canvas::document_area_at(app, index, rect, &mut half_ui); if let Some(v) = app.views.get_mut(index) { std::mem::swap(&mut v.view, state); }