Fix Home delete-failure alert cleared on confirmation dismissal#1131
Open
acorretti wants to merge 1 commit into
Open
Fix Home delete-failure alert cleared on confirmation dismissal#1131acorretti wants to merge 1 commit into
acorretti wants to merge 1 commit into
Conversation
The consolidated rootAlertBinding cleared all three Home alert states when SwiftUI wrote nil on dismissal. When a confirm action fails synchronously (dictation delete throws, failed-meeting delete returns false) it sets homeDeleteFailure inside the confirm closure, then SwiftUI dismisses the confirmation by writing nil, which wiped the just-set failure before it could present. - Dismiss only the active alert, routed through a new Foundation-pure HomeRootAlertPolicy.activeSlot. The confirmation outranks the failure, so dismissal clears the confirmation and the failure survives to present. - Defer presentHomeActionFailure so a failure raised inside a confirm action lands after the confirmation finishes dismissing; SwiftUI will not present a second alert mid-dismissal. - Add HomeRootAlertPolicyTests for the priority/dismissal behavior and a source-contract guard that the binding clears only the dismissed alert. Follow-up to r3dbars#1126 / codex-review.
Contributor
Author
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.
Why
Follow-up to #1126, which consolidated the three stacked Home
.alert(item:)into one sharedrootAlertBinding. codex-review flagged (and it shipped in the merge): the binding clears all three alert states whenever SwiftUI writes nil on dismissal. When a confirm action fails synchronously it setshomeDeleteFailureinside the confirm closure, then SwiftUI dismisses the confirmation by writing nil, which wipes the just-set failure before it can present. So a failed delete silently shows no error.Affected paths:
presentHomeDeleteFailure(...)in the confirm closure(The meeting-delete path fails asynchronously, after the alert is gone, which is why it wasn't caught at merge time.)
Product Impact
meetings,dictationmeeting reliabilityWhat changed
HomeRootAlertPolicy.activeSlot; the confirmation outranks the failure, so dismissal clears the confirmation and a freshly-set failure survives to present next.presentHomeActionFailureto the next runloop turn so a failure raised inside a confirm action lands after the confirmation finishes dismissing (SwiftUI won't present a second alert mid-dismissal).HomeRootAlertPolicyTestscovering the priority/dismissal, including the exact regression case (confirmation + failure both set → confirmation dismissed first, failure survives), plus a source-contract guard that the binding clears only the dismissed alert.How I checked it
scripts/dev/agent-preflight.sh.agents/test-matrix.yml(Sources/UI/**+ rootTests/*.swiftmap to build + fast tests)bash build.sh --no-openbash run-tests.sh(5413/5413)build.sh --no-openbundle gate: "Performance budget OK")bash run-integration-smoke.sh(N/A, noSources/Meeting/orSources/TranscriptedCore/changes)swift test(N/A, noPackage.swift/ core seam changes)HomeRootAlertPolicyTestsinstead.Risk Review
.agent-review/visuals/evidence (not attached; behavioral fix to alert sequencing with no visual change, and the live Home list shows private titles. Can add a cropped capture of the failure alert if wanted.)Notes