Skip to content

feat(ui): keep the chart usable beside owned windows - #169

Merged
mrcsin merged 1 commit into
masterfrom
non-modal-windows
Nov 9, 2026
Merged

mrcsin merged 1 commit into
masterfrom
non-modal-windows

Conversation

@mrcsin

@mrcsin mrcsin commented Nov 9, 2026

Copy link
Copy Markdown
Member

Problem

The settings, export and pen editor windows opened with ShowDialog, so the chart could not be panned or read while one was open. Making them non-modal opens new paths: a second menu request, and a main-window close while the editor holds an unsaved edit, a save runs, or an export writes its partial file.

What changed

  • DialogOpener.ShowOrActivate opens the three windows with Show(owner). MainWindowViewModel keeps one open view model per kind in OpenViewModels; a second request re-emits it and reads nothing, and the view brings the window to the front, restoring it when minimised.
  • Windows/OwnedWindowClosing holds every close of a window, the owner's included, until that window's work ends: the editor's drain (IsIdle), SaveInFlight, or StopExport() deleting the partial file. It then closes the window or the owner that asked, and asks again on every close.
  • Escape closes each window, the editor after its drain. Exit and Restart start at most one copy (_isClosing). Leaving the editor still writes the pending edit once, now pinned by tests.
  • About and the settings window opened from the startup failure window stay modal. overview.md#the-owned-windows holds the rules, and AGENTS.md gates the single route.

Verification

  • SemiPlot.Tests.Unit: 2769 passed; the plan's acceptance filter 186 passed, each new hold test red with its guard removed.
  • dotnet format --verify-no-changes and dotnet terse clean.
  • The plan's Post-Completion lists the Win32-only checks (minimise with owner, file picker and calendar popup open during a main-window close).
Per-task commits before collapse
241a3b9 docs(plans): record the non-modal windows exec run
2abcd20 test(ui): read disposal through the shared probe
a79a1d1 docs(ui): address review findings
6106c8c fix(ui): address review findings
997757a docs(plans): record the acceptance run
9ed37ff docs(ui): describe the owned, non-modal windows
1d853ca test(ui): pin one write when the editor loses focus
e7bdbb4 feat(ui): close each owned window on Escape
3453cbc feat(ui): start one copy per main window close
95c8dbf feat(ui): hold every export close for its cancel
69801da feat(ui): hold every settings close for its save
fb34c0f feat(ui): hold every editor close for its drain
bc0c985 feat(ui): show the pen editor non-modally
698f373 feat(ui): show the export window non-modally
1bd9575 feat(ui): show the settings window non-modally
ba266d0 docs(plans): add the non-modal windows plan

🤖 Generated with Claude Code

The settings, export and pen editor windows opened modally, so the
chart could not be panned or read while one was open. They now open
as owned, non-modal windows, one of each kind per main window: a
second request brings the open one to the front, restoring it when
minimised. Escape closes each of them.

Every close of these windows, the main window's included, waits for
the window's own work: the pen editor's pending write, a running
settings save, or a cancelled export deleting its partial file. Then
it closes the window or the owner that asked. Exit and Restart now
start at most one copy. About and the settings window opened from the
startup failure window stay modal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mrcsin
mrcsin marked this pull request as ready for review November 9, 2026 15:28
@mrcsin
mrcsin merged commit 9a3412a into master Nov 9, 2026
2 checks passed
@mrcsin
mrcsin deleted the non-modal-windows branch November 9, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant