From 15249ed990f9e61b5c6550d18600468de6a0e2c3 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sat, 21 Nov 2026 12:38:16 -0500 Subject: [PATCH] Register app icons at startup --- crates/ui-egui/src/app.rs | 1 + crates/ui-egui/tests/it/ui.rs | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/crates/ui-egui/src/app.rs b/crates/ui-egui/src/app.rs index 401854b885..cb833b7c9a 100644 --- a/crates/ui-egui/src/app.rs +++ b/crates/ui-egui/src/app.rs @@ -203,6 +203,7 @@ impl PdfCraftApp { /// The app over `host` and `services`, with no document open: every queue runs on the host's /// jobs, so a test passes a host over `ManualJobs` and `ScriptedFiles`. pub fn with_host(host: Arc, services: AppServices) -> Self { + crate::icons::register(); let AppServices { wake, clipboard, diff --git a/crates/ui-egui/tests/it/ui.rs b/crates/ui-egui/tests/it/ui.rs index 5d62b01111..fe525af41c 100644 --- a/crates/ui-egui/tests/it/ui.rs +++ b/crates/ui-egui/tests/it/ui.rs @@ -44,6 +44,15 @@ fn home_shows_welcome_and_tools() { assert!(h.query_all_by_role_and_label(egui::accesskit::Role::Button, "Open…").count() >= 2, "Home offers Open"); } +/// Starting the app makes its Home and navigation rail icons available to the renderer. +#[test] +fn app_start_registers_its_icons() { + let _app = crate::control::new_app(); + for name in ["file-output", "code-xml", "message-square-text", "files", "text-cursor-input", "paperclip", "signature", "tag"] { + assert!(craft::ui::primitives::has_icon(&craft::behavior::IconId::new(name)), "missing icon {name}"); + } +} + /// A side string of the control state's `side_panels` (`tools_side`, `rail_side`). fn side(h: &mut Harness<'static, PdfCraftApp>, key: &str) -> String { pdfcraft_ui_egui::side_panels::state(h.state())[key].as_str().unwrap_or_default().to_owned()