Repository navigation
Report FluidRideauViewController dismissal once - #198
Conversation
A backdrop tap on a sheet in FluidStackController reported onWillDismiss and onDidDismiss twice. The tap pops the sheet with the Rideau removing transition. Rideau runs the move completion first, which removes the sheet and calls the pop completion, and only then reports `.hidden` to didMoveTo. The sheet is out of the stack by then, so the didMoveTo handler took the modal branch and called dismiss(animated:completion:), whose completion reported onDidDismiss again. A fluidPop() from outside the sheet received onDidDismiss only through that same branch. Each dismissal now has a single reporter. The Rideau removing transition reports onWillDismiss when it starts and onDidDismiss when it finishes, unless the removal is cancelled; this covers backdrop taps and fluidPop(). The modal dismiss transition reports onDidDismiss when it completes. The didMoveTo handler starts a dismissal only while the sheet is still presented, which is the swipe case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 654a4c2a1f
ℹ️ 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".
Reporting from the removing transition reported onDidDismiss on `.interrupted`, which fires twice when a second fluidPop() replaces a running removal, and before a re-push keeps the sheet. A removal that starts from fluidPop() already behaved correctly before: the handler reported once after Rideau finished the move and the sheet had left. Keep that behavior and make it explicit. The didMoveTo(.hidden) handler is the only reporter. A swipe arrives while the sheet is presented, so the handler removes it first; a removing transition arrives after the removal, so the handler only reports, instead of calling dismiss(animated:completion:) on a sheet that is not presented. A backdrop tap no longer reports by itself, and the modal transitioning delegate no longer reports onWillDismiss a second time. The removing and modal dismiss transitions are back to their previous code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
A backdrop tap on a
FluidRideauViewControllerin aFluidStackControllerreportedonWillDismissandonDidDismisstwice. Callers that run work inonDidDismiss, such as advancing a list or resuming a continuation, ran that work twice.Cause
The tap reported the dismissal itself and then popped the sheet with the
.rideauremoving transition, which moves the sheet to.hidden. When that move finishes, Rideau calls the move completion first and then reports.hiddentodidMoveTo:fluidStackContextbecomesnil, and the tap's pop completion reportsonDidDismiss.didMoveTo(.hidden)handler then reportsonWillDismissagain.isInFluidStackControlleris nowfalse, so it takes the modal branch and callsdismiss(animated:completion:)on a sheet that is not presented. UIKit still runs that completion, which reportsonDidDismissagain.A
fluidPop()from outside the sheet passes no completion, so it was reported only by step 2: once, after the sheet had left. That path also stays correct when the removal overlaps another transition. A secondfluidPop()or a cascade removal still ends with one report after the sheet leaves, and a re-push that keeps the sheet never reaches.hidden, so nothing is reported.Change
The
didMoveTo(.hidden)handler is now the only reporter, and it reports explicitly instead of relying on thedismiss(animated:completion:)call:onWillDismiss, removes the sheet, and reportsonDidDismisswhen the removal completes. This is unchanged.fluidPop(), arrives after the removal has finished. The handler reportsonWillDismissandonDidDismissright away.onWillDismiss, which a modal swipe reported twice.The removing transition and the modal dismiss transition keep their existing code.
onWillDismiss×2,onDidDismiss×2fluidPop()from outsidefluidPop()during a removalonWillDismiss×2onWillDismissfor a backdrop tap now comes when the sheet has left, as it already did forfluidPop(), instead of at the tap.Validation
fluidPush(_:target:)whose caller advances a list inonDidDismiss:onDidDismisswas reported once and the list advanced by one item. Before this change, the same steps reported it twice.onDidDismisswas not reported, as before.git diff --check origin/mainpassed.Not checked at runtime: overlapping removals, re-push during a removal,
fluidPop()from outside the sheet, and modal presentation. Those rows of the table follow from the code.FluidStackRideauSupporthas no unit tests.🤖 Generated with Claude Code