fix(wpf): make navigation lifecycle-safe - #8
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 482d407350
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| WorkflowLabel = "Run in progress"; | ||
| OnPropertyChanged(nameof(WorkflowLabel)); |
There was a problem hiding this comment.
Keep the workflow label accurate after a blocked close
When a user attempts to close the window during a restore, this permanently replaces the current label with Run in progress. Unlike the backup path, ConfirmViewModel completes or cancels the restore without navigating to another workspace, so nothing restores the label after RunCoordinator becomes idle and the shell continues to describe a finished run as active. Avoid changing the workspace label here, or restore it when the run ends.
Useful? React with 👍 / 👎.
| internal Task RefreshAsync(CancellationToken cancellationToken = default) | ||
| internal async Task RefreshAsync(CancellationToken cancellationToken = default) | ||
| { | ||
| cancellationToken.ThrowIfCancellationRequested(); |
There was a problem hiding this comment.
Prevent stale history refreshes from winning
Because Advanced history is a shared view model and its view calls RefreshAsync on every Loaded, navigating away and back while this background catalog scan is still running starts another scan. There is no serialization or generation check, so a slower earlier read can reach ApplySnapshots after the newer read and overwrite the collection with stale filesystem state, as well as clear the user's newer selection. Cancel, serialize, or version refreshes so only the latest invocation applies its result.
Useful? React with 👍 / 👎.
What changed
Why
The WPF shell could trap users in Compare, hide an active progress workspace behind Settings or About, and terminate a running operation when the sole window closed. Advanced history also existed without a route and performed its catalog read on the UI thread.
Impact
Navigation now preserves operation visibility and comparison ownership. The active-run close guard prevents accidental termination while keeping normal close behavior unchanged. Advanced history is reachable without blocking rendering on catalog I/O.
This is a stacked draft based on
feat/wpf-timeline-shelland should be reviewed after PR #7. It does not merge or modify PR #7.Validation
dotnet build src\WinRestoreKit.Tests\WinRestoreKit.Tests.csproj -c CodexVerify: 0 warnings, 0 errorsdotnet test src\WinRestoreKit.Tests\WinRestoreKit.Tests.csproj -c CodexVerify --no-build: 990 passed, 0 faileddotnet format ... --verify-no-changes --include <changed C# files>: 0 files require formattingThe isolated
CodexVerifyconfiguration was used because the user's active Debug session intentionally remained running and retained its executable lock.