Skip to content

fix(ios): preserve PR drafts across related-file navigation - #446

Merged
BunsDev merged 1 commit into
mainfrom
fix/ipad-pr-review-navigation
Sep 12, 2026
Merged

fix(ios): preserve PR drafts across related-file navigation#446
BunsDev merged 1 commit into
mainfrom
fix/ipad-pr-review-navigation

Conversation

@BunsDev

@BunsDev BunsDev commented Sep 12, 2026

Copy link
Copy Markdown
Member

Scope

Related to #200 and #213; this narrow remediation does not close either outcome or mutate a managed mirror. Do not merge as part of this task.

Base: 2413314c787b0f592874fc6c1f5cfbe958925fc5
Reviewed and validated head: 2a437b1b5b7ecf336410d87573e54e8246bd25ae
Branch: fix/ipad-pr-review-navigation

Two distinct problems were observed:

  • testPullRequestReviewSupportsEditingAndRelatedFileNavigation used the first button across all navigation bars. On regular-width iPad this did not return to the PR form. Scoping to the related file's App.swift navigation bar made the original test pass without production changes.
  • Extending that test to edit, navigate to the file again, and compare both fields exactly exposed a production defect: both edited fields reverted to generated defaults. onChange(initial: true) initialized drafts on the disappearing Form. Moving the existing request-ID observer to the enclosing NavigationStack preserves drafts across pushes/pops and retains initialization for new requests.

The regression verifies exact original title/body after the first round trip and exact edited title/body after the second. Both idioms execute the same assertions without skips. No sleeps, raw hierarchy printing, new accessibility hooks, protocol changes, generated project edits, or weakened preservation assertions.

Reproduction and observed results

Local toolchain: Xcode 26.6, build 17F113, iOS Simulator 26.5. This is not the pinned Xcode 26.2 / build 17C52 / iOS 26.2 CI proof.

Source / experiment Destination Observed result
Unchanged base, exact focused UI method iPad Pro 13-inch M4 Failed: title/body missing after unscoped back tap; 3 failures
Only scope back navigation to related-file bar Same iPad Original method passed
Strengthened preservation assertions, before production fix Same iPad Both edited title/body reset to defaults; exposed actual draft loss
Final production fix, clean build, focused UI method Same iPad Passed
Exact committed head: 4 UI methods plus ActionSheetPresentationTests Same iPad 4 UI + 22 unit tests passed, zero failures
Exact committed head: same selectors iPhone 16 Pro 4 UI + 22 unit tests passed, zero failures
Exact committed head: full repository source gate macOS, iOS opt-in disabled Passed

An initial combined two-destination invocation stalled before test output with both task simulators shut down. It was stopped, not counted as a pass. Explicitly booting the task-owned simulators and running one destination per invocation produced the results above.

Commands

All build/test commands ran from the reused clean checkout, on the branch above. The following are the exact build/test arguments; routine build output was filtered rather than published.

Task-owned simulator creation:

xcrun simctl create psyche-ipad-pr-review-f1bbdaf5 com.apple.CoreSimulator.SimDeviceType.iPad-Pro-13-inch-M4-8GB com.apple.CoreSimulator.SimRuntime.iOS-26-5
xcrun simctl create psyche-iphone-pr-review-f1bbdaf5 com.apple.CoreSimulator.SimDeviceType.iPhone-16-Pro com.apple.CoreSimulator.SimRuntime.iOS-26-5

Allocated destinations were F54851A5-F75E-43F3-A362-D0DF0C9AC6EF (iPad) and F9745C92-3C85-4231-81B8-1D1DB8CF2371 (iPhone).

Baseline and selector-isolation reproduction:

xcodebuild test -project native/ios/Psyche.xcodeproj -scheme PsycheApp -destination 'platform=iOS Simulator,id=F54851A5-F75E-43F3-A362-D0DF0C9AC6EF' -derivedDataPath /tmp/psyche-ipad-pr-review-f1bbdaf5 -parallel-testing-enabled NO -only-testing:PsycheAppUITests/PsycheAppUITests/testPullRequestReviewSupportsEditingAndRelatedFileNavigation CODE_SIGNING_ALLOWED=NO

The final focused production-fix run used the identical arguments with xcodebuild clean test.

Final committed-head iPad run:

xcodebuild test -project native/ios/Psyche.xcodeproj -scheme PsycheApp -destination 'platform=iOS Simulator,id=F54851A5-F75E-43F3-A362-D0DF0C9AC6EF' -derivedDataPath /tmp/psyche-ipad-pr-review-f1bbdaf5 -parallel-testing-enabled NO -only-testing:PsycheAppUITests/PsycheAppUITests/testPullRequestReviewSupportsEditingAndRelatedFileNavigation -only-testing:PsycheAppUITests/PsycheAppUITests/testPullRequestCanBeCancelledFromConfirmationAndReview -only-testing:PsycheAppUITests/PsycheAppUITests/testRenamingAPaneUsesTheRemoteActionSheet -only-testing:PsycheAppUITests/PsycheAppUITests/testMergeWorkflowHandlesSiblingAndFallbackConfirmationsBeforeSuccess -only-testing:PsycheAppTests/ActionSheetPresentationTests CODE_SIGNING_ALLOWED=NO

Final committed-head iPhone run:

xcodebuild test -project native/ios/Psyche.xcodeproj -scheme PsycheApp -destination 'platform=iOS Simulator,id=F9745C92-3C85-4231-81B8-1D1DB8CF2371' -derivedDataPath /tmp/psyche-ipad-pr-review-f1bbdaf5 -parallel-testing-enabled NO -only-testing:PsycheAppUITests/PsycheAppUITests/testPullRequestReviewSupportsEditingAndRelatedFileNavigation -only-testing:PsycheAppUITests/PsycheAppUITests/testPullRequestCanBeCancelledFromConfirmationAndReview -only-testing:PsycheAppUITests/PsycheAppUITests/testRenamingAPaneUsesTheRemoteActionSheet -only-testing:PsycheAppUITests/PsycheAppUITests/testMergeWorkflowHandlesSiblingAndFallbackConfirmationsBeforeSuccess -only-testing:PsycheAppTests/ActionSheetPresentationTests CODE_SIGNING_ALLOWED=NO
bash ./scripts/agent-check full
git diff --check

Review, preservation, and proof gaps

Independent read-only code-review agent reviewed the exact commit against its parent and reported no significant issues. The parent completed the runtime checks above. Protected-branch review and required terminal exact-head CI checks remain separate merge gates; no merge is authorized here.

The author checkout and its debug-only patch were left untouched, with matching before/after file digests. Root dirty .beads/interactions.jsonl also has matching before/after digests. No Beads mutations. The existing fix/operator-acceptance-preflight and fix/ipad-regular-width-ui-tests refs remain unchanged. No new worktree was created. The task checkout is clean.

Both uniquely task-created simulators were shut down and deleted by exact UUID. Task-derived build/test artifacts were removed; no raw app hierarchy, screenshots, prompts, personal paths, or unrestricted logs are retained in this PR.

These results establish fixture-driven simulator navigation/draft preservation only. Pinned-toolchain CI, the full iOS UI suite, physical iPad/iPhone acceptance, live-host PR submission, signing, TestFlight, and distribution are not claimed. No project generation was needed because only existing Swift sources changed.

Rollback: revert 2a437b1b5b7ecf336410d87573e54e8246bd25ae through a normal reviewed PR; no data migration, configuration, or protocol rollback is needed.

Scope UI-test return navigation to the related file navigation bar and verify original and edited title/body survive both round trips.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 12, 2026 07:02
@vercel

vercel Bot commented Sep 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
psyche-build-docs Ready Ready Preview Sep 12, 2026 7:02am UTC

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Focused validation passed, but pinned-toolchain CI and broader acceptance remain unverified.

Pull request overview

Preserves iOS pull-request drafts when navigating to related files and returning to the review form.

Changes:

  • Scopes related-file navigation to the correct navigation bar.
  • Moves draft initialization to the enclosing navigation stack.
  • Adds exact regression assertions for repeated navigation.
File summaries
File Description
native/ios/PsycheApp/Tests/PsycheAppUITests/PsycheAppUITests.swift Verifies draft preservation across related-file navigation.
native/ios/PsycheApp/Sources/PsycheApp/Views/ActionSheetView.swift Prevents draft resets when the form is recreated.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@BunsDev

BunsDev commented Sep 12, 2026

Copy link
Copy Markdown
Member Author

Independent final R3 review on exact head 2a437b1b5b7ecf336410d87573e54e8246bd25ae: no findings. Reviewed production draft lifecycle and identity boundaries alongside navigation regression coverage. Terminal exact-head checks passed, with no unresolved review threads. Local iPad/iPhone simulator evidence is recorded separately from pinned CI and is not physical-device or distribution acceptance. Proceeding through the normal protected merge path.

@BunsDev
BunsDev merged commit 25a9e1b into main Sep 12, 2026
11 checks passed
@BunsDev
BunsDev deleted the fix/ipad-pr-review-navigation branch September 12, 2026 07:20
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.

2 participants