From 954a31c6100db9b18557b93c9ece50505c11c8b1 Mon Sep 17 00:00:00 2001 From: Dax the Duck Date: Mon, 4 Nov 2024 21:03:11 +0000 Subject: [PATCH 1/3] Bump version to 1.113.0 (298) --- Configuration/BuildNumber.xcconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Configuration/BuildNumber.xcconfig b/Configuration/BuildNumber.xcconfig index 2d26b7a47d..1c2c93afcc 100644 --- a/Configuration/BuildNumber.xcconfig +++ b/Configuration/BuildNumber.xcconfig @@ -1 +1 @@ -CURRENT_PROJECT_VERSION = 297 +CURRENT_PROJECT_VERSION = 298 From 0f911494c10e14572e2ad8ff7cc61b868a97c3cb Mon Sep 17 00:00:00 2001 From: Dominik Kapusta Date: Tue, 5 Nov 2024 17:39:26 +0100 Subject: [PATCH 2/3] Update C-S-S to 6.29.0 (#3515) Task/Issue URL: https://app.asana.com/0/1201048563534612/1208699974934565/f Description: This update provides new API for macOS New Tab Page rework. Current production version remains unchanged. --- DuckDuckGo.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/swiftpm/Package.resolved | 8 ++++---- LocalPackages/DataBrokerProtection/Package.swift | 2 +- LocalPackages/NetworkProtectionMac/Package.swift | 2 +- LocalPackages/SubscriptionUI/Package.swift | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index 731efbd4e7..5228a89b6b 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -14778,7 +14778,7 @@ repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit"; requirement = { kind = exactVersion; - version = 203.1.0; + version = 203.3.0; }; }; 9FF521422BAA8FF300B9819B /* XCRemoteSwiftPackageReference "lottie-spm" */ = { diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 6c7c3d5617..d8312e4987 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -32,8 +32,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/BrowserServicesKit", "state" : { - "revision" : "19f1e5c945aa92562ad2d087e8d6c99801edf656", - "version" : "203.1.0" + "revision" : "64a5d8d1e19951fe397305a14e521713fb0eaa49", + "version" : "203.3.0" } }, { @@ -41,8 +41,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/duckduckgo/content-scope-scripts", "state" : { - "revision" : "48fee2508995d4ac02d18b3d55424adedcb4ce4f", - "version" : "6.28.0" + "revision" : "6cab7bdb584653a5dc007cc1ae827ec41c5a91bc", + "version" : "6.29.0" } }, { diff --git a/LocalPackages/DataBrokerProtection/Package.swift b/LocalPackages/DataBrokerProtection/Package.swift index 33cc4173f6..93f0c75dfb 100644 --- a/LocalPackages/DataBrokerProtection/Package.swift +++ b/LocalPackages/DataBrokerProtection/Package.swift @@ -29,7 +29,7 @@ let package = Package( targets: ["DataBrokerProtection"]) ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "203.1.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "203.3.0"), .package(path: "../SwiftUIExtensions"), .package(path: "../XPCHelper"), .package(path: "../Freemium"), diff --git a/LocalPackages/NetworkProtectionMac/Package.swift b/LocalPackages/NetworkProtectionMac/Package.swift index 4780108c7d..1ba32a268d 100644 --- a/LocalPackages/NetworkProtectionMac/Package.swift +++ b/LocalPackages/NetworkProtectionMac/Package.swift @@ -32,7 +32,7 @@ let package = Package( .library(name: "VPNAppLauncher", targets: ["VPNAppLauncher"]), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "203.1.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "203.3.0"), .package(url: "https://github.com/airbnb/lottie-spm", exact: "4.4.3"), .package(path: "../AppLauncher"), .package(path: "../UDSHelper"), diff --git a/LocalPackages/SubscriptionUI/Package.swift b/LocalPackages/SubscriptionUI/Package.swift index 4948ae40a6..41c6b7dba2 100644 --- a/LocalPackages/SubscriptionUI/Package.swift +++ b/LocalPackages/SubscriptionUI/Package.swift @@ -12,7 +12,7 @@ let package = Package( targets: ["SubscriptionUI"]), ], dependencies: [ - .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "203.1.0"), + .package(url: "https://github.com/duckduckgo/BrowserServicesKit", exact: "203.3.0"), .package(path: "../SwiftUIExtensions") ], targets: [ From a8de1e07b3b20287570b4043502f9867ce7af22b Mon Sep 17 00:00:00 2001 From: Juan Manuel Pereira Date: Tue, 5 Nov 2024 15:35:41 -0300 Subject: [PATCH 3/3] Fix add to favorites and open in new tabs action not working on manager (#3467) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task/Issue URL: https://app.asana.com/0/1201048563534612/1208523846260390/f Tech Design URL: CC: **Description**: Fix add to favorites and open in new tabs action not working on the bookmark manager when selecting multiple bookmarks. **Steps to test this PR**: 1. Open Bookmarks Manager 2. Select multiple bookmarks 3. Right tap, select `Open in New Tabs` 4. All the bookmarks should be opened in new tabs 5. Select the bookmarks again (they should not be favorites), right-tap, and select `Add to favorites` 6. The bookmarks should be added to favorites **Definition of Done**: * [x] Does this PR satisfy our [Definition of Done](https://app.asana.com/0/1202500774821704/1207634633537039/f)? — ###### Internal references: [Pull Request Review Checklist](https://app.asana.com/0/1202500774821704/1203764234894239/f) [Software Engineering Expectations](https://app.asana.com/0/59792373528535/199064865822552) [Technical Design Template](https://app.asana.com/0/59792373528535/184709971311943) [Pull Request Documentation](https://app.asana.com/0/1202500774821704/1204012835277482/f) --- .../Bookmarks/Extensions/Bookmarks+Tab.swift | 7 +++++ .../Services/BookmarksContextMenu.swift | 30 ++++++++++++------- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/DuckDuckGo/Bookmarks/Extensions/Bookmarks+Tab.swift b/DuckDuckGo/Bookmarks/Extensions/Bookmarks+Tab.swift index 78c60f30ea..689cdc742e 100644 --- a/DuckDuckGo/Bookmarks/Extensions/Bookmarks+Tab.swift +++ b/DuckDuckGo/Bookmarks/Extensions/Bookmarks+Tab.swift @@ -28,6 +28,13 @@ extension Tab { } } + @MainActor + static func with(contentsOf bookmarks: [Bookmark], burnerMode: BurnerMode) -> [Tab] { + bookmarks.compactMap { bookmark -> Tab? in + guard let url = bookmark.urlObject else { return nil } + return Tab(content: .url(url, source: .bookmark), shouldLoadInBackground: true, burnerMode: burnerMode) + } + } } extension TabCollection { diff --git a/DuckDuckGo/Bookmarks/Services/BookmarksContextMenu.swift b/DuckDuckGo/Bookmarks/Services/BookmarksContextMenu.swift index 7fe6569ed6..17032a82e5 100644 --- a/DuckDuckGo/Bookmarks/Services/BookmarksContextMenu.swift +++ b/DuckDuckGo/Bookmarks/Services/BookmarksContextMenu.swift @@ -308,13 +308,17 @@ extension BookmarksContextMenu: BookmarkMenuItemSelectors { } @objc func toggleBookmarkAsFavorite(_ sender: NSMenuItem) { - guard let bookmark = sender.representedObject as? Bookmark else { + if let bookmark = sender.representedObject as? Bookmark{ + bookmark.isFavorite.toggle() + bookmarkManager.update(bookmark: bookmark) + } else if let bookmarks = sender.representedObject as? [Bookmark] { + bookmarks.forEach { bookmark in + bookmark.isFavorite.toggle() + bookmarkManager.update(bookmark: bookmark) + } + } else { assertionFailure("Failed to cast menu represented object to Bookmark") - return } - - bookmark.isFavorite.toggle() - bookmarkManager.update(bookmark: bookmark) } @MainActor @@ -424,16 +428,20 @@ extension BookmarksContextMenu: FolderMenuItemSelectors { @MainActor @objc func openInNewTabs(_ sender: NSMenuItem) { - guard let tabCollection = windowControllersManager.lastKeyMainWindowController?.mainViewController.tabCollectionViewModel, - let folder = sender.representedObject as? BookmarkFolder - else { + guard let tabCollection = windowControllersManager.lastKeyMainWindowController?.mainViewController.tabCollectionViewModel else { assertionFailure("Cannot open all in new tabs") return } - let tabs = Tab.withContentOfBookmark(folder: folder, burnerMode: tabCollection.burnerMode) - tabCollection.append(tabs: tabs) - PixelExperiment.fireOnboardingBookmarkUsed5to7Pixel() + if let folder = sender.representedObject as? BookmarkFolder { + let tabs = Tab.withContentOfBookmark(folder: folder, burnerMode: tabCollection.burnerMode) + tabCollection.append(tabs: tabs) + PixelExperiment.fireOnboardingBookmarkUsed5to7Pixel() + } else if let bookmarks = sender.representedObject as? [Bookmark] { + let tabs = Tab.with(contentsOf: bookmarks, burnerMode: tabCollection.burnerMode) + tabCollection.append(tabs: tabs) + PixelExperiment.fireOnboardingBookmarkUsed5to7Pixel() + } } @MainActor