Skip to content

feat(paywalls): add web_view component schema (PWENG-98)#3650

Draft
alexrepty wants to merge 1 commit into
mainfrom
alexrepty/paywalls-web-view-schema
Draft

feat(paywalls): add web_view component schema (PWENG-98)#3650
alexrepty wants to merge 1 commit into
mainfrom
alexrepty/paywalls-web-view-schema

Conversation

@alexrepty

@alexrepty alexrepty commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Checklist

  • If applicable, unit tests
  • If applicable, create follow-up issues for purchases-ios and hybrids

Motivation

Paywalls V2 needs a web_view component so a paywall can render hosted web content inside a WebView. This is the schema/model layer — the base of a reviewable stack that builds up the full feature.

Part of PWENG-98.

Description

  • Adds WebViewComponent to the sealed PaywallComponent hierarchy and registers "web_view" in the serializer, with url, id, name, visible, protocol_version, and size.
  • Adds the minimal exhaustive-when branches the new sealed subtype forces across :purchases and :ui:revenuecatui so everything still compiles (no rendering yet — a web_view decodes but produces no UI).
  • Tested by WebViewComponentTests (serialization, defaults, unknown-key tolerance).

iOS parity: mirrors purchases-ios (web-view-bridge-wiring).
Stack (merge bottom-up): schema → rendering → CSP → value types → message model → variables provider → JS bridge → wiring.


Note

Low Risk
Schema and compile-time wiring only; no WebView rendering or network surface in this PR.

Overview
Adds Paywalls V2 web_view as a new PaywallComponent subtype so configs can reference hosted web bundle URLs (url, optional protocol_version, size, etc.).

Registers "web_view" in JSON deserialization and threads the type through tree walks (filter, image pre-download, unsupported-condition checks). UI styling maps WebViewComponent to no style yet—nested instances are skipped like other placeholder types; rendering/CSP come in follow-ups.

WebViewComponentTests cover full-schema decode, defaults, template URLs, and ignoring unknown capabilities keys.

Reviewed by Cursor Bugbot for commit 40615bf. Bugbot is set up for automated code reviews on this repo. Configure here.

@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.81818% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.48%. Comparing base (7d93941) to head (40615bf).

Files with missing lines Patch % Lines
.../purchases/paywalls/components/WebViewComponent.kt 87.50% 0 Missing and 1 partial ⚠️
...purchases/utils/PaywallComponentFilterExtension.kt 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3650   +/-   ##
=======================================
  Coverage   80.48%   80.48%           
=======================================
  Files         403      404    +1     
  Lines       16717    16728   +11     
  Branches     2386     2389    +3     
=======================================
+ Hits        13455    13464    +9     
  Misses       2322     2322           
- Partials      940      942    +2     

☔ View full report in Codecov by Harness.
📢 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.

@alexrepty alexrepty force-pushed the alexrepty/paywalls-web-view-schema branch from 6b4ecb1 to 9e93b6c Compare June 26, 2026 10:49
@alexrepty alexrepty force-pushed the alexrepty/paywalls-web-view-schema branch from 9e93b6c to b911095 Compare June 26, 2026 14:20
@alexrepty alexrepty changed the title feat(paywalls): add web_view component schema feat(paywalls): add web_view component schema (PWENG-98) Jun 29, 2026
Comment on lines +53 to +60
"capabilities": {
"network_access": { "allowed_domains": ["api.segment.io"] },
"camera": true,
"microphone": true,
"clipboard_write": true,
"clipboard_read": true,
"geolocation": true
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

These are v2 capabilities which we deliberately omitted from the initial release.

@alexrepty alexrepty force-pushed the alexrepty/paywalls-web-view-schema branch 2 times, most recently from dc40011 to 003b8ee Compare June 29, 2026 14:14
@alexrepty alexrepty marked this pull request as ready for review June 29, 2026 14:42
@alexrepty alexrepty requested review from a team as code owners June 29, 2026 14:42
@alexrepty alexrepty force-pushed the alexrepty/paywalls-web-view-schema branch from 003b8ee to fa1fcdf Compare June 30, 2026 07:44
@AlvaroBrey AlvaroBrey force-pushed the alexrepty/paywalls-web-view-schema branch from fa1fcdf to a46325f Compare July 6, 2026 08:12
@AlvaroBrey AlvaroBrey self-assigned this Jul 6, 2026
@emerge-tools

emerge-tools Bot commented Jul 6, 2026

Copy link
Copy Markdown

📸 Snapshot Test

593 unchanged

Name Added Removed Modified Renamed Unchanged Errored Approval
TestPurchasesUIAndroidCompatibility
com.revenuecat.testpurchasesuiandroidcompatibility
0 0 0 0 335 0 N/A
TestPurchasesUIAndroidCompatibility Paparazzi
com.revenuecat.testpurchasesuiandroidcompatibility.paparazzi
0 0 0 0 258 0 N/A

🛸 Powered by Emerge Tools

Introduces the Paywalls V2 `web_view` component (`WebViewComponent`) and registers it in the `PaywallComponent` sealed hierarchy / serializer. Adds the minimal cross-module `when` branches required for the project to compile now that the sealed type has a new member (StyleFactory returns no style yet; image pre-download and unsupported-condition checks treat it as a leaf / traverse its fallback).

No rendering, CSP, messaging, or pre-warming yet — those land in later PRs in the stack.

Recommended labels: pr:other
@AlvaroBrey AlvaroBrey force-pushed the alexrepty/paywalls-web-view-schema branch from a46325f to 40615bf Compare July 6, 2026 13:57
@AlvaroBrey AlvaroBrey marked this pull request as draft July 6, 2026 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants