Keep measuring across rotation and programmatic transitions - #44
Merged
Conversation
While measuring is ON, the shield blocks tap-driven navigation, but two paths still trigger reload(): device rotation and programmatic transitions (timers, network-driven pushes). Both silently reset the toggle to OFF and tore down the overlay. Keep the measuring state on ViewMonitor itself (the launcher's isSelected dies with the button on every reload), and have reload() re-open the overlay against the new screen when measuring. Selection state is not carried over - it points at views of the previous screen. Also fix the launcher landing off screen after rotating back to portrait (reported on device, reproduced by the new rotation UI test: x=705 on a 390pt-wide window). orientationDidChange arrives before the window has resized, so reloading immediately lays everything out against the old bounds. Defer the reload one runloop turn so it uses post-resize geometry. Covered by three lifecycle unit tests (keep-ON + rescan, OFF stays OFF, stop() clears the flag) and a rotation UI test asserting the toggle stays ON, the launcher stays within the window, and the new orientation is re-scanned. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Same coverage as the SwiftUI example's UI tests, through the UIKit-only path (storyboard hierarchy, SceneDelegate startup): a measurement smoke test and the rotation test asserting measuring stays ON, the launcher stays within the window, and each orientation is re-scanned. The UI test bundle is generated by generate_project.rb like the rest of the project, added to the shared scheme's test action, lint scope, and the CI example job. Verifying rotation from inside the process is not an option: the UIDevice orientation KVC trick no longer rotates the interface on current iOS, so XCUIDevice rotation is the only faithful trigger. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Merged
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
reload()paths the input shield cannot block. Measuring now stays ON: the new screen is re-scanned and the overlay re-attached. Selection state (red border / distance reference) intentionally resets, since it points at views of the previous screenorientationDidChangearrives before the window resizes, so the reload now defers one runloop turn and lays out against post-resize geometrygenerate_project.rb, added to the shared scheme, lint scope, and the CI example job[Unreleased]changelog section, also recording the accessibility identifiers added in Add real-touch UI tests for the SwiftUI example #43Test plan
stop()clears the measuring flag (128 unit tests / 20 suites green)swiftlint --strict0 violations; both example apps build🤖 Generated with Claude Code