Skip to content

PW-1178 | Support package-level visibility via visible property and overrides#3279

Open
facumenzella wants to merge 5 commits intomainfrom
facundo/pw-1178-package-visibility-android
Open

PW-1178 | Support package-level visibility via visible property and overrides#3279
facumenzella wants to merge 5 commits intomainfrom
facundo/pw-1178-package-visibility-android

Conversation

@facumenzella
Copy link
Copy Markdown
Member

@facumenzella facumenzella commented Mar 26, 2026

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

  • Unit tests: deserialization of new visible and overrides fields (PackageComponentTests)
  • Unit tests: StyleFactory correctly populates visible and overrides on PackageComponentStyle (StyleFactoryTests)
  • Unit tests: containsUnsupportedCondition detects unsupported conditions in package overrides (ContainsUnsupportedConditionTests)
  • UI tests: package hidden when visible=false, shown when visible=true, and toggled via selected_package override condition (VisibilityConditionTests)
  • Snapshot tests: need to be regenerated after merging (run bundle exec fastlane generate_snapshots_RCUI)

Related

🤖 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 visible and conditional overrides on PackageComponent, plus a new PartialPackageComponent and PresentedPackagePartial to evaluate those overrides.

Updates UI rendering and state so PackageComponentView hides packages when resolved visibility is false and reports visibility changes back to PaywallState, 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.

…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
Copy link
Copy Markdown

codecov bot commented Mar 26, 2026

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 79.20%. Comparing base (1c10aa0) to head (8c03721).

Files with missing lines Patch % Lines
.../purchases/paywalls/components/PackageComponent.kt 75.00% 0 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@facumenzella facumenzella marked this pull request as ready for review April 8, 2026 14:11
@facumenzella facumenzella requested review from a team as code owners April 8, 2026 14:11
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant