From 53741bd1a119a2069fb36bef03d188ef6eaee383 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sat, 21 Nov 2026 13:08:36 -0500 Subject: [PATCH 1/4] Restore About link icon buttons --- crates/ui-egui/src/dialogs/about.rs | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/crates/ui-egui/src/dialogs/about.rs b/crates/ui-egui/src/dialogs/about.rs index ae60f3ce22..3655c17fd0 100644 --- a/crates/ui-egui/src/dialogs/about.rs +++ b/crates/ui-egui/src/dialogs/about.rs @@ -1,5 +1,6 @@ //! Help ▸ About: the framework's hosted About dialog over the app's info and the baked credits. +use craft::behavior::IconId; use craft::ui::patterns::form_dialogs::{AboutImage, AboutInfo, AboutLink, AboutTab, HostedAbout}; use crate::PdfCraftApp; @@ -13,7 +14,7 @@ const LOGO_WHITE: &[u8] = include_bytes!("../../../../docs/brand/artcraft-logo-w /// What the About tab shows: PdfCraft's name, blurb and version, the ArtCraft brand, and the community links. fn info() -> AboutInfo { - let mut info = AboutInfo::new( + let info = AboutInfo::new( "PdfCraft", tl!("A clean-room, open-source PDF application written in Rust. MIT OR Apache-2.0."), pdfcraft_engine::build_info::version(), @@ -21,12 +22,7 @@ fn info() -> AboutInfo { .mark(AboutImage::svg("ArtCraft", MARK)) .part_of(AboutImage::svg("ArtCraft", LOGO).dark(LOGO_WHITE)) .built_with("Rendering: hayro (bootstrap) · UI: egui · Icons: Lucide (ISC) · Fonts: Inter, JetBrains Mono, Dancing Script (OFL)"); - let (community, others): (Vec<&pdfcraft_engine::links::Link>, Vec<&pdfcraft_engine::links::Link>) = - pdfcraft_engine::links::LINKS.iter().partition(|l| l.url == pdfcraft_engine::links::DISCORD); - if let Some(l) = community.first() { - info = info.community(AboutLink::new(tl!(l.label).to_string(), l.url)); - } - info.links(others.into_iter().map(|l| AboutLink::new(tl!(l.label).to_string(), l.url))) + info.links(pdfcraft_engine::links::LINKS.iter().map(|l| AboutLink::new(tl!(l.label).to_string(), l.url).icon(IconId::new(l.icon)))) } impl PdfCraftApp { @@ -43,3 +39,16 @@ impl PdfCraftApp { self.open_url(&url); } } + +#[cfg(test)] +mod tests { + #[test] + fn about_community_links_keep_their_icons_and_destinations() { + let info = super::info(); + assert_eq!(info.links.len(), pdfcraft_engine::links::LINKS.len()); + for (shown, expected) in info.links.iter().zip(pdfcraft_engine::links::LINKS) { + assert_eq!(shown.url, expected.url); + assert_eq!(shown.icon, Some(craft::behavior::IconId::new(expected.icon))); + } + } +} From 2ca0cbb72a55a1dee158606b54278115a0684062 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sat, 21 Nov 2026 13:23:26 -0500 Subject: [PATCH 2/4] Restore page notice bars and Home icon --- crates/ui-egui/src/canvas/bars.rs | 4 ++-- crates/ui-egui/src/chrome.rs | 4 +++- crates/ui-egui/src/icons.rs | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/canvas/bars.rs b/crates/ui-egui/src/canvas/bars.rs index 377f0e99b2..0b6dd15953 100644 --- a/crates/ui-egui/src/canvas/bars.rs +++ b/crates/ui-egui/src/canvas/bars.rs @@ -49,9 +49,9 @@ pub(super) enum Notice { LockSignatures, } -/// One inline notice with the icon named `icon`. +/// One page notice bar with the icon named `icon`. fn bar(tone: Tone, icon: &'static str, text: String) -> Bar<'static> { - Bar::new(tone, text).layout(NoticeLayout::Inline).icon(NoticeIcon::Custom(IconId::new(icon).into())) + Bar::new(tone, text).layout(NoticeLayout::Bar).icon(NoticeIcon::Custom(IconId::new(icon).into())) } /// The notices above the pages, one after another: a file changed on disk first, then what a historical diff --git a/crates/ui-egui/src/chrome.rs b/crates/ui-egui/src/chrome.rs index 79a5b5901e..ff01e2afed 100644 --- a/crates/ui-egui/src/chrome.rs +++ b/crates/ui-egui/src/chrome.rs @@ -18,6 +18,8 @@ pub(crate) mod doc_tabs; mod mode_bar; pub(crate) mod view_rail; +pub(crate) const HOME_ICON: &str = "home"; + /// Compose the window: title bar, mode bar, view rail and the dock, whose document panel holds the /// pages. /// @@ -100,7 +102,7 @@ fn title_bar(app: &mut PdfCraftApp, ui: &mut egui::Ui) { title, |ui, _| { let home = app.active.is_none() && !app.combine_showing(); - if IconButton::new(IconId::new("house")).label(tl!("Home")).selected(home).show(ui).clicked() { + if IconButton::new(IconId::new(HOME_ICON)).label(tl!("Home")).selected(home).show(ui).clicked() { app.active = None; app.combine_tab.focused = false; } diff --git a/crates/ui-egui/src/icons.rs b/crates/ui-egui/src/icons.rs index 50f84f992d..9b9e055285 100644 --- a/crates/ui-egui/src/icons.rs +++ b/crates/ui-egui/src/icons.rs @@ -147,6 +147,7 @@ mod tests { let missing: Vec = engine_icons().into_iter().filter(|(_, name)| !has_icon(&IconId::new(name))).map(|(owner, name)| format!("{owner}: {name}")).collect(); assert!(missing.is_empty(), "icons nobody has: {missing:?}"); + assert!(has_icon(&IconId::new(crate::chrome::HOME_ICON)), "the title bar Home icon resolves"); // The eight documents the comment tools name stay served. for name in ["message-square-plus", "type", "highlighter", "move-right", "message-square-quote", "message-square-text", "replace", "paperclip"] From a5a4b069361a823f292bcd92dbd6339685db50dc Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sat, 21 Nov 2026 13:31:00 -0500 Subject: [PATCH 3/4] Register signature status icons --- crates/ui-egui/src/icons.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/ui-egui/src/icons.rs b/crates/ui-egui/src/icons.rs index 9b9e055285..9e1764559c 100644 --- a/crates/ui-egui/src/icons.rs +++ b/crates/ui-egui/src/icons.rs @@ -28,7 +28,9 @@ const ICONS: &[(&str, &[u8])] = &[ icon!("braces"), icon!("camera"), icon!("check-circle-2"), + icon!("circle-check"), icon!("circle-help"), + icon!("circle-x"), icon!("clipboard-paste"), icon!("clock-3"), icon!("cloud-upload"), @@ -99,6 +101,7 @@ const ICONS: &[(&str, &[u8])] = &[ icon!("text-cursor-input"), icon!("text-select"), icon!("trash-2"), + icon!("triangle-alert"), icon!("type"), icon!("user-round"), icon!("wrench"), @@ -148,6 +151,9 @@ mod tests { engine_icons().into_iter().filter(|(_, name)| !has_icon(&IconId::new(name))).map(|(owner, name)| format!("{owner}: {name}")).collect(); assert!(missing.is_empty(), "icons nobody has: {missing:?}"); assert!(has_icon(&IconId::new(crate::chrome::HOME_ICON)), "the title bar Home icon resolves"); + for name in ["circle-check", "circle-x", "triangle-alert"] { + assert!(has_icon(&IconId::new(name)), "signature notice icon {name}"); + } // The eight documents the comment tools name stay served. for name in ["message-square-plus", "type", "highlighter", "move-right", "message-square-quote", "message-square-text", "replace", "paperclip"] From 116a29497ed198de823ae46fed6268d7edae1bb6 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sat, 21 Nov 2026 14:04:01 -0500 Subject: [PATCH 4/4] Restore Discord label in title bar --- crates/ui-egui/src/chrome.rs | 6 +++++- crates/ui-egui/tests/it/ui.rs | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/crates/ui-egui/src/chrome.rs b/crates/ui-egui/src/chrome.rs index ff01e2afed..4d2d0e8068 100644 --- a/crates/ui-egui/src/chrome.rs +++ b/crates/ui-egui/src/chrome.rs @@ -109,7 +109,11 @@ fn title_bar(app: &mut PdfCraftApp, ui: &mut egui::Ui) { doc_tabs::strip(app, ui, Place::Main); }, |ui, _| { - IconButton::command(IconId::new("messages-square"), "help.discord").show(ui); + Button::command("help.discord") + .label("Discord") + .icon(IconId::new("messages-square")) + .tooltip(tl!("Join the ArtCraft Discord")) + .show(ui); IconButton::command(IconId::new("circle-help"), "help.shortcuts").show(ui); let theme_button = IconButton::command(IconId::new(theme_icon), ThemeChoice::NextMode.command()).label(theme_label.clone()).show(ui); let opener = theme_button.response().clone(); diff --git a/crates/ui-egui/tests/it/ui.rs b/crates/ui-egui/tests/it/ui.rs index fe525af41c..eda90a4cce 100644 --- a/crates/ui-egui/tests/it/ui.rs +++ b/crates/ui-egui/tests/it/ui.rs @@ -713,7 +713,7 @@ fn tabs_shrink_to_fit_then_arrows_step_through_them_and_open_stays_in_sight() { } }); let open = h.get_by_label("Open…").rect(); - let discord = h.get_by_label("Join the ArtCraft Discord").rect(); + let discord = h.get_by_label("Discord").rect(); assert!(open.right() <= discord.left(), "Open {open:?} must not run under Discord {discord:?}"); let mut previous_right = f32::MIN; for i in 0..5 { @@ -728,7 +728,7 @@ fn tabs_shrink_to_fit_then_arrows_step_through_them_and_open_stays_in_sight() { h.state_mut().open_bytes(&ctx_h, &name(i), None, FIXTURE.to_vec()).unwrap(); } h.run_steps(6); - let (open, discord) = (h.get_by_label("Open…").rect(), h.get_by_label("Join the ArtCraft Discord").rect()); + let (open, discord) = (h.get_by_label("Open…").rect(), h.get_by_label("Discord").rect()); assert!(open.right() <= discord.left(), "Open {open:?} stays left of Discord {discord:?} with seven tabs"); for i in 0..13 { let ctx_h = h.ctx.clone(); @@ -736,7 +736,7 @@ fn tabs_shrink_to_fit_then_arrows_step_through_them_and_open_stays_in_sight() { } h.run_steps(4); let open = h.get_by_label("Open…").rect(); - let discord = h.get_by_label("Join the ArtCraft Discord").rect(); + let discord = h.get_by_label("Discord").rect(); assert!(open.left() > 0.0 && open.right() <= discord.left(), "Open {open:?} stays in sight left of Discord {discord:?}"); }