fix(sheetset): read drawings off the UI thread

The wizard's folder scan, Import Layout as Sheet, the template layout
lists and the drawing cache behind Model Views, Place on Sheet, callout /
label blocks and block previews parsed whole DWGs on the UI thread. They
now go through the shared `background_task` worker: a cache miss reads the
drawing and handles the message that needed it again. Block previews lend
the cached drawing to the preview scene instead of cloning it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Hakan SevenandClaude Opus 5.5 committed 2026-10-06 09:33:04 +03:00
1 parent 40847d72a1
commit 3a5c1dbb7d
4 files changed
+305 -153

No files matched your search

+1 -1
View File
@@ -40,7 +40,7 @@ fn write_export(path: &std::path::Path, bytes: &[u8]) -> Result<(), String> {
/// reaches the UI thread: it is caught on the worker and re-surfaced as
/// [`Message::BackgroundTaskFailed`] so a crashing export or import reports
/// on the command line instead of killing the application.
pub(super) fn background_task<T, F, M>(context: impl Into<String>, work: F, map: M) -> Task<Message>
pub(in crate::app) fn background_task<T, F, M>(context: impl Into<String>, work: F, map: M) -> Task<Message>
where
T: Send + 'static,
F: FnOnce() -> T + Send + 'static,
+1
View File
@@ -96,6 +96,7 @@ mod blocks_palette;
mod dialog;
mod dynamic;
mod file;
pub(in crate::app) use file::background_task;
mod page_setup_import;
mod style;
pub(in crate::app) mod util;