Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync form factor specific favorites #511

Merged
merged 61 commits into from
Nov 10, 2023
Merged

Sync form factor specific favorites #511

merged 61 commits into from
Nov 10, 2023

Conversation

ayoy
Copy link
Contributor

@ayoy ayoy commented Sep 21, 2023

Please review the release process for BrowserServicesKit here.

Required:

Task/Issue URL: https://app.asana.com/0/1201493110486074/1204926049616866/f
iOS PR: duckduckgo/iOS#2029
macOS PR: duckduckgo/macos-browser#1656
What kind of version bump will this require?: Major

Optional:

Tech Design URL: https://app.asana.com/0/481882893211075/1205418608802079/f

Description:
This change introduces form factor specific favorites to be used when Sync is enabled.
1 favorites folder is replaced by 3 folders – mobile, desktop and unified.
Users always see only 1 folder and it's their form-factor-specific one. Only users with Sync enabled
get to choose whether they want to see the form-factor-specific favorites or unified (desktop + mobile)
favorites. The setting itself is synced between devices in the Sync account.
BookmarkEntity's isFavorite is replaced with isFavorite(on:) taking folder as a parameter.
API for adding to favorites and removing from favorites was updated to take multiple favorites
folders as needed.
FavoritesDisplayMode enum is introduced to manage display mode in clients.
Bookmarks and Favorites related view models used on iOS are updated to take favorites display mode
and reload their data as the mode changes.
In SyncDataProviders, an abstract SettingSyncHandler class was added to support adding
an arbitrary setting (key-value pair) to Sync. It's subclassed by EmailProtectionSyncHandler
and FavoritesDisplayModeSyncHandlerBase (that needs to be subclassed in client apps due to differences
in User Defaults storage between iOS and macOS apps).

Steps to test this PR:
These are common steps for iOS and macOS:

  1. Launch the app from develop, populate bookmarks and favorites. (Don't enable Sync).
  2. Launch the app from this branch. Identify as internal user and enable Sync.
  3. Repeat the above on another platform (iOS/macOS) adding your device to the same Sync account.
  4. Verify that both apps show different sets of favorites.
  5. Go to Sync settings and enable Unified favorites; verify that both apps show the same set of favorites, which is a logical sum of both platforms' favorites.
  6. Verify that reordering favorites gets synced properly.
  7. Switch back to form-factor-specific favorites and verify that favorites are back to what you've seen in 4.
  8. Continue testing the feature according to remaining product requirements.

OS Testing:

  • iOS 14
  • iOS 15
  • iOS 16
  • macOS 10.15
  • macOS 11
  • macOS 12

Internal references:

Software Engineering Expectations
Technical Design Template

@ayoy ayoy self-assigned this Sep 21, 2023
Sources/Bookmarks/BookmarkUtils.swift Outdated Show resolved Hide resolved
Sources/Bookmarks/BookmarkUtils.swift Show resolved Hide resolved
ayoy added 28 commits September 21, 2023 15:58
@ayoy ayoy force-pushed the dominik/sync-ffs-favorites branch from d4bc69a to 5e7521f Compare September 21, 2023 13:58
@ayoy ayoy requested a review from bwaresiak September 21, 2023 14:21
@ayoy ayoy assigned bwaresiak and unassigned ayoy Sep 21, 2023
@ayoy ayoy marked this pull request as ready for review September 21, 2023 14:21
@ayoy ayoy merged commit f7e20cd into main Nov 10, 2023
5 checks passed
@ayoy ayoy deleted the dominik/sync-ffs-favorites branch November 10, 2023 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants