duckduckgo / macos-browser

DuckDuckGo macOS Browser
Apache License 2.0
246 stars 9 forks source link

Freemium PIR: Enable Multi-Window Shared UI State #3267

Closed aataraxiaa closed 1 month ago

aataraxiaa commented 1 month ago

Task/Issue URL: https://app.asana.com/0/1206488453854252/1208294167066324/f

Description: This PR moves the declaration of FreemiumDBPPromotionViewCoordinator to the App Delegate to enable UI state to be shared by multiple windows (ensuring the new tab page is updated as expected when state changes)

Testing Prerequisites

  1. Make sure you are an internal user
  2. Disable/Signout of Privacy Pro (Settings menu -> PP -> Remove from this device)

Steps to test this PR:

  1. Launch the browser
  2. Ensure you see a Freemium PIR promotion banner on the new tab page
  3. Launch a new window
  4. Click the ’Scan’ button on the new tab page in one of the windows
  5. Ensure the banner is removed from the new tab page in both windows (you might need to focus the other window to force it to update it’s UI)

Definition of Done:

Internal references:

Pull Request Review Checklist Software Engineering Expectations Technical Design Template Pull Request Documentation

aataraxiaa commented 1 month ago

@aataraxiaa The mentioned steps worked for me 👍🏼 .

Something that I noticed is that if I cancel (close the tab or load another URL) while I’m in the scan steps, I’m not able to get the Free scans button again. Maybe you already know this, but I want to say it just in case.

Thanks for reviewing and testing @jotaemepereira. Yes, that’s intentional - the new tab banner disappears after the user opens the PIR tab.