feat(io): show loading overlay while opening CAD files
Big DWG/DXF files block the UI for seconds during parse + cache build, leaving the user wondering whether the app froze. Split the file-open flow into pick → load and show a modal overlay during the load: file name, size, phase label (Reading / Parsing / Building caches / Finalizing), animated indeterminate bar, and Cancel button. Phase is tracked via a shared AtomicU8 written by the loader thread and read by the overlay each frame. Cancel hides the overlay and discards the result; the parser thread runs to completion in the background since acadrust has no interrupt hook. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
288ccff95a
commit
586df77b2c
7 changed files with 369 additions and 19 deletions
|
|
@ -577,6 +577,12 @@ impl H7CAD {
|
|||
}
|
||||
};
|
||||
|
||||
let open_progress_layer: Element<'_, Message> = if let Some(p) = &self.opening {
|
||||
crate::ui::open_progress::view(p, iced::time::Instant::now())
|
||||
} else {
|
||||
iced::widget::Space::new().width(0).height(0).into()
|
||||
};
|
||||
|
||||
stack![
|
||||
main_ui,
|
||||
self.app_menu.view(),
|
||||
|
|
@ -584,7 +590,8 @@ impl H7CAD {
|
|||
scale_layer,
|
||||
dropdown_layer,
|
||||
layout_ctx_layer,
|
||||
viewport_ctx_layer
|
||||
viewport_ctx_layer,
|
||||
open_progress_layer,
|
||||
]
|
||||
.into()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue