PW-1178 | Support package-level visibility via visible property and overrides#3279
Open
facumenzella wants to merge 5 commits intomainfrom
Open
PW-1178 | Support package-level visibility via visible property and overrides#3279facumenzella wants to merge 5 commits intomainfrom
facumenzella wants to merge 5 commits intomainfrom
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 <[email protected]>
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 14099 14103 +4
Branches 1939 1940 +1
==========================================
+ Hits 11167 11170 +3
Misses 2136 2136
- Partials 796 797 +1 ☔ 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 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 <[email protected]>
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 package rendering and selection state management based on dynamic visibility, which can affect which product is selected for purchase (especially across tab switches and overrides). Scope is contained to paywall components/UI state but touches core purchase-selection behavior.
Overview
Adds package-level visibility support to paywall components by introducing
visibleand conditionaloverridesonPackageComponent, plus a newPartialPackageComponentandPresentedPackagePartialto evaluate those overrides.Updates UI rendering and state so
PackageComponentViewhides packages when resolved visibility is false and reports visibility changes back toPaywallState, which now reconciles selection away from packages that become hidden before ever being visible (while preserving user-driven selections that later hide themselves). Also extends style creation to carry package visibility/overrides and updates unsupported-condition detection and tests to cover the new behavior.Reviewed by Cursor Bugbot for commit 8c03721. Bugbot is set up for automated code reviews on this repo. Configure here.