Conversation
Implements components_config.header support — model, decoding, cache warming, view/view-model, and root wiring — following the same pattern as StickyFooterComponent. HeaderComponent is SPI-only (@_spi(Internal)) to avoid a source-breaking enum-case addition to PaywallComponent. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
- Register .header case in PaywallComponent enum and ComponentType - Add .header to PaywallComponentViewModel and ViewModelFactory.toViewModel - Add .header dispatch in ComponentsView - Add .header to containsUnsupportedConditions in PresentedPartials - Add .header to collectAllImageURLs/VideoURLs in PaywallV2CacheWarming - Add spec layout tests (header+footer, header only, footer only, body only) - Add "as PaywallComponent" deserialization test Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Mirrors Android's ContainsUnsupportedConditionTests: verifies that unsupported conditions inside a HeaderComponent's stack are detected both when called directly on the component and when the header is embedded as a child inside a stack. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…paywalls-v2-header-component
- Remove additionalPadding(top: headerHeight) from body stack so the header overlays content instead of pushing it down - Fix findFirstItemIgnoresSafeAreaInfo to fall through to the body stack check when the header exists but doesn't start with a full-width image, so edgesIgnoringSafeArea(.top) is correctly applied Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
The bottom padding should apply whenever there is no sticky footer, regardless of header presence. The sticky footer handles its own bottom safe area; the scroll content needs the inset in all other cases. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
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 7f76cf4. Configure here.
RevenueCatUI/Templates/V2/ViewModelHelpers/ViewModelFactory.swift
Outdated
Show resolved
Hide resolved
4 builds increased size
RevenueCat 1.0 (1)
|
| Item | Install Size Change |
|---|---|
| DYLD.String Table | ⬆️ 45.5 kB |
| Code Signature | ⬆️ 6.8 kB |
| DYLD.Exports | ⬆️ 1.7 kB |
| 📝 RevenueCat.PaywallComponent.HeaderComponent.HeaderComponent | ⬆️ 592 B |
| Other | ⬆️ 211.9 kB |
BinarySizeTest 1.0 (1)
com.revenuecat.binary-size-test.local-source
⚖️ Compare build
📦 Install build
⏱️ Analyze build performance
Total install size change: ⬆️ 21.7 kB (0.19%)
Total download size change: ⬆️ 5.2 kB (0.14%)
Largest size changes
| Item | Install Size Change |
|---|---|
| DYLD.String Table | ⬆️ 1.5 kB |
| DYLD.String Table | ⬆️ 1.4 kB |
| Code Signature | ⬆️ 936 B |
| RevenueCatUI.RootView.body | ⬆️ 768 B |
| DYLD.Exports | ⬆️ 728 B |
BinarySizeTest 1.0 (1)
com.revenuecat.binary-size-test.cocoapods
⚖️ Compare build
📦 Install build
⏱️ Analyze build performance
Total install size change: ⬆️ 46.7 kB (0.18%)
Total download size change: ⬆️ 10.0 kB (0.17%)
Largest size changes
| Item | Install Size Change |
|---|---|
| DYLD.String Table | ⬆️ 14.2 kB |
| DYLD.String Table | ⬆️ 8.0 kB |
| Code Signature | ⬆️ 1.1 kB |
| Code Signature | ⬆️ 936 B |
| RevenueCatUI.RootView.body | ⬆️ 768 B |
BinarySizeTest 1.0 (1)
com.revenuecat.binary-size-test.spm
⚖️ Compare build
📦 Install build
⏱️ Analyze build performance
Total install size change: ⬆️ 12.9 kB (0.13%)
Total download size change: ⬆️ 5.5 kB (0.14%)
Largest size changes
| Item | Install Size Change |
|---|---|
| RevenueCatUI.RootView.body | ⬆️ 768 B |
| DYLD.Exports | ⬆️ 736 B |
| 📝 RevenueCatUI.HeaderComponentView.body | ⬆️ 632 B |
| 📝 RevenueCatUI.HeaderComponentView.value witness | ⬆️ 628 B |
| RevenueCatUI.ViewModelFactory.toRootViewModel(componentsConfig,of... | ⬆️ 568 B |
🛸 Powered by Emerge Tools
Comment trigger: Size diff threshold of 100.00kB exceeded
vegaro
left a comment
There was a problem hiding this comment.
Looks great. If you can add some screenshots to the description it would be great!





Summary
PaywallComponent.HeaderComponent(SPI-only, mirrorsStickyFooterComponentpattern) with encode/decode supportcomponents_config.headerintoPaywallComponentsConfig, cache warming,RootViewModel, andRootViewViewModelFactorytests so badge-only coverage stays inViewModelFactoryBadgeTestsand shared/root/header coverage lives inViewModelFactoryTestsSpec & cross-platform
Test plan
swift test --filter HeaderComponentTestspassesswift test --filter PaywallComponentsConfigHeaderTestspassesswiftlint lint RevenueCatUI/Templates/V2/Components/Header/HeaderComponentView.swift RevenueCatUI/Templates/V2/Components/Header/HeaderComponentViewModel.swift RevenueCatUI/Templates/V2/PaywallsV2View.swift RevenueCatUI/Templates/V2/ViewModelHelpers/ViewModelFactory.swift Tests/RevenueCatUITests/PaywallsV2/ViewModelFactoryBadgeTests.swift Tests/RevenueCatUITests/PaywallsV2/ViewModelFactoryTests.swiftpassesxcodebuild test -project RevenueCat.xcodeproj -scheme RevenueCatUITests -destination 'platform=iOS Simulator,name=iPhone 16' -only-testing:RevenueCatUITests/ViewModelFactoryBadgeTests -only-testing:RevenueCatUITests/ViewModelFactoryTestspassesNote
Medium Risk
Adds a new
components_config.headerbranch that affects paywall decoding, view model construction, cache warming, and top safe-area handling, which could change Paywalls V2 layout/rendering in production. Scope is contained to Paywalls V2/SPI APIs with extensive new unit/UI tests mitigating regression risk.Overview
Adds a new optional Paywalls V2 header component (
PaywallComponent.HeaderComponent) that decodes/encodes fromcomponents_config.headerand can be rendered above the main stack.Wires header support through
PaywallComponentsConfig,ViewModelFactory.toRootViewModel, cache warming URL collection, andRootViewlayout (overlaying the header in a top-alignedZStackand updating safe-area handling for the header independently from root hero-image handling).Refactors/expands test coverage by moving unsupported-condition/global
discardRulestests into a newViewModelFactoryTests, and adding new unit tests for header component and config decoding.Reviewed by Cursor Bugbot for commit 46cc885. Bugbot is set up for automated code reviews on this repo. Configure here.