Skip to content

Commit

Permalink
Merge branch 'main' into brad/address-tab-feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
SlayterDev committed Apr 30, 2024
2 parents 7fdbe89 + 632cb2e commit 97e2f2c
Show file tree
Hide file tree
Showing 50 changed files with 981 additions and 94 deletions.
2 changes: 1 addition & 1 deletion Configuration/BuildNumber.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CURRENT_PROJECT_VERSION = 176
CURRENT_PROJECT_VERSION = 177
2 changes: 1 addition & 1 deletion Configuration/Version.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MARKETING_VERSION = 1.85.0
MARKETING_VERSION = 1.86.0
40 changes: 39 additions & 1 deletion DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1087,6 +1087,12 @@
4B1E6EEE27AB5E5100F51793 /* PasswordManagementListSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B1E6EEC27AB5E5100F51793 /* PasswordManagementListSection.swift */; };
4B1E6EF127AB5E5D00F51793 /* NSPopUpButtonView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B1E6EEF27AB5E5D00F51793 /* NSPopUpButtonView.swift */; };
4B1E6EF227AB5E5D00F51793 /* PasswordManagementItemList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B1E6EF027AB5E5D00F51793 /* PasswordManagementItemList.swift */; };
4B1EFF1C2BD71EEF007CC84F /* PixelKit in Frameworks */ = {isa = PBXBuildFile; productRef = 4B1EFF1B2BD71EEF007CC84F /* PixelKit */; };
4B1EFF1D2BD71FCA007CC84F /* UserDefaultsWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85C6A29525CC1FFD00EEB5F1 /* UserDefaultsWrapper.swift */; };
4B1EFF1E2BD72034007CC84F /* BundleExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6106B9D26A565DA0013B453 /* BundleExtension.swift */; };
4B1EFF1F2BD72170007CC84F /* OptionalExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = B637273C26CCF0C200C8CB02 /* OptionalExtension.swift */; };
4B1EFF212BD72189007CC84F /* Networking in Frameworks */ = {isa = PBXBuildFile; productRef = 4B1EFF202BD72189007CC84F /* Networking */; };
4B1EFF222BD7223D007CC84F /* NetworkProtectionPixelEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BF0E5042AD2551A00FFEC9E /* NetworkProtectionPixelEvent.swift */; };
4B25375B2A11BE7300610219 /* NetworkExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B4D603E2A0B290200BCD287 /* NetworkExtension.framework */; };
4B2537722A11BF8B00610219 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B25376F2A11BF8B00610219 /* main.swift */; };
4B25377A2A11C01700610219 /* UserText+NetworkProtectionExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B4D607C2A0B29FA00BCD287 /* UserText+NetworkProtectionExtensions.swift */; };
Expand Down Expand Up @@ -2508,6 +2514,8 @@
EEA3EEB12B24EBD000E8333A /* NetworkProtectionVPNCountryLabelsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEA3EEB02B24EBD000E8333A /* NetworkProtectionVPNCountryLabelsModel.swift */; };
EEA3EEB32B24EC0600E8333A /* VPNLocationViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEA3EEB22B24EC0600E8333A /* VPNLocationViewModel.swift */; };
EEAD7A7C2A1D3E20002A24E7 /* AppLauncher.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEAD7A6E2A1D3E1F002A24E7 /* AppLauncher.swift */; };
EEBCA0C62BD7CE2C004DF19C /* VPNFailureRecoveryPixel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEBCA0C52BD7CE2C004DF19C /* VPNFailureRecoveryPixel.swift */; };
EEBCA0C72BD7CE2C004DF19C /* VPNFailureRecoveryPixel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEBCA0C52BD7CE2C004DF19C /* VPNFailureRecoveryPixel.swift */; };
EEBCE6822BA444FA00B9DF00 /* XCUIElementExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = EEBCE6812BA444FA00B9DF00 /* XCUIElementExtension.swift */; };
EEBCE6832BA463DD00B9DF00 /* NSImageExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B139AFC26B60BD800894F82 /* NSImageExtensions.swift */; };
EEBCE6842BA4643200B9DF00 /* NSSizeExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = AAC5E4E325D6BA9C007F5990 /* NSSizeExtension.swift */; };
Expand Down Expand Up @@ -4006,6 +4014,7 @@
EEA3EEB02B24EBD000E8333A /* NetworkProtectionVPNCountryLabelsModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkProtectionVPNCountryLabelsModel.swift; sourceTree = "<group>"; };
EEA3EEB22B24EC0600E8333A /* VPNLocationViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VPNLocationViewModel.swift; sourceTree = "<group>"; };
EEAD7A6E2A1D3E1F002A24E7 /* AppLauncher.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppLauncher.swift; sourceTree = "<group>"; };
EEBCA0C52BD7CE2C004DF19C /* VPNFailureRecoveryPixel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VPNFailureRecoveryPixel.swift; sourceTree = "<group>"; };
EEBCE6812BA444FA00B9DF00 /* XCUIElementExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = XCUIElementExtension.swift; sourceTree = "<group>"; };
EEC111E3294D06020086524F /* JSAlert.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = JSAlert.storyboard; sourceTree = "<group>"; };
EEC111E5294D06290086524F /* JSAlertViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSAlertViewModel.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -4159,7 +4168,9 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
4B1EFF1C2BD71EEF007CC84F /* PixelKit in Frameworks */,
7B624F172BA25C1F00A6C544 /* NetworkProtectionUI in Frameworks */,
4B1EFF212BD72189007CC84F /* Networking in Frameworks */,
37269F052B3332C2005E8E46 /* Common in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -5123,6 +5134,7 @@
4B4D607D2A0B29FA00BCD287 /* NetworkExtensionTargets */ = {
isa = PBXGroup;
children = (
EEBCA0C12BD7CDDA004DF19C /* Pixels */,
4B41ED9F2B15437A001EEDF4 /* NetworkProtectionNotificationsPresenterFactory.swift */,
EEF12E6D2A2111880023E6BF /* MacPacketTunnelProvider.swift */,
7B0099802B65C6B300FE7C31 /* MacTransparentProxyProvider.swift */,
Expand Down Expand Up @@ -8073,6 +8085,14 @@
path = JSAlert;
sourceTree = "<group>";
};
EEBCA0C12BD7CDDA004DF19C /* Pixels */ = {
isa = PBXGroup;
children = (
EEBCA0C52BD7CE2C004DF19C /* VPNFailureRecoveryPixel.swift */,
);
path = Pixels;
sourceTree = "<group>";
};
EEBCE6802BA444FA00B9DF00 /* Common */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -8371,6 +8391,8 @@
packageProductDependencies = (
37269F042B3332C2005E8E46 /* Common */,
7B624F162BA25C1F00A6C544 /* NetworkProtectionUI */,
4B1EFF1B2BD71EEF007CC84F /* PixelKit */,
4B1EFF202BD72189007CC84F /* Networking */,
);
productName = DuckDuckGoNotifications;
productReference = 4B4BEC202A11B4E2001D9AC5 /* DuckDuckGo Notifications.app */;
Expand Down Expand Up @@ -10490,6 +10512,7 @@
4B25377A2A11C01700610219 /* UserText+NetworkProtectionExtensions.swift in Sources */,
B65DA5F42A77D3FA00CBEE8D /* BundleExtension.swift in Sources */,
EE66418D2B9B1981005BCD17 /* NetworkProtectionTokenStore+SubscriptionTokenKeychainStorage.swift in Sources */,
EEBCA0C72BD7CE2C004DF19C /* VPNFailureRecoveryPixel.swift in Sources */,
7B2E52252A5FEC09000C6D39 /* NetworkProtectionAgentNotificationsPresenter.swift in Sources */,
B602E8232A1E260E006D261F /* Bundle+NetworkProtectionExtensions.swift in Sources */,
4B2D062A2A11C0C900DE1F49 /* NetworkProtectionOptionKeyExtension.swift in Sources */,
Expand Down Expand Up @@ -10590,9 +10613,13 @@
4B4BEC432A11B5C7001D9AC5 /* Bundle+VPN.swift in Sources */,
4B4BEC452A11B5EE001D9AC5 /* UserText+NetworkProtectionExtensions.swift in Sources */,
4B4BEC422A11B5C7001D9AC5 /* NetworkProtectionOptionKeyExtension.swift in Sources */,
4B1EFF1D2BD71FCA007CC84F /* UserDefaultsWrapper.swift in Sources */,
B602E8222A1E2603006D261F /* Bundle+NetworkProtectionExtensions.swift in Sources */,
4B1EFF222BD7223D007CC84F /* NetworkProtectionPixelEvent.swift in Sources */,
B602E81A2A1E2570006D261F /* URL+NetworkProtection.swift in Sources */,
4B1EFF1F2BD72170007CC84F /* OptionalExtension.swift in Sources */,
EEAD7A7C2A1D3E20002A24E7 /* AppLauncher.swift in Sources */,
4B1EFF1E2BD72034007CC84F /* BundleExtension.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -10605,6 +10632,7 @@
4B4D609F2A0B2C7300BCD287 /* Logging.swift in Sources */,
EE66418C2B9B1981005BCD17 /* NetworkProtectionTokenStore+SubscriptionTokenKeychainStorage.swift in Sources */,
7B7DFB202B7E736B009EA1A3 /* MacPacketTunnelProvider.swift in Sources */,
EEBCA0C62BD7CE2C004DF19C /* VPNFailureRecoveryPixel.swift in Sources */,
4B4D60A12A0B2D6100BCD287 /* NetworkProtectionOptionKeyExtension.swift in Sources */,
B602E8182A1E2570006D261F /* URL+NetworkProtection.swift in Sources */,
B65DA5F52A77D3FA00CBEE8D /* BundleExtension.swift in Sources */,
Expand Down Expand Up @@ -12722,7 +12750,7 @@
repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = 141.1.2;
version = 142.0.0;
};
};
9FF521422BAA8FF300B9819B /* XCRemoteSwiftPackageReference "lottie-spm" */ = {
Expand Down Expand Up @@ -12958,6 +12986,16 @@
package = 9807F643278CA16F00E1547B /* XCRemoteSwiftPackageReference "BrowserServicesKit" */;
productName = Navigation;
};
4B1EFF1B2BD71EEF007CC84F /* PixelKit */ = {
isa = XCSwiftPackageProductDependency;
package = 9807F643278CA16F00E1547B /* XCRemoteSwiftPackageReference "BrowserServicesKit" */;
productName = PixelKit;
};
4B1EFF202BD72189007CC84F /* Networking */ = {
isa = XCSwiftPackageProductDependency;
package = 9807F643278CA16F00E1547B /* XCRemoteSwiftPackageReference "BrowserServicesKit" */;
productName = Networking;
};
4B2D062B2A11C0E100DE1F49 /* Networking */ = {
isa = XCSwiftPackageProductDependency;
package = 9807F643278CA16F00E1547B /* XCRemoteSwiftPackageReference "BrowserServicesKit" */;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/BrowserServicesKit",
"state" : {
"revision" : "f8c73292d4d6724ec81f98bd29dbb2061f1a8cf6",
"version" : "141.1.2"
"revision" : "2681b5271a4e0582f175771737617adb8a4d6e78",
"version" : "142.0.0"
}
},
{
Expand Down Expand Up @@ -120,7 +120,7 @@
{
"identity" : "swift-argument-parser",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-argument-parser",
"location" : "https://github.com/apple/swift-argument-parser.git",
"state" : {
"revision" : "46989693916f56d1186bd59ac15124caef896560",
"version" : "1.3.1"
Expand All @@ -138,7 +138,7 @@
{
"identity" : "swift-syntax",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-syntax.git",
"location" : "https://github.com/apple/swift-syntax",
"state" : {
"revision" : "64889f0c732f210a935a0ad7cda38f77f876262d",
"version" : "509.1.1"
Expand Down
52 changes: 43 additions & 9 deletions DuckDuckGo/Bookmarks/Services/LocalBookmarkStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -655,21 +655,37 @@ final class LocalBookmarkStore: BookmarkStore {
currentInsertionIndex > objectIndex {
adjustedInsertionIndex -= 1
}
let nextInsertionIndex = adjustedInsertionIndex + 1

bookmarkManagedObject.parent = nil

// Removing the bookmark from its current parent may have removed it from the collection it is about to be added to, so re-check
// the bounds before adding it back.
if adjustedInsertionIndex < newParentFolder.childrenArray.count {
newParentFolder.insertIntoChildren(bookmarkManagedObject, at: adjustedInsertionIndex)
// Handle stubs
let allChildren = (newParentFolder.children?.array as? [BookmarkEntity]) ?? []
if newParentFolder.childrenArray.count != allChildren.count {
var correctedIndex = 0

while adjustedInsertionIndex > 0 && correctedIndex < allChildren.count {
if allChildren[correctedIndex].isStub == false {
adjustedInsertionIndex -= 1
}
correctedIndex += 1
}
newParentFolder.insertIntoChildren(bookmarkManagedObject, at: correctedIndex)
} else {
newParentFolder.insertIntoChildren(bookmarkManagedObject, at: adjustedInsertionIndex)
}
} else {
newParentFolder.addToChildren(bookmarkManagedObject)
}

currentInsertionIndex = adjustedInsertionIndex + 1
currentInsertionIndex = nextInsertionIndex
}
}

// swiftlint:disable:next function_body_length
func moveFavorites(with objectUUIDs: [String], toIndex index: Int?, completion: @escaping (Error?) -> Void) {

applyChangesAndSave(changes: { [weak self] context in
Expand All @@ -692,27 +708,45 @@ final class LocalBookmarkStore: BookmarkStore {
return (try? context.fetch(entityFetchRequest))?.first
}

if let index = index, index < (displayedFavoritesFolder.favorites?.count ?? 0) {
if let index = index, index < displayedFavoritesFolder.favoritesArray.count {
var currentInsertionIndex = max(index, 0)

for bookmarkManagedObject in bookmarkManagedObjects {
var adjustedInsertionIndex = currentInsertionIndex

if let currentIndex = displayedFavoritesFolder.favorites?.index(of: bookmarkManagedObject),
if let currentIndex = displayedFavoritesFolder.favoritesArray.firstIndex(of: bookmarkManagedObject),
currentInsertionIndex > currentIndex {
adjustedInsertionIndex -= 1
}
let nextInsertionIndex = adjustedInsertionIndex + 1

bookmarkManagedObject.removeFromFavorites(with: favoritesDisplayMode)
if adjustedInsertionIndex < (displayedFavoritesFolder.favorites?.count ?? 0) {
bookmarkManagedObject.addToFavorites(insertAt: adjustedInsertionIndex,
favoritesRoot: displayedFavoritesFolder)
bookmarkManagedObject.addToFavorites(folders: favoritesFoldersWithoutDisplayed)

if adjustedInsertionIndex < displayedFavoritesFolder.favoritesArray.count {
// Handle stubs
let allChildren = (displayedFavoritesFolder.favorites?.array as? [BookmarkEntity]) ?? []
if displayedFavoritesFolder.favoritesArray.count != allChildren.count {
var correctedIndex = 0

while adjustedInsertionIndex > 0 && correctedIndex < allChildren.count {
if allChildren[correctedIndex].isStub == false {
adjustedInsertionIndex -= 1
}
correctedIndex += 1
}
bookmarkManagedObject.addToFavorites(insertAt: correctedIndex,
favoritesRoot: displayedFavoritesFolder)
bookmarkManagedObject.addToFavorites(folders: favoritesFoldersWithoutDisplayed)
} else {
bookmarkManagedObject.addToFavorites(insertAt: adjustedInsertionIndex,
favoritesRoot: displayedFavoritesFolder)
bookmarkManagedObject.addToFavorites(folders: favoritesFoldersWithoutDisplayed)
}
} else {
bookmarkManagedObject.addToFavorites(folders: favoritesFolders)
}

currentInsertionIndex = adjustedInsertionIndex + 1
currentInsertionIndex = nextInsertionIndex
}
} else {
for bookmarkManagedObject in bookmarkManagedObjects {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import BrowserServicesKit
final class AppPrivacyConfigurationDataProvider: EmbeddedDataProvider {

public struct Constants {
public static let embeddedDataETag = "\"7cf7b71adb62c3cbcbf8b84c61a0004d\""
public static let embeddedDataSHA = "20e9b59e7e60ccc9ae52853935ebe3d74227234fcf8b46da5a66cff3adc7e6c7"
public static let embeddedDataETag = "\"0cbf39995c17cfe7455c0ceff1b5d8cc\""
public static let embeddedDataSHA = "4e5495e24a27eba09553c335fc566bc694111e957faac6512093b76d3f585f71"
}

var embeddedDataEtag: String {
Expand Down
Loading

0 comments on commit 97e2f2c

Please sign in to comment.