feat(ui): shared in-canvas modal overlay; migrate About (Plan B)

Start Plan B — replace the daemon's pop-up OS windows with in-canvas
modal overlays so dialogs work identically on native (one main window)
and web (canvas only).

- New `ui::modal::modal(base, content, on_close)`: dims the view behind
  a backdrop that blocks clicks but does NOT dismiss, frames the content,
  and adds a top-right ✕ as the sole close affordance. Sizes to the
  content (no `Fill`), so dialogs shrink to fit.
- view_main stacks the active modal on top, so both run paths show it.
- Migrate About as the pilot: `about_open` bool + AboutOpen/AboutClose
  instead of an OS window; About's view shrinks to content.

Remaining dialogs migrate to the same pattern next. Native + 75 tests OK.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Opus 4.8 committed 2026-06-16 18:59:13 +03:00
1 parent 9d378a0533
commit e6213eafbb
6 files changed
+127 -21

No files matched your search

+4
View File
@@ -294,6 +294,8 @@ pub(super) struct OpenCADStudio {
color_pick_target: Option<ColorPickTarget>,
shortcuts_window: Option<window::Id>,
about_window: Option<window::Id>,
/// In-canvas About modal (Plan B: shared overlay instead of an OS window).
about_open: bool,
plugin_manager_window: Option<window::Id>,
/// New-release notification window — opened on startup when the
/// GitHub releases API reports a newer version than this build.
@@ -992,6 +994,7 @@ pub enum Message {
ShortcutsPanelClose,
// ── About window ────────────────────────────────────────────────────
AboutOpen,
AboutClose,
AboutCopyInfo,
// ── Plugin Manager window ───────────────────────────────────────────
PluginManagerOpen,
@@ -1413,6 +1416,7 @@ impl OpenCADStudio {
color_pick_target: None,
shortcuts_window: None,
about_window: None,
about_open: false,
plugin_manager_window: None,
update_notice_window: None,
assoc_prompt_window: None,