Skip to content

Conversation

clindsay3
Copy link
Collaborator

@clindsay3 clindsay3 commented Jul 9, 2025

Motivation

Various buttons were not rendering correctly on Mac Catalyst - Optimized for Mac builds.

Description

  • Adds a .borderless button style that will apply by default to all buttons on Mac Catalyst, unless they are overridden in a certain view.
  • Change the existing location where PurchaseButton (used in V1 and V2 footers) was using .plain. This fixes an issue where on Mac Catalyst you would have to click the text in the middle of the button, and the rest of the button wasn't clickable.

Without this button style, buttons on Catalyst builds will take on the macOS push-button style by default, which breaks lots of our rendering. Some of our buttons in paywalls didn't have this issue because they explicitly set button styles, but most did not.

I know this fixes at least PackageComponentView, TabControlButtonComponentView, AsyncButton and probably others.

Since SwiftUI buttons with the default style will adapt to their environment (for example, in List becoming rows with disclosure indicators), it is possible there could be places where we could be relying on that behavior, and this button style override is not what we want. If we encounter those locations, I think we should explicitly set the button style back to .automatic in those locations. Our paywall validation and component tests should quickly highlight any locations like that.

We should merge #5371 and run the paywall validation screenshot tests before we merge this PR, so that we can verify the diffs for all the paywall templates before making this change.

Last, I considered just applying this button style without limiting it to Mac Catalyst. I'm not sure it's obvious whether it should be limited to Mac Catalyst, or we should just broadly apply this behavior. But I think leaving it as-is on iOS will let us automatically adopt any changes that Apple introduces to standard button behavior, so I think it's the right call to limit this to Mac Catalyst (and possibly native Mac once I get to implementing that).

Some before/after screenshots
Note: the faded look of the before screenshots is an unrelated issue.

Before
screenshots_templates_app_057dd042-paywall_pw4283b7b6335e4a58_mac-catalyst-optimized-for-mac_Before_b069b550f04115b3a44af6e11735ecf0a6bf0ce2
screenshots_templates_app_0efce02a-paywall_pw81cbe1229b1042a6_mac-catalyst-optimized-for-mac_Before_b069b550f04115b3a44af6e11735ecf0a6bf0ce2

After
mac-catalyst-optimized-for-mac
mac-catalyst-optimized-for-mac

@clindsay3 clindsay3 added the pr:fix A bug fix label Jul 9, 2025
@clindsay3 clindsay3 requested review from joshdholtz and a team July 9, 2025 09:27
Copy link

emerge-tools bot commented Jul 11, 2025

📸 Snapshot Test

5 modified, 700 unchanged

Name Added Removed Modified Renamed Unchanged Errored Approval
RevenueCat
com.revenuecat.PaywallsTester.mac-catalyst-scaled-to-match-ipad
0 0 0 0 235 0 N/A
RevenueCat
com.revenuecat.PaywallsTester.mac-catalyst-optimized-for-mac
0 0 5 0 230 0 ✅ Approved
RevenueCat
com.revenuecat.PaywallsTester
0 0 0 0 235 0 N/A

🛸 Powered by Emerge Tools

Copy link
Member

@ajpallares ajpallares left a comment

Choose a reason for hiding this comment

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

Great fix!

A small suggestion, could you add a couple of screenshots to the PR description (the before and the after). I think it will be very helpful for a quick reference.

@clindsay3 clindsay3 merged commit 6193cf7 into main Jul 15, 2025
12 checks passed
@clindsay3 clindsay3 deleted the mac-paywalls/fix-buttons branch July 15, 2025 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:fix A bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants