Skip to content

fix(mobile): reopen the model picker after an iOS sheet swipe - #11758

Closed
derektrimm wants to merge 1 commit into
pingdotgg:mainfrom
derektrimm:fix/mobile-settings-sheet
Closed

derektrimm wants to merge 1 commit into
pingdotgg:mainfrom
derektrimm:fix/mobile-settings-sheet

Conversation

@derektrimm

@derektrimm derektrimm commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

What Changed

The model and effort sheet latched open after an iOS form-sheet swipe dismiss, because the presenting screen often never refocuses. Treat the navigation stack as the source of truth so a later tap can open the picker again.

Opening reconciles from the stack (presented && !routeVisible) before the isActive latch, so a fast double-tap during the normal open window does not wipe the keyboard-restore flag.

Why

iOS form sheets often keep the presenting screen focused, so a swipe dismiss never re-runs useFocusEffect. JS then thinks the picker is still open and later model/effort taps no-op. The navigation stack is the fact that actually changed.

UI Changes

Native iOS settings sheet presentation. No screenshots: the failure is a tap that does nothing after a swipe dismiss.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Summary by CodeRabbit

  • Bug Fixes

    • Improved reliability when dismissing thread settings sheets with an iOS swipe gesture.
    • Settings controls now correctly reflect dismissal and can be reopened without getting stuck.
  • Tests

    • Added coverage for settings sheet route detection and swipe-dismissal scenarios.

The model and effort sheet latched open after an iOS form-sheet swipe
dismiss, because the presenting screen often never refocuses. Treat the
navigation stack as the source of truth so a later tap can open the
picker again.
@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Sep 14, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at aa02e09

Macroscope's review found this PR approvable — This is a narrowly scoped mobile bug fix that reconciles stale model-picker state with the navigation stack after an iOS sheet swipe. It adds no new capability or cross-cutting infrastructure and includes focused unit coverage for the state logic.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 89d9b39d-ac1c-41a2-9a48-c38c8d5caa86

📥 Commits

Reviewing files that changed from the base of the PR and between ec5ede5 and aa02e09.

📒 Files selected for processing (4)
  • apps/mobile/src/features/threads/NewTaskDraftScreen.tsx
  • apps/mobile/src/features/threads/ThreadComposer.tsx
  • apps/mobile/src/features/threads/thread-settings-sheet-presentation-state.test.ts
  • apps/mobile/src/features/threads/thread-settings-sheet-presentation-state.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

The change adds navigation-stack helpers and uses them in both thread settings entry points. Navigation state and transition events now reconcile dismissed settings sheets, reset presentation latches, and allow subsequent openings.

Changes

Settings sheet route reconciliation

Layer / File(s) Summary
Presentation state helpers
apps/mobile/src/features/threads/thread-settings-sheet-presentation-state.ts, apps/mobile/src/features/threads/thread-settings-sheet-presentation-state.test.ts
Added helpers that detect route presence and sheet dismissal. Added tests for matching, missing, undefined, and visibility states.
New task draft reconciliation
apps/mobile/src/features/threads/NewTaskDraftScreen.tsx
Added route synchronization before opening settings and after navigation state or transition events. Updated both settings controls to use the synchronized opener.
Thread composer reconciliation
apps/mobile/src/features/threads/ThreadComposer.tsx
Added route synchronization before opening settings and after navigation state or transition events. The dismissal path clears local and route presentation state.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Suggested reviewers: juliusmarminge

Merge Risk: ⚪ Minimal · up to aa02e

No confirmed issue blocks merging this settings-sheet reconciliation change.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the primary mobile fix: reopening the model picker after an iOS sheet swipe dismissal.
Description check ✅ Passed The description includes the required What Changed, Why, UI Changes, and Checklist sections. It explains the dismissal bug, the navigation-stack solution, and the rapid-tap behavior. The requested scr…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@juliusmarminge

juliusmarminge commented Sep 15, 2026

Copy link
Copy Markdown
Member

Am I misunderstanding what this PR fixes cause I can't reproduce the bug, by either swiping from the header, the sheet body or pressing Cancel or Done?

ScreenRecording_09-15-2026.10-31-14_1.MP4

@derektrimm

derektrimm commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

Closing this. Julius's recording shows the model picker still opening after swipe, Cancel, and Done, so this isn't the failure on device.

I also can't get Thread Settings to open on an iPhone 14 Pro Max (iOS 26.7): tapping GPT-6-Astra hits the composer (iOS shows Paste/AutoFill) instead of the model control.

The tap-through fix is @juliusmarminge #11944

The prompt-clipping issue stays on #11757

@derektrimm derektrimm closed this Sep 15, 2026
@juliusmarminge

Copy link
Copy Markdown
Member

I am on a newer version so lets hope your issues are fixed as well in the next release (hopefully tonight or tomorrow)

@derektrimm

derektrimm commented Sep 16, 2026

Copy link
Copy Markdown
Contributor Author

I am on a newer version so lets hope your issues are fixed as well in the next release (hopefully tonight or tomorrow)

Sounds good, I'll keep an eye out. I did just update to iOS 27 to see if that fixed it, and the issue is still there. Strange because it looks like it isn't affecting you. I included a recording in #11944

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants