feat(RevenueCatUI): Tab selected-state (PWENG-65)#3664
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## alvarobrey/pweng-57-resolver #3664 +/- ##
=============================================================
Coverage 80.31% 80.31%
=============================================================
Files 384 384
Lines 15729 15729
Branches 2200 2200
=============================================================
Hits 12633 12633
Misses 2218 2218
Partials 878 878 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@cursor review |
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 a72ed0e. Configure here.
| style.stateUpdates?.takeIf { it.isNotEmpty() }?.let { updates -> | ||
| state.stateStore.applyUpdates(updates, payload = JsonPrimitive(selectedTabId)) | ||
| } | ||
| } |
There was a problem hiding this comment.
Hidden tabs skip store publish
Medium Severity
The LaunchedEffect that publishes the selected tab id via state_updates sits after if (!tabsState.visible) return, so it never runs when the tabs container is hidden. The paywall can still use selectedTabIndex and declaration defaults, but the store may never reflect the active tab id, so sibling components with state_condition overrides can stay on the wrong value.
Reviewed by Cursor Bugbot for commit a72ed0e. Configure here.
There was a problem hiding this comment.
Fixed in e67faeb. Moved the publish LaunchedEffect above the if (!tabsState.visible) return so a hidden tabs container still publishes its selected tab id. The store is already seeded with the tab key declared default at presentation, so the common case was covered, but this also handles the case where the initial selection (default_tab_id) differs from the declared default. Added a regression test (A hidden tabs component still publishes its selected tab id) where those two differ, so only the publish (not the seed) yields the expected value.
… hidden tabs still publishes
25b88d2 to
d4e83d3
Compare



WIP
Note
Medium Risk
Touches broad paywall override resolution and tab UX; behavior is additive with empty-store defaults, but incorrect state keys or updates could change visible paywall content.
Overview
Wires state-driven paywalls so tab selection can drive
state_conditionoverrides across the UI.Read path: Component state holders (carousel, icon, image, package, stack, tabs, text, timeline, video) now pass
PaywallStateStoresnapshots intoConditionContext(stateValues/stateDefaults) when resolving overrides, so components can react when store values change.Write path:
TabsComponentStylecarriesstateUpdatesand each tab has anid(from paywall JSON).TabsComponentViewuses aLaunchedEffecton the selected tab id to callstateStore.applyUpdateswith aPayloadReferencepayload (the tab id), seeding on first composition and updating on tab changes.Style factory maps
component.stateUpdatesandTabsComponentStyle.Tab(id, stack). Compose UI tests inTabStateTestscover override re-resolution and tab-click publishing.Reviewed by Cursor Bugbot for commit a72ed0e. Bugbot is set up for automated code reviews on this repo. Configure here.