Add safe recovery choices after resolution cancellation - #1237
Draft
AdvancedImagingUTSW wants to merge 4 commits into
Draft
Add safe recovery choices after resolution cancellation#1237AdvancedImagingUTSW wants to merge 4 commits into
AdvancedImagingUTSW wants to merge 4 commits into
Conversation
Reuse analysis: - Return movement uses Model.move_stage and the existing Stop Stage lifecycle. - Existing stage verification enforces the saved coordinates and configured limits. - No recovery-specific stage executor, limit validator, or stop API was added.
Reuse analysis: the dialog uses Navigate's existing PopUp, event queue, model thread pool, stage-control disablement, and Stop Stage lifecycle. It introduces no parallel movement or stop executor.
Reuse analysis: rejected and completed returns publish the existing resolution_return_complete event. Validation continues through each stage's existing strict verify_abs_position contract; no alternate limit or UI recovery path was added.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## kdean/issue-486-stop-resolution-change #1237 +/- ##
==========================================================================
+ Coverage 65.06% 65.24% +0.17%
==========================================================================
Files 191 192 +1
Lines 26829 26967 +138
==========================================================================
+ Hits 17456 17594 +138
Misses 9373 9373
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This stacked PR adds the explicit recovery decision requested for a cancelled resolution change:
Resolution Change Cancelleddialog only after the safety stop has quiesced the resolution worker;The core collision-prevention fix is intentionally isolated in draft PR #1236. This PR is based on that branch so reviewers can test and merge the safety stop independently from the optional recovery UX.
Related to #486.
Safety behavior
The saved position is copied into a private recovery snapshot tied to the cancelled task and selected microscope. A new resolution task invalidates any older snapshot. Return uses the existing cancellation-aware
Model.move_stage(..., wait_until_done=True)path and the existing Stop Stage lifecycle; it does not bypass device limit checks or create a second stage executor.The review pass also caught and fixed a stale-return edge case: if the saved position becomes unavailable between opening the dialog and selecting Return, the model refuses motion, emits a terminal failure event, and the controller re-enables ordinary stage controls.
Reuse analysis
Model.move_stage, strict stageverify_abs_position,PopUp, controller thread pool, and Stop Stage contracts.docs/superpowers/specs/2026-08-04-issue-486-resolution-change-cancellation-design.mddocs/superpowers/plans/2026-08-04-issue-486-resolution-change-cancellation.mdValidation
black --checkpassed on all recovery-modified Python files.ruff checkpassed on all recovery-modified Python files.test/model/test_model.pyandtest/model/test_microscope.pytests passed.git diff kdean/issue-486-stop-resolution-change --checkpassed.skimage/NumPy deprecation warning was emitted.Popup behavior is tested without constructing Tk locally. Although Homebrew Xvfb is installed, Navigate's current conda
_tkinterlinks to macOS AppKit rather than X11, so Xvfb cannot isolate a real window in this environment. Native Windows CI or Linux X11 Tk underxvfb-run -ashould perform the final constructed-window smoke check.Stack