Simplify WorkflowTransitionState with explicit from/to step fields#3441
Conversation
… fields Replace `visibleStepIds: Set<String>` with explicit `animatingFromStepId` and `animatingToStepId` fields. The set was redundant — its contents were always derivable from the from/to pair — and a vestige of an earlier "render all steps" design. Drop the unreachable parked-step branch in `applyWorkflowTransition` and remove the now-redundant `currentStepId` parameter from `workflowTransition`. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
WorkflowTransitionState with explicit from/to step fields
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3441 +/- ##
=======================================
Coverage 79.47% 79.47%
=======================================
Files 362 362
Lines 14547 14547
Branches 1977 1977
=======================================
Hits 11561 11561
Misses 2190 2190
Partials 796 796 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 67fadd3. Configure here.
| componentInteractionTracker = componentInteractionTracker, | ||
| ) | ||
| listOfNotNull(transitionState.animatingFromStepId, transitionState.animatingToStepId) | ||
| .forEach { stepId -> |
There was a problem hiding this comment.
List loses Set deduplication when from equals to
Low Severity
listOfNotNull(transitionState.animatingFromStepId, transitionState.animatingToStepId) can produce duplicate entries if a workflow step's trigger action points back to itself. The old Set-based approach naturally deduplicated this case, rendering the step only once. Now, two composables with the same key would be emitted, both matching the animatingToStepId branch in the when expression (checked first), causing both to animate in simultaneously — a visual glitch. Adding .distinct() to the list would restore the old defensive behavior.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 67fadd3. Configure here.
| clickHandler = clickHandler, | ||
| componentInteractionTracker = componentInteractionTracker, | ||
| ) | ||
| listOfNotNull(transitionState.animatingFromStepId, transitionState.animatingToStepId) |
There was a problem hiding this comment.
I guess this does mean we won't be supporting "peeking" into other pages... But that's probably ok for now.
There was a problem hiding this comment.
yeah, that's fine. I think at that point we should probably explore horizontal pagers
**This is an automatic release.** ## RevenueCat SDK ### 🐞 Bugfixes * fix: url encode query prameters (RevenueCat#3451) via Jacob Rakidzich (@JZDesign) ## RevenueCatUI SDK ### 🐞 Bugfixes * Fix: dismiss was called before onPurchaseComplete callback invocation (RevenueCat#3353) via Jacob Rakidzich (@JZDesign) * Propagate default package across workflow steps (RevenueCat#3431) via Cesar de la Vega (@vegaro) ### Paywallv2 #### ✨ New Features * feat: Allow disabling of automatic font scaling (RevenueCat#3438) via Jacob Rakidzich (@JZDesign) ### 🔄 Other Changes * Extract `PaywallComponentsImagePreDownloader` (RevenueCat#3448) via Cesar de la Vega (@vegaro) * Simplify `WorkflowTransitionState` with explicit from/to step fields (RevenueCat#3441) via Cesar de la Vega (@vegaro) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk release bookkeeping: primarily flips version strings from `10.5.0-SNAPSHOT` to `10.5.0` and updates docs/changelogs, with no functional code changes beyond the reported version constant. > > **Overview** > Cuts the `10.5.0` release by switching the project from `10.5.0-SNAPSHOT` to `10.5.0` across build metadata (`.version`, `gradle.properties`, sample/test app `libs.versions.toml`, and `Config.frameworkVersion`). > > Updates release artifacts and documentation pointers: CircleCI docs deploy now syncs the `10.5.0` docs folder to S3, `docs/index.html` redirects to `10.5.0`, and changelogs are rolled forward with the `10.5.0` entries in `CHANGELOG.md`/`CHANGELOG.latest.md`. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 48537d6. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->


Cleanup from a review comment on #3430.
visibleStepIds: Setwas redundant withanimatingFromStepId: String?: the set was always either{from, to}or{to}, derivable from the from/to pair. Replaced both with explicitanimatingFromStepId+animatingToStepId. This was there becuase I was attempting some performance improvements in other branch that used a set, but we are going with just from and to for now.Also dropped some dead code:
applyWorkflowTransition(vestige of an old "render all steps" design)currentStepIdparam ofworkflowTransition, now read offstate.animatingToStepIdNote
Medium Risk
Moderate risk because it changes which workflow steps are kept in composition and how slide translations are computed, which could cause visual/animation regressions if edge cases exist.
Overview
Simplifies workflow paywall transitions by removing
visibleStepIdsand makingWorkflowTransitionStateexplicitly trackanimatingFromStepIdandanimatingToStepId.Rendering now only composes the outgoing + incoming steps during a transition (via
listOfNotNull(from,to)), andworkflowTransitionno longer requirescurrentStepId, instead deriving positioning fromstate.animatingToStepId. Dead/unused “parked step” translation logic is removed.Reviewed by Cursor Bugbot for commit 67fadd3. Bugbot is set up for automated code reviews on this repo. Configure here.