Open
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 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- 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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
…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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
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.
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
PaywallComponent.HeaderComponent(SPI-only, mirrorsStickyFooterComponentpattern) with encode/decode supportcomponents_config.headerintoPaywallComponentsConfig, cache warming,RootViewModel, andRootViewfirstItemIgnoresSafeArealogic prefers header over root stack when header is presentHeaderComponentTests,PaywallComponentsConfigHeaderTests, expandedViewModelFactoryBadgeTestsSpec & cross-platform
Test plan
swift test --filter HeaderComponentTestspassesswift test --filter PaywallComponentsConfigHeaderTestspassesswift test --filter ViewModelFactoryBadgeTestspassesUnitTests/HeaderComponentTests+UnitTests/PaywallComponentsConfigHeaderTestson iOS Simulator passcomponents_config.headerrenders header above the main stack🤖 Generated with Claude Code
Note
Medium Risk
Adds a new
components_config.headersurface that affects paywall decoding, view-model construction, rendering layout, and asset prefetching; risk is mainly UI/layout regressions and compatibility with older configs.Overview
Adds a new SPI
PaywallComponent.HeaderComponentand exposes it onPaywallComponentsData.PaywallComponentsConfigas optionalheader, including JSON encode/decode coverage.Wires the header through Paywalls V2 rendering by creating
HeaderComponentViewModel/HeaderComponentView, updatingRootViewModel/RootViewto overlay the header above the main stack, and extendingViewModelFactoryto build the header stack, propagatediscardRuleswhen header contains unsupported conditions, and adjust first-item safe-area ignore logic to prefer the header when present.Updates paywall V2 cache warming to prefetch header image/video assets and adds focused unit/UI tests for header decoding/encoding and the new layout/rule-propagation behaviors.
Reviewed by Cursor Bugbot for commit 2e367fb. Bugbot is set up for automated code reviews on this repo. Configure here.