Rebuild workflow step states on color scheme change#3419
Merged
Conversation
This was referenced Apr 30, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3419 +/- ##
=======================================
Coverage 79.88% 79.88%
=======================================
Files 368 368
Lines 14858 14858
Branches 2042 2042
=======================================
Hits 11869 11869
Misses 2156 2156
Partials 833 833 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
1f8ba59 to
e72fe0f
Compare
5172165 to
3f6a88c
Compare
b935b86 to
241a0f1
Compare
b935b86 to
686d62d
Compare
3f6a88c to
85c4f32
Compare
This was referenced Apr 30, 2026
📸 Snapshot Test591 unchanged
🛸 Powered by Emerge Tools |
686d62d to
c9ac67b
Compare
1369710 to
ad0f28b
Compare
ad0f28b to
e342f98
Compare
0d10d7d to
e4bf0f4
Compare
607983a to
2bea6c5
Compare
e4bf0f4 to
6f01bee
Compare
2fcc54d to
297d4af
Compare
b743b96 to
feb1571
Compare
297d4af to
431642b
Compare
feb1571 to
0ed0730
Compare
31b4d2c to
10681c4
Compare
0ed0730 to
04bd9a7
Compare
0d843fa to
86df9e7
Compare
Contributor
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 c262c686c279428e72d7854484351b824842fdd4. Configure here.
…tting navigation Without this, a dark/light mode toggle while on a non-first workflow step would call updateState() which re-runs the full workflow setup and silently navigates the user back to step 1. rebuildWorkflowStepStates() clears the step cache and rebuilds from the current step, preserving the navigator's back-stack position. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Inject useWorkflowsEndpoint into PaywallViewModelImpl so tests can enable the workflow path without changing the BuildConfig constant. Two tests cover the fix in #3419: - refreshStateIfColorsChanged preserves current navigation step - refreshStateIfColorsChanged does not trigger updateState (call count guard) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
837a3bb to
8472463
Compare
facumenzella
approved these changes
May 13, 2026
facumenzella
left a comment
Member
There was a problem hiding this comment.
Looks good to me. Haven't tested it manually though
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.


Motivation
In a multi-step workflow paywall, toggling dark/light mode while on a non-first step would silently navigate the user back to step 1. The configuration change calls
updateState(), which re-runs the full workflow setup — including resettingWorkflowNavigatorto the initial step — instead of just rebuilding the cached step states for the new color scheme.Description
Introduces
rebuildWorkflowStepStates(), called from the configuration-change path instead ofupdateState()when the active paywall is a workflow. It:workflowStepStateCache.PaywallState.Loaded.Componentsagainst the new color scheme.WorkflowNavigator'scurrentStepIdandbackStackuntouched, so the user stays on the step they were on.Note
Medium Risk
Changes workflow paywall refresh behavior to rebuild step UI state in-place instead of reloading the workflow, which could impact navigation/state caching if edge cases exist. Covered by new unit tests that assert navigation position and network call count are preserved.
Overview
Fixes a workflow-paywall bug where changing the Compose
ColorScheme(e.g., dark/light toggle) could reset multi-step workflow navigation back to the initial step.When a workflow is active,
refreshStateIfColorsChangednow rebuilds workflow step states viarebuildWorkflowStepStates/buildWorkflowStates(clearing and repopulating the step cache using the current step) instead of callingupdateState()and re-fetching/resetting theWorkflowNavigator. Adds tests ensuring the current workflow step is preserved and thatawaitGetWorkflowis not called again on color refresh.Reviewed by Cursor Bugbot for commit 8472463. Bugbot is set up for automated code reviews on this repo. Configure here.