Skip to content

[DONT REVIEW] Conditional Configurability v0#3117

Open
vegaro wants to merge 3 commits intomainfrom
cesar/conditional-configurability
Open

[DONT REVIEW] Conditional Configurability v0#3117
vegaro wants to merge 3 commits intomainfrom
cesar/conditional-configurability

Conversation

@vegaro
Copy link
Member

@vegaro vegaro commented Feb 18, 2026

THIS IS A BASE BRANCH NO NEED TO REVIEW

Add support for Conditional Configurability in paywalls

Ability to set rules for:

  • All custom variables
  • Selected Package
    • Identifier
    • Intro offer presence and eligibility
    • Promo offer presence and eligibility

And ability to configure component/Package visibility

…nal configurability (#3110)

### Motivation
The conditional configurability V0 feature requires new condition types
in the data layer to support dynamic paywall component visibility based
on variables, packages, and extended intro/promo offer conditions.

### Description
- Adds `Variable`, `Package`, `SelectedPackage` data classes to
`ComponentOverride.Condition` sealed interface
- Extends `IntroOffer` and `PromoOffer` conditions from simple objects
to data classes with `operator` and `value` fields (backwards compatible
with legacy format)
- Adds `EqualityOperator`, `ArrayOperator`, and `ConditionValue` types
for condition evaluation
- Updates `ConditionSerializer` to handle new types with fallback to
`Unsupported` on parse errors
- Comprehensive unit tests for deserialization, backwards compatibility,
unknown types, and malformed data

**Tasks:** PW-169 (1.1–1.13)

Co-authored-by: Cursor <cursoragent@cursor.com>
Copy link
Member Author

vegaro commented Feb 18, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

…on evaluation (#3111)

### Motivation
The `selected_package` condition allows paywall components to change
their appearance based on which package the user has selected (e.g.,
show different text when annual vs monthly is selected).

### Description
- Introduces `ConditionContext` to carry evaluation state
(`selectedPackageId`, `currentPackageId`, `customVariables`)
- Extends `buildPresentedPartial` to accept `ConditionContext` parameter
- Implements `SelectedPackage` condition evaluation with `in` / `not in`
operators
- Threads selected package ID from all component state classes through
to condition evaluation
- Unit tests for `selected_package` condition evaluation (in, not in, no
selection)

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
@vegaro vegaro changed the title [Conditional Configurability] Base branch Conditional Configurability v0 Feb 18, 2026
@vegaro vegaro changed the title Conditional Configurability v0 [DONT REVIEW] Conditional Configurability v0 Feb 18, 2026
…, and extended intro/promo condition evaluation (#3112)

### Motivation
Completes the V0 condition evaluation logic. 

- With variable conditions paywalls can adapt based on developer custom
variables.
- Selected package conditions let components change based on which
package the user has selected.
- Intro/promo conditions now support explicit operator (`=`/`!=`) and
value fields for more precise control.

### Description
- Implements `Variable` condition evaluation with equality comparison
and type coercion (string, bool, int, double)
- Implements `SelectedPackage` condition evaluation against the
currently selected package ID
- Implements extended `IntroOffer` and `PromoOffer` evaluation with
`operator` (`=`/`!=`) and `value` fields
- Removes `Package` condition (not used by backend or dashboard)
- Threads `customVariables` through `ConditionContext` to all component
state classes
- Wires `customVariables` from `PaywallState.Loaded` into the evaluation
pipeline

Co-authored-by: Cursor <cursoragent@cursor.com>
@codecov
Copy link

codecov bot commented Feb 18, 2026

Codecov Report

❌ Patch coverage is 76.19048% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.22%. Comparing base (9affa79) to head (114c8c1).

Files with missing lines Patch % Lines
...es/paywalls/components/common/ComponentOverride.kt 76.47% 4 Missing and 4 partials ⚠️
...utils/serializers/SealedDeserializerWithDefault.kt 75.00% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3117      +/-   ##
==========================================
- Coverage   79.22%   79.22%   -0.01%     
==========================================
  Files         347      347              
  Lines       13911    13948      +37     
  Branches     1884     1893       +9     
==========================================
+ Hits        11021    11050      +29     
- Misses       2109     2112       +3     
- Partials      781      786       +5     

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

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

Comments