From d4df4646ee16e1e25f8bfb073d2d11a1c35a4772 Mon Sep 17 00:00:00 2001 From: Taha-Mahmoodi <85902429+Taha-Mahmoodi@users.noreply.github.com> Date: Tue, 20 Oct 2026 14:01:25 +0430 Subject: [PATCH] Build: the wasm check is warning-free; one file-dialog check instead of two - ui-egui: the font-install poll (#2576) only runs on native builds, but its timestamp field, its initializer and FONT_INSTALL_POLL were compiled for wasm too, where nothing read them. They're gated like the code that reads them. - engine: `Session::store_profile` is only called by the native Load Profile (cmd/colormgmt.rs); gated the same way. - app (macOS): `App::logic_frame` checked `!file_dialog_open()` twice, one `if` nested in an identical one, with the comment repeated. One check. `cargo xtask wasm` runs `cargo check` without `-D warnings`, so these warnings didn't fail CI; after this change it prints none. --- apps/vectorcraft/src/main.rs | 6 +----- crates/engine/src/store.rs | 1 + crates/ui-egui/src/lib.rs | 3 +++ 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/vectorcraft/src/main.rs b/apps/vectorcraft/src/main.rs index d3204c4ca..450d52b9b 100644 --- a/apps/vectorcraft/src/main.rs +++ b/apps/vectorcraft/src/main.rs @@ -144,11 +144,7 @@ impl App { // again on its document when it answers. #[cfg(target_os = "macos")] if !self.app.file_dialog_open() { - // Files from the Finder and the Dock wait while a file dialog is open: what asked for it runs - // again on its document when it answers. - if !self.app.file_dialog_open() { - open_files(&mut self.app, open_documents::take()); - } + open_files(&mut self.app, open_documents::take()); } self.app.logic(ctx); window::track(ctx, &mut self.app.ui.window); diff --git a/crates/engine/src/store.rs b/crates/engine/src/store.rs index 7e3a860a3..0e85391fc 100644 --- a/crates/engine/src/store.rs +++ b/crates/engine/src/store.rs @@ -204,6 +204,7 @@ impl Session { } /// Write the profile `name` (its file's `bytes`) to the store; `false` when it didn't go there. + #[cfg(not(target_arch = "wasm32"))] pub(crate) fn store_profile(&self, name: &str, bytes: &[u8]) -> bool { self.profile_dir.as_deref().is_some_and(|dir| put(dir, &format!("{}.{PROFILE_EXT}", file_stem(name)), bytes)) } diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 4a665906a..99fca2072 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -486,6 +486,7 @@ pub struct VectorcraftApp { /// the answer. font_check: Option<(std::sync::mpsc::Receiver, bool)>, /// When installed fonts were last checked in line (app time, s). + #[cfg(not(target_arch = "wasm32"))] font_install_check_at: f64, /// Keyboard pastes of something other than text (see [`shortcuts::PasteChord`]). pub(crate) paste_chord: shortcuts::PasteChord, @@ -535,6 +536,7 @@ struct PendingScreenshot { /// Seconds between two looks at the system clipboard for [`VectorcraftApp::system_paste`]. const SYSTEM_CLIPBOARD_POLL: f64 = 0.25; /// Seconds between looks for fonts a font manager activated while the app stays in front (#2576). +#[cfg(not(target_arch = "wasm32"))] const FONT_INSTALL_POLL: f64 = 2.0; impl VectorcraftApp { @@ -601,6 +603,7 @@ impl VectorcraftApp { picks: picks::Picks::default(), screen_sampler: None, font_check: None, + #[cfg(not(target_arch = "wasm32"))] font_install_check_at: f64::NEG_INFINITY, paste_chord: Default::default(), background: Default::default(),