Skip to content

Commit

Permalink
Merge branch 'brad/address-tab-feedback' into brad/close-all-left
Browse files Browse the repository at this point in the history
  • Loading branch information
SlayterDev committed Apr 19, 2024
2 parents a746a9a + b59493f commit 4b93941
Show file tree
Hide file tree
Showing 106 changed files with 2,657 additions and 670 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 = 166
CURRENT_PROJECT_VERSION = 169
93 changes: 92 additions & 1 deletion DuckDuckGo.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

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" : "4ce049682cb47a9fb510237070666e5e8bf1e07b",
"version" : "137.0.0"
"revision" : "b8f0e5db431c63943b509d522c157f870ef03ae0",
"version" : "138.0.0"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo/Application/URLEventHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ final class URLEventHandler {
case AppLaunchCommand.shareFeedback.launchURL:
WindowControllersManager.shared.showShareFeedbackModal()
case AppLaunchCommand.justOpen.launchURL:
WindowControllersManager.shared.showNewWindow()
WindowControllersManager.shared.showMainWindow()
case AppLaunchCommand.showVPNLocations.launchURL:
WindowControllersManager.shared.showPreferencesTab(withSelectedPane: .vpn)
WindowControllersManager.shared.showLocationPickerSheet()
Expand Down
6 changes: 6 additions & 0 deletions DuckDuckGo/Common/Extensions/NSPointExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ import Foundation

extension NSPoint {

func distance(to point: NSPoint) -> CGFloat {
let deltaX = self.x - point.x
let deltaY = self.y - point.y
return sqrt(deltaX * deltaX + deltaY * deltaY)
}

func isNearRect(_ rect: NSRect, allowedDistance: CGFloat) -> Bool {
let expandedRect = rect.insetBy(dx: -allowedDistance, dy: -allowedDistance)
return expandedRect.contains(self)
Expand Down
8 changes: 3 additions & 5 deletions DuckDuckGo/Common/Extensions/URLExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -557,10 +557,8 @@ extension URL {
return self.absoluteString
}

public func isChild(of url: URL) -> Bool {
var components = URLComponents(string: url.absoluteString)
components?.query = nil

return self.absoluteString.hasPrefix(components?.url?.absoluteString ?? url.absoluteString)
public func isChild(of parentURL: URL) -> Bool {
guard let parentURLHost = parentURL.host, self.isPart(ofDomain: parentURLHost) else { return false }
return pathComponents.starts(with: parentURL.pathComponents)
}
}
15 changes: 12 additions & 3 deletions DuckDuckGo/Common/Localizables/UserText+NetworkProtection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ extension UserText {
static let networkProtectionInviteSuccessMessage = "DuckDuckGo's VPN secures all of your device's Internet traffic anytime, anywhere."

// MARK: - Navigation Bar Status View
// "network.protection.navbar.status.view.share.feedback" - Menu item for 'Send VPN Feedback' in the VPN status view that's shown in the navigation bar
static let networkProtectionNavBarStatusViewShareFeedback = "Send VPN Feedback…"
// "network.protection.navbar.status.view.share.feedback" - Menu item for 'Share VPN Feedback' in the VPN status view that's shown in the navigation bar
static let networkProtectionNavBarStatusViewShareFeedback = "Share VPN Feedback…"
// "network.protection.status.menu.vpn.settings" - The status menu 'VPN Settings' menu item
static let networkProtectionNavBarStatusMenuVPNSettings = "VPN Settings…"
// "network.protection.status.menu.faq" - The status menu 'FAQ' menu item
Expand Down Expand Up @@ -299,7 +299,7 @@ extension UserText {
// "vpn.location.description.nearest" - Nearest city setting description
static let vpnLocationNearest = "Nearest"
// "vpn.location.description.nearest.available" - Nearest available location setting description
static let vpnLocationNearestAvailable = "Nearest available"
static let vpnLocationNearestAvailable = "Nearest Location"
// "vpn.location.nearest.available.title" - Subtitle underneath the nearest available vpn location preference text.
static let vpnLocationNearestAvailableSubtitle = "Automatically connect to the nearest server we can find."

Expand Down Expand Up @@ -330,6 +330,15 @@ extension UserText {
static let uninstallVPNAlertTitle = "Are you sure you want to uninstall the VPN?"
// "vpn.uninstall.alert.informative.text" - Informative text for the alert that comes up when the user decides to uninstall our VPN
static let uninstallVPNInformativeText = "Uninstalling the DuckDuckGo VPN will disconnect the VPN and remove it from your device."

// MARK: - VPN Screen
// "network.protection.vpn.location.nearest" - Description of the location type in the VPN status view
static let netPVPNLocationNearest = "(Nearest)"

// "network.protection.vpn.location.subtitle.formatted.city.and.country" - Subtitle for the preferred location item that formats a city and country. E.g Chicago, United States
static func netPVPNSettingsLocationSubtitleFormattedCityAndCountry(city: String, country: String) -> String {
return "\(city), \(country)"
}
}

#if DBP
Expand Down
9 changes: 3 additions & 6 deletions DuckDuckGo/Common/Localizables/UserText.swift
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,9 @@ struct UserText {
static let bitwardenError = NSLocalizedString("bitwarden.error", value: "Unable to find or connect to Bitwarden", comment: "This message appears when the application is unable to find or connect to Bitwarden, indicating a connection issue.")
static let bitwardenNotInstalled = NSLocalizedString("bitwarden.not.installed", value: "Bitwarden app is not installed", comment: "")
static let bitwardenOldVersion = NSLocalizedString("bitwarden.old.version", value: "Please update Bitwarden to the latest version", comment: "Message that warns user they need to update their password manager Bitwarden app vesion")
static let bitwardenIncompatible = NSLocalizedString("bitwarden.incompatible", value: "The following Bitwarden versions are incompatible with DuckDuckGo: v2024.3.0, v2024.3.2, v2024.4.0, v2024.4.1. Please revert to an older version by following these steps:", comment: "Message that warns user that specific Bitwarden app vesions are not compatible with this app")
static let bitwardenIncompatibleStep1 = NSLocalizedString("bitwarden.incompatible.step.1", value: "Download v2014.2.1", comment: "First step to downgrade Bitwarden")
static let bitwardenIncompatibleStep2 = NSLocalizedString("bitwarden.incompatible.step.2", value: "2. Open the downloaded DMG file and drag the Bitwarden application to\nthe /Applications folder.", comment: "Second step to downgrade Bitwarden")
static let bitwardenIntegrationNotApproved = NSLocalizedString("bitwarden.integration.not.approved", value: "Integration with DuckDuckGo is not approved in Bitwarden app", comment: "While the user tries to connect the DuckDuckGo Browser to password manager Bitwarden This message indicates that the integration with DuckDuckGo has not been approved in the Bitwarden app.")
static let bitwardenMissingHandshake = NSLocalizedString("bitwarden.missing.handshake", value: "Missing handshake", comment: "While the user tries to connect the DuckDuckGo Browser to password manager Bitwarden This message indicates a missing handshake (a way for two devices or systems to say hello to each other and agree to communicate or exchange information).")
static let bitwardenWaitingForHandshake = NSLocalizedString("bitwarden.waiting.for.handshake", value: "Waiting for the handshake approval in Bitwarden app", comment: "While the user tries to connect the DuckDuckGo Browser to password manager Bitwarden This message indicates the system is waiting for the handshake (a way for two devices or systems to say hello to each other and agree to communicate or exchange information).")
Expand Down Expand Up @@ -1031,23 +1034,17 @@ struct UserText {
static let newTabSetUpImportCardTitle = NSLocalizedString("newTab.setup.import.title", value: "Bring Your Stuff", comment: "Title of the Import card of the Set Up section in the home page")
static let newTabSetUpDuckPlayerCardTitle = NSLocalizedString("newTab.setup.duck.player.title", value: "Clean Up YouTube", comment: "Title of the Duck Player card of the Set Up section in the home page")
static let newTabSetUpEmailProtectionCardTitle = NSLocalizedString("newTab.setup.email.protection.title", value: "Protect Your Inbox", comment: "Title of the Email Protection card of the Set Up section in the home page")
static let newTabSetUpSurveyDay0CardTitle = NSLocalizedString("newTab.setup.survey.day.0.title", value: "Share Your Thoughts With Us", comment: "Title of the Day 0 durvey of the Set Up section in the home page")
static let newTabSetUpSurveyDay14CardTitle = NSLocalizedString("newTab.setup.survey.day.14.title", value: "Share Your Thoughts With Us", comment: "Title of the Day 14 durvey of the Set Up section in the home page")

static let newTabSetUpDefaultBrowserAction = NSLocalizedString("newTab.setup.default.browser.action", value: "Make Default Browser", comment: "Action title on the action menu of the Default Browser card")
static let newTabSetUpImportAction = NSLocalizedString("newTab.setup.Import.action", value: "Import Now", comment: "Action title on the action menu of the Import card of the Set Up section in the home page")
static let newTabSetUpDuckPlayerAction = NSLocalizedString("newTab.setup.duck.player.action", value: "Try Duck Player", comment: "Action title on the action menu of the Duck Player card of the Set Up section in the home page")
static let newTabSetUpEmailProtectionAction = NSLocalizedString("newTab.setup.email.protection.action", value: "Get a Duck Address", comment: "Action title on the action menu of the Email Protection card of the Set Up section in the home page")
static let newTabSetUpRemoveItemAction = NSLocalizedString("newTab.setup.remove.item", value: "Dismiss", comment: "Action title on the action menu of the set up cards card of the SetUp section in the home page to remove the item")
static let newTabSetUpSurveyDay0Action = NSLocalizedString("newTab.setup.survey.day.0.action", value: "Sign Up To Participate", comment: "Action title of the Day 0 survey of the Set Up section in the home page")
static let newTabSetUpSurveyDay14Action = NSLocalizedString("newTab.setup.survey.day.14.action", value: "Sign Up To Participate", comment: "Action title of the Day 14 survey of the Set Up section in the home page")

static let newTabSetUpDefaultBrowserSummary = NSLocalizedString("newTab.setup.default.browser.summary", value: "We automatically block trackers as you browse. It's privacy, simplified.", comment: "Summary of the Default Browser card")
static let newTabSetUpImportSummary = NSLocalizedString("newTab.setup.import.summary", value: "Import bookmarks, favorites, and passwords from your old browser.", comment: "Summary of the Import card of the Set Up section in the home page")
static let newTabSetUpDuckPlayerSummary = NSLocalizedString("newTab.setup.duck.player.summary", value: "Enjoy a clean viewing experience without personalized ads.", comment: "Summary of the Duck Player card of the Set Up section in the home page")
static let newTabSetUpEmailProtectionSummary = NSLocalizedString("newTab.setup.email.protection.summary", value: "Generate custom @duck.com addresses that clean trackers from incoming email.", comment: "Summary of the Email Protection card of the Set Up section in the home page")
static let newTabSetUpSurveyDay0Summary = NSLocalizedString("newTab.setup.survey.day.0.summary", value: "Join an interview with a member of our research team to help us build the best browser.", comment: "Summary of the card on the new tab page that invites users to partecipate to a survey")
static let newTabSetUpSurveyDay14Summary = NSLocalizedString("newTab.setup.survey.day.14.summary", value: "Join an interview with a member of our research team to help us build the best browser.", comment: "Summary of the card on the new tab page that invites users to partecipate to a survey")

// Recent Activity
static let newTabRecentActivitySectionTitle = NSLocalizedString("newTab.recent.activity.section.title", value: "Recent Activity", comment: "Title of the RecentActivity section in the home page")
Expand Down
7 changes: 2 additions & 5 deletions DuckDuckGo/Common/Utilities/UserDefaultsWrapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,8 @@ public struct UserDefaultsWrapper<T> {
case homePageShowImport = "home.page.show.import"
case homePageShowDuckPlayer = "home.page.show.duck.player"
case homePageShowEmailProtection = "home.page.show.email.protection"
case homePageShowSurveyDay0 = "home.page.show.survey.0"
case homePageShowSurveyDay0in10Percent = "home.page.show.survey.0.in.10.pervent"
case homePageShowSurveyDay14in10Percent = "home.page.show.survey.0.in.14.pervent"
case homePageUserInteractedWithSurveyDay0 = "home.page.user.interacted.with.survey.0"
case homePageShowSurveyDay14 = "home.page.show.survey.14"
case homePageUserInSurveyShare = "home.page.user.in.survey.share"
case homePageShowPermanentSurvey = "home.page.show.import.permanent.survey"
case homePageShowPageTitles = "home.page.show.page.titles"
case homePageShowRecentlyVisited = "home.page.show.recently.visited"
case homePageContinueSetUpImport = "home.page.continue.set.up.import"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ final class MockPrivacyConfiguration: PrivacyConfiguration {
func isUserUnprotected(domain: String?) -> Bool { false }
func isTempUnprotected(domain: String?) -> Bool { false }
func isInExceptionList(domain: String?, forFeature featureKey: PrivacyFeature) -> Bool { false }
func settings(for feature: PrivacyFeature) -> PrivacyConfigurationData.PrivacyFeature.FeatureSettings { featureSettings }
func settings(for feature: PrivacyFeature) -> PrivacyConfigurationData.PrivacyFeature.FeatureSettings {
featureSettings }
func userEnabledProtection(forDomain: String) {}
func userDisabledProtection(forDomain: String) {}
}
Expand Down
4 changes: 3 additions & 1 deletion DuckDuckGo/DBP/DBPHomeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,9 @@ public class DataBrokerProtectionPixelsHandler: EventMapping<DataBrokerProtectio
.scanningEventReAppearance,
.webUILoadingFailed,
.webUILoadingStarted,
.webUILoadingSuccess:
.webUILoadingSuccess,
.emptyAccessTokenDaily,
.generateEmailHTTPErrorDaily:
PixelKit.fire(event)
}
}
Expand Down
4 changes: 4 additions & 0 deletions DuckDuckGo/DBP/DataBrokerProtectionLoginItemScheduler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ extension DataBrokerProtectionLoginItemScheduler: DataBrokerProtectionScheduler
completion: ((DataBrokerProtectionSchedulerErrorCollection?) -> Void)?) {
ipcScheduler.runQueuedOperations(showWebView: showWebView, completion: completion)
}

func getDebugMetadata(completion: @escaping (DBPBackgroundAgentMetadata?) -> Void) {
ipcScheduler.getDebugMetadata(completion: completion)
}
}

#endif
Loading

0 comments on commit 4b93941

Please sign in to comment.