Add close_workflow button action#6753
Merged
Merged
Conversation
Ports RevenueCat/purchases-android#3453 to iOS. Adds a new `close_workflow` button action that always dismisses the entire paywall, regardless of workflow step or whether triggered from inside a sheet. The action flows through the existing pipeline: - `PaywallComponent.ButtonComponent.Action.closeWorkflow` (serialization) - `ButtonComponentViewModel.Action.closeWorkflow` (view model) - `closeWorkflowAction` environment key (set at RootView, propagates through sheets where local onDismiss only closes the sheet) - `ButtonComponentView` reads the env key and calls it on tap Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
facumenzella
commented
May 11, 2026
close_workflow button actionclose_workflow behavior without public API change
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e15b057. Configure here.
close_workflow behavior without public API changeclose_workflow button action (API-safe)
close_workflow button action (API-safe)close_workflow button action
vegaro
reviewed
May 11, 2026
The environment modifier must be outer to bottomSheet — views created inside BottomSheetOverlayModifier.body are siblings of content and only inherit from the modifier's outer context, not from inner modifiers on the content itself. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- ButtonComponentCodableTests: assert that close_workflow and navigate_back buttons with identical .action values are nonetheless unequal via isCloseWorkflowAction (Equatable and Hashable both verified) - ButtonComponentViewModelMappingTests (new file): assert that a decoded close_workflow button maps to .closeWorkflow in the view model (interaction value "close_workflow"), and navigate_back maps to .navigateBack Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…deproj Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Resolve xcodeproj conflict: ffa6c18 removed the RevenueCatUITests Sources build phase from RevenueCat.xcodeproj (target migrated to Tuist), so drop the ButtonComponentViewModelMappingTests.swift addition from that file — tests are picked up by the Tuist glob. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… xcodeproj Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
vegaro
reviewed
May 12, 2026
…flow, drop fragile hash assertion Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…aram from ComponentsView and RootView Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
vegaro
approved these changes
May 13, 2026
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
Ports purchases-android#3453 to iOS.
Supports the backend `close_workflow` button action for Paywalls V2 so it dismisses the entire paywall/workflow, including from nested contexts such as sheets, without introducing a source-breaking public API change.
Changes
isCloseWorkflowActionflag (testCloseWorkflowDecoding,testCloseWorkflowRoundTripsThroughEncoding)close_workflowandnavigate_backbuttons with the same.actionvalue are distinct viaisCloseWorkflowAction(testCloseWorkflowAndNavigateBackButtonsAreNotEqual)close_workflowcomponent maps to.closeWorkflowaction with correct interaction value (ButtonComponentViewModelMappingTests)Verification
Note
Medium Risk
Adds a new workflow dismissal path and custom decoding/encoding to preserve a backend-only action; mistakes could cause buttons to dismiss the wrong layer (step vs whole workflow) or regress component equality/telemetry.
Overview
Adds support for the backend
close_workflowbutton action in Paywalls V2 so a button can dismiss the entire workflow/paywall (even from nested contexts like sheets) rather than performing step back-navigation.This preserves API compatibility by decoding
"close_workflow"as public.navigateBackwhile storing an internalisCloseWorkflowActionflag, mapping it to a new internal view-model action (.closeWorkflow), and threading a top-levelcloseWorkflowActionthrough the SwiftUI environment (with warning logs when unhandled). Tests cover decoding/round-tripping, equality/hash behavior, interaction value mapping, and project integration.Reviewed by Cursor Bugbot for commit 467c8af. Bugbot is set up for automated code reviews on this repo. Configure here.