PW-1178 | Support package-level visibility via visible property and overrides#3279
Merged
facumenzella merged 13 commits intomainfrom Apr 9, 2026
Merged
Conversation
…ides Mirrors khepri#18819 which adds `visible` and `overrides` to the Package and PartialPackage schema, allowing packages to be hidden by Rules. - Add `visible: Boolean?` and `overrides: List<ComponentOverride<PartialPackageComponent>>` to `PackageComponent` - Add `PartialPackageComponent` with `visible: Boolean?` - Add `PresentedPackagePartial` following the existing partial pattern - `PackageComponentStyle` now implements `PackageContext` and carries package-level `visible`, `overrides`, and `offerEligibility` - `PackageComponentState` evaluates overrides at render time - `PackageComponentView` gates rendering on the resolved visibility - `containsUnsupportedCondition` updated to check package overrides - Unit + UI tests for deserialization, style creation, and visibility behavior Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3279 +/- ##
==========================================
- Coverage 79.20% 79.20% -0.01%
==========================================
Files 352 352
Lines 14100 14104 +4
Branches 1940 1941 +1
==========================================
+ Hits 11168 11171 +3
Misses 2136 2136
- Partials 796 797 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 5e06e96. Configure here.
purchases/src/test/java/com/revenuecat/purchases/paywalls/components/PackageComponentTests.kt
Show resolved
Hide resolved
…ponentTests; document builder invariant in StyleFactory Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
vegaro
reviewed
Apr 9, 2026
...ui/src/main/kotlin/com/revenuecat/purchases/ui/revenuecatui/components/style/StyleFactory.kt
Outdated
Show resolved
Hide resolved
vegaro
reviewed
Apr 9, 2026
ui/revenuecatui/src/main/kotlin/com/revenuecat/purchases/ui/revenuecatui/data/PaywallState.kt
Outdated
Show resolved
Hide resolved
…d of defensive check The paywall builder already enforces that a default-selected package cannot be statically hidden. Documenting the invariant in a comment rather than duplicating the constraint in code. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
vegaro
reviewed
Apr 9, 2026
...ples/paywall-tester/src/main/java/com/revenuecat/paywallstester/ConfigurePurchasesUseCase.kt
Show resolved
Hide resolved
vegaro
reviewed
Apr 9, 2026
...ui/src/main/kotlin/com/revenuecat/purchases/ui/revenuecatui/components/style/StyleFactory.kt
Outdated
Show resolved
Hide resolved
Proxy URL, applicationId override, and network security config were local development settings that were unintentionally committed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…s always visible The paywall builder guarantees the default-selected package is never hidden, so tracking package visibility in PaywallState and reconciling selection away from hidden packages is unnecessary complexity. - Remove packageVisibility map, packagesEverVisible set - Remove setPackageVisible / clearPackageVisible / reconcileSelectedIfHidden - Remove LaunchedEffect / DisposableEffect from PackageComponentView - Remove reconciliation tests from VisibilityConditionTests PackageComponentView still gates rendering on packageState.visible so hidden packages are simply not rendered. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ding selected_package test - visible = null matches the partial component pattern (null = inherit from base, not-null = override). visible = true caused any future override partial to silently force visibility to true. - Self-hiding via selected_package override is not a valid config: a package hiding itself when selected would leave the selected purchase target invisible with no way to reconcile. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
vegaro
approved these changes
Apr 9, 2026
Member
vegaro
left a comment
There was a problem hiding this comment.
Makes sense! I haven't had the chance to test it manually but code looks good!
github-merge-queue bot
pushed a commit
that referenced
this pull request
Apr 9, 2026
**This is an automatic release.** ## RevenueCatUI SDK ### Paywallv2 #### 🐞 Bugfixes * PW-1178 | Support package-level visibility via visible property and overrides (#3279) via Facundo Menzella (@facumenzella) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk: this is primarily a version bump and release metadata/docs updates, with no changes to runtime behavior beyond reporting the new version string. > > **Overview** > Updates the Android SDK release from `10.1.0-SNAPSHOT` to **`10.0.2`** across build/version metadata (`.version`, `gradle.properties`, `Config.frameworkVersion`) and sample/test app dependency pins. > > Refreshes release documentation and automation to publish and redirect docs for `10.0.2` (CircleCI S3 deploy path and `docs/index.html`) and records the `10.0.2` changelog entry (RevenueCatUI Paywallv2 bugfix PW-1178). > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit be75649. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
facumenzella
added a commit
that referenced
this pull request
Apr 9, 2026
…verrides (#3279) ## Summary Implements Android SDK support for khepri#18819 which adds a `visible` field and `overrides` to the `Package` and `PartialPackage` schema, allowing packages to be hidden by Rules. - Adds `visible: Boolean?` and `overrides: List<ComponentOverride<PartialPackageComponent>>` to `PackageComponent` - Adds `PartialPackageComponent` with `visible: Boolean?` (mirrors khepri's `PartialPackage`) - Adds `PresentedPackagePartial` following the existing partial component pattern - `PackageComponentStyle` now implements `PackageContext` and carries package-level `visible`, `overrides`, and `offerEligibility` - New `PackageComponentState` evaluates overrides at render time (window size, selection, offer eligibility, custom variables) - `PackageComponentView` gates rendering on the resolved package-level visibility - `containsUnsupportedCondition` updated to check package-level overrides ## Test plan - [x] Unit tests: deserialization of new `visible` and `overrides` fields (`PackageComponentTests`) - [x] Unit tests: `StyleFactory` correctly populates `visible` and `overrides` on `PackageComponentStyle` (`StyleFactoryTests`) - [x] Unit tests: `containsUnsupportedCondition` detects unsupported conditions in package overrides (`ContainsUnsupportedConditionTests`) - [x] UI tests: package hidden when `visible=false`, shown when `visible=true`, and toggled via `selected_package` override condition (`VisibilityConditionTests`) - [x] Snapshot tests: need to be regenerated after merging (run `bundle exec fastlane generate_snapshots_RCUI`) ## Related - Backend PR: RevenueCat/khepri#18819 - iOS implementation adds the same feature in `PaywallPackageComponent.swift` + `PackageComponentViewModel.swift` 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes paywall rendering behavior by conditionally hiding `PackageComponent`s based on new rule evaluation, which could affect purchase UI visibility if misconfigured; coverage is improved with new unit/UI tests. > > **Overview** > Adds package-level visibility control to paywalls by extending `PackageComponent` with an optional `visible` flag plus conditional `overrides` (via new `PartialPackageComponent`). > > On the UI side, introduces `PresentedPackagePartial` and a new `PackageComponentState` that evaluates package overrides at render time (screen size/selection/offer eligibility/custom variables) and updates `PackageComponentView` to skip rendering when the resolved visibility is false; `StyleFactory` now builds and carries these overrides/visibility (defaulting to visible) and `containsUnsupportedCondition` now considers package-level overrides. Tests are expanded to cover JSON deserialization, style creation defaults, unsupported-condition detection, and Compose visibility behavior for packages. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 0abf6ab. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Open
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
Implements Android SDK support for khepri#18819 which adds a
visiblefield andoverridesto thePackageandPartialPackageschema, allowing packages to be hidden by Rules.visible: Boolean?andoverrides: List<ComponentOverride<PartialPackageComponent>>toPackageComponentPartialPackageComponentwithvisible: Boolean?(mirrors khepri'sPartialPackage)PresentedPackagePartialfollowing the existing partial component patternPackageComponentStylenow implementsPackageContextand carries package-levelvisible,overrides, andofferEligibilityPackageComponentStateevaluates overrides at render time (window size, selection, offer eligibility, custom variables)PackageComponentViewgates rendering on the resolved package-level visibilitycontainsUnsupportedConditionupdated to check package-level overridesTest plan
visibleandoverridesfields (PackageComponentTests)StyleFactorycorrectly populatesvisibleandoverridesonPackageComponentStyle(StyleFactoryTests)containsUnsupportedConditiondetects unsupported conditions in package overrides (ContainsUnsupportedConditionTests)visible=false, shown whenvisible=true, and toggled viaselected_packageoverride condition (VisibilityConditionTests)bundle exec fastlane generate_snapshots_RCUI)Related
PaywallPackageComponent.swift+PackageComponentViewModel.swift🤖 Generated with Claude Code
Note
Medium Risk
Changes paywall rendering behavior by conditionally hiding
PackageComponents based on new rule evaluation, which could affect purchase UI visibility if misconfigured; coverage is improved with new unit/UI tests.Overview
Adds package-level visibility control to paywalls by extending
PackageComponentwith an optionalvisibleflag plus conditionaloverrides(via newPartialPackageComponent).On the UI side, introduces
PresentedPackagePartialand a newPackageComponentStatethat evaluates package overrides at render time (screen size/selection/offer eligibility/custom variables) and updatesPackageComponentViewto skip rendering when the resolved visibility is false;StyleFactorynow builds and carries these overrides/visibility (defaulting to visible) andcontainsUnsupportedConditionnow considers package-level overrides. Tests are expanded to cover JSON deserialization, style creation defaults, unsupported-condition detection, and Compose visibility behavior for packages.Reviewed by Cursor Bugbot for commit 0abf6ab. Bugbot is set up for automated code reviews on this repo. Configure here.