From 4940afbbf9ae7d972112ff293c39505867ab367d Mon Sep 17 00:00:00 2001 From: Diego Rey Mendez Date: Fri, 13 Dec 2024 12:46:36 -0300 Subject: [PATCH] WIP --- Core/PixelEvent.swift | 4 ++-- DuckDuckGo.xcodeproj/project.pbxproj | 2 ++ .../xcshareddata/swiftpm/Package.resolved | 9 --------- .../NetworkProtectionVPNSettingsView.swift | 2 +- DuckDuckGo/Siri/SiriBubbleView.swift | 11 ++++++----- DuckDuckGo/Siri/SiriEducationView.swift | 10 +++++----- .../ViewModel/SubscriptionFlowViewModel.swift | 1 - DuckDuckGo/UserText.swift | 18 +++++++++--------- .../NumberedParagraphView.swift | 8 +++++--- .../Contents.json | 10 +++++----- DuckDuckGo/en.lproj/Localizable.strings | 16 ++++++++-------- .../Contents.json | 3 +++ .../Contents.json | 3 +++ 13 files changed, 49 insertions(+), 48 deletions(-) diff --git a/Core/PixelEvent.swift b/Core/PixelEvent.swift index 5fc44638c9..ef185fb0b6 100644 --- a/Core/PixelEvent.swift +++ b/Core/PixelEvent.swift @@ -1360,9 +1360,9 @@ extension Pixel.Event { case .remoteMessagePrimaryActionClicked: return "m_remote_message_primary_action_clicked" case .remoteMessageSecondaryActionClicked: return "m_remote_message_secondary_action_clicked" case .remoteMessageSheet: return "m_remote_message_sheet" - + // MARK: debug pixels - + case .dbCrashDetected: return "m_d_crash" case .crashOnCrashHandlersSetUp: return "m_d_crash_on_handlers_setup" case .dbMigrationError: return "m_d_dbme" diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index e9b99db64c..fb60d487f5 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -1726,6 +1726,7 @@ 7B1604EB2CB68BDA00A44EC6 /* TipKitController+ConvenienceInitializers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "TipKitController+ConvenienceInitializers.swift"; sourceTree = ""; }; 7B1604ED2CB68D2600A44EC6 /* TipKitDebugOptionsUIActionHandling.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TipKitDebugOptionsUIActionHandling.swift; sourceTree = ""; }; 7B1C892B2CF714AA0008224E /* VPNTipsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPNTipsModel.swift; sourceTree = ""; }; + 7B1D7A912D0C723B00E48644 /* DesignResourcesKit */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = DesignResourcesKit; path = ../DesignResourcesKit; sourceTree = SOURCE_ROOT; }; 7B4DC5BC2CB29D8400EE5CC2 /* VPNToggleIntent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPNToggleIntent.swift; sourceTree = ""; }; 7B4DC5BF2CB2A4A500EE5CC2 /* VPNStatusValueProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPNStatusValueProvider.swift; sourceTree = ""; }; 7B4DC5C12CB2AE4600EE5CC2 /* WidgetKind.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WidgetKind.swift; sourceTree = ""; }; @@ -3766,6 +3767,7 @@ 31E69A60280F4BAD00478327 /* LocalPackages */ = { isa = PBXGroup; children = ( + 7B1D7A912D0C723B00E48644 /* DesignResourcesKit */, 85875B5F29912A2D00115F05 /* SyncUI */, 37FCAACB2993149A000E420A /* Waitlist */, 31794BFF2821DFB600F18633 /* DuckUI */, diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index fbf8a01291..5c50af5397 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -45,15 +45,6 @@ "version" : "6.41.0" } }, - { - "identity" : "designresourceskit", - "kind" : "remoteSourceControl", - "location" : "https://github.com/duckduckgo/DesignResourcesKit", - "state" : { - "revision" : "ad133f76501edcb2bfa841e33aebc0da5f92bb5c", - "version" : "3.3.0" - } - }, { "identity" : "duckduckgo-autofill", "kind" : "remoteSourceControl", diff --git a/DuckDuckGo/NetworkProtectionVPNSettingsView.swift b/DuckDuckGo/NetworkProtectionVPNSettingsView.swift index b47d5e9259..5be879b0bf 100644 --- a/DuckDuckGo/NetworkProtectionVPNSettingsView.swift +++ b/DuckDuckGo/NetworkProtectionVPNSettingsView.swift @@ -164,7 +164,7 @@ struct NetworkProtectionVPNSettingsView: View { if #available(iOS 18.0, *) { NavigationLink { - ControlCenterWidgetEducationView(navBarTitle: "Control Center", + ControlCenterWidgetEducationView(navBarTitle: "Add DuckDuckGo VPN Shortcut to Your Control Center", widget: .vpnToggle) } label: { Label { diff --git a/DuckDuckGo/Siri/SiriBubbleView.swift b/DuckDuckGo/Siri/SiriBubbleView.swift index 3b588e2c93..5de3b184dd 100644 --- a/DuckDuckGo/Siri/SiriBubbleView.swift +++ b/DuckDuckGo/Siri/SiriBubbleView.swift @@ -17,6 +17,7 @@ // limitations under the License. // +import DesignResourcesKit import SwiftUICore private struct SiriBubble: Shape { @@ -60,15 +61,15 @@ struct SiriBubbleView: View { } var body: some View { - HStack { + HStack(alignment: .center) { Text(text) - .foregroundStyle(Color.black) - - Spacer() + .foregroundStyle(Color(designSystemColor: .textPrimary)) + .multilineTextAlignment(.center) }.padding(12) .padding(.bottom, SiriBubble.tipHeight) + .frame(maxWidth: .infinity) .background(SiriBubble() - .fill(Color.white) + .fill(Color(designSystemColor: .surface)) .shadow(color: .black.opacity(0.08), radius: 8, x: 0, y: 8) .shadow(color: .black.opacity(0.1), radius: 3, x: 0, y: 2)) } diff --git a/DuckDuckGo/Siri/SiriEducationView.swift b/DuckDuckGo/Siri/SiriEducationView.swift index 30b8d37487..28d1dff8b3 100644 --- a/DuckDuckGo/Siri/SiriEducationView.swift +++ b/DuckDuckGo/Siri/SiriEducationView.swift @@ -61,12 +61,12 @@ struct SiriEducationView: View { .resizable() .frame(maxWidth: 128) - Text("Control DuckDuckGo VPN with Siri") + Text("Control DuckDuckGo VPN with Siri!") .font(.system(size: 22, weight: .bold, design: .default)) .kerning(0.35) .multilineTextAlignment(.center) - Text("Siri Shortcuts let you connect to your VPN with a quick voice command, like saying “Connect DuckDuckgo VPN” to Siri. It’s a fast, hands-free way to use the VPN.") + Text("Siri Shortcuts let you connect to your VPN with a quick voice command, like “Siri, turn on DuckDuckGo VPN”. It’s a fast, hands-free way to use your VPN.") .font(.system(size: 16, weight: .regular)) .multilineTextAlignment(.center) } @@ -74,11 +74,11 @@ struct SiriEducationView: View { .padding(.horizontal, Spacing.sidesToContent) VStack(alignment: .leading, spacing: 16) { - SiriBubbleView("\"Siri, snooze DuckDuckGo VPN.\"") + SiriBubbleView("Siri, snooze DuckDuckGo VPN.") - SiriBubbleView("\"Siri, enable DuckDuckGo VPN.\"") + SiriBubbleView("Siri, enable DuckDuckGo VPN.") - SiriBubbleView("\"Siri, protect my device with DuckDuckGo.\"") + SiriBubbleView("Siri, protect my device with DuckDuckGo.") } .padding(.top, Spacing.headerToList) .padding(.horizontal, Spacing.sidesToContent) diff --git a/DuckDuckGo/Subscription/ViewModel/SubscriptionFlowViewModel.swift b/DuckDuckGo/Subscription/ViewModel/SubscriptionFlowViewModel.swift index 5dc11256ab..d956ba5dcb 100644 --- a/DuckDuckGo/Subscription/ViewModel/SubscriptionFlowViewModel.swift +++ b/DuckDuckGo/Subscription/ViewModel/SubscriptionFlowViewModel.swift @@ -141,7 +141,6 @@ final class SubscriptionFlowViewModel: ObservableObject { } } .store(in: &cancellables) - } @MainActor diff --git a/DuckDuckGo/UserText.swift b/DuckDuckGo/UserText.swift index 36bf821203..66a5ccb4a4 100644 --- a/DuckDuckGo/UserText.swift +++ b/DuckDuckGo/UserText.swift @@ -337,9 +337,9 @@ public struct UserText { public static let addWidget = NSLocalizedString("addWidget.button", value: "Add Widget", comment: "") public static let addWidgetTitle = NSLocalizedString("addWidget.title", value: "One tap to your favorite sites.", comment: "") public static let addWidgetDescription = NSLocalizedString("addWidget.description", value: "Get quick access to private search and the sites you love.", comment: "") - public static let addWidgetSettingsFirstParagraph = NSLocalizedString("addWidget.settings.firstParagraph", value: "Long-press on the home screen until the apps jiggle.", comment: "") - public static let addWidgetSettingsSecondParagraph = NSLocalizedString("addWidget.settings.secondParagraph", value: "Tap the “Edit” button, then choose “Add Widget”.", comment: "") - public static let addWidgetSettingsThirdParagraph = NSLocalizedString("addWidget.settings.title", value: "Find and select DuckDuckGo. Then swipe to VPN and select Add Widget.", comment: "") + public static let addWidgetSettingsFirstParagraph = NSLocalizedString("addWidget.settings.firstParagraph", value: "Long-press anywhere on the Home Screen until the apps jiggle", comment: "") + public static let addWidgetSettingsSecondParagraph = NSLocalizedString("addWidget.settings.secondParagraph", value: "Tap the **Edit** button, then choose **Add Widget**", comment: "") + public static let addWidgetSettingsThirdParagraph = NSLocalizedString("addWidget.settings.title", value: "Find and select **DuckDuckGo**. Then choose a widget.", comment: "") public static let actionSaveToDownloads = NSLocalizedString("downloads.alert.action.save-to-downloads", value: "Save to Downloads", comment: "Alert action for starting a file dowload") public static func messageDownloadStarted(for filename: String) -> String { @@ -449,13 +449,13 @@ public struct UserText { // MARK: - Control Center Widget Education - public static let controlCenterWidgetEducationParagraph1 = NSLocalizedString("control.center.widget.education.paragraph.1", value: "Swipe down from the top-right corner of the screen.", comment: "First paragraph of the Control Center Widget Education screen") - public static let controlCenterWidgetEducationParagraph2 = NSLocalizedString("control.center.widget.education.paragraph.2", value: "Tap the “+” button at the top left of Control Center.", comment: "Second paragraph of the Control Center Widget Education screen") - public static let controlCenterWidgetEducationParagraph3 = NSLocalizedString("control.center.widget.education.paragraph.3", value: "Tap “+ Add a Control” at the bottom of the screen.", comment: "Third paragraph of the Control Center Widget Education screen") + public static let controlCenterWidgetEducationParagraph1 = NSLocalizedString("control.center.widget.education.paragraph.1", value: "Swipe down from the top-right corner of the screen", comment: "First paragraph of the Control Center Widget Education screen") + public static let controlCenterWidgetEducationParagraph2 = NSLocalizedString("control.center.widget.education.paragraph.2", value: "Tap the **+** button at the top left of **Control Center**", comment: "Second paragraph of the Control Center Widget Education screen") + public static let controlCenterWidgetEducationParagraph3 = NSLocalizedString("control.center.widget.education.paragraph.3", value: "Tap **Add a Control** at the bottom of the screen", comment: "Third paragraph of the Control Center Widget Education screen") // MARK: - Control Center Widget Education: VPN - public static let controlCenterVPNWidgetEducationParagraph = NSLocalizedString("control.center.vpn.widget.education.paragraph", value: "Find DuckDuckGo in the list, then tap the VPN control to add it to your Control Center.", comment: "Fourth paragraph of the Control Center VPN Widget Education screen") + public static let controlCenterVPNWidgetEducationParagraph = NSLocalizedString("control.center.vpn.widget.education.paragraph", value: "Find **DuckDuckGo** in the list, then tap **VPN control** to add it", comment: "Fourth paragraph of the Control Center VPN Widget Education screen") // MARK: - Waitlist @@ -675,11 +675,11 @@ public struct UserText { public static let vpnSettingsAddWidget = NSLocalizedString("vpn.settings.add.widget", value: "Add VPN Widget to Home Screen", comment: "VPN settings screen cell text for adding the VPN widget to the home screen") public static let vpnSettingsAddControlCenterWidget = NSLocalizedString("vpn.settings.add.control-center.widget", value: "Add VPN to Control Center", comment: "VPN settings screen cell text for adding the VPN widget to the control center") - public static let vpnSettingsControlWithSiri = NSLocalizedString("vpn.settings.control.with.siri", value: "Control with Siri", comment: "VPN settings screen cell text to learn how to control the VPN with Siri") + public static let vpnSettingsControlWithSiri = NSLocalizedString("vpn.settings.control.with.siri", value: "Control VPN With Siri", comment: "VPN settings screen cell text to learn how to control the VPN with Siri") // MARK: - VPN Widget - public static let addVPNWidgetSettingsThirdParagraph = NSLocalizedString("vpn.addWidget.settings.title", value: "Find and select DuckDuckGo. Then swipe to VPN and select Add Widget.", comment: "Title for the VPN widget onboarding screen") + public static let addVPNWidgetSettingsThirdParagraph = NSLocalizedString("vpn.addWidget.settings.title", value: "Find and select **DuckDuckGo**, then swipe to **VPN** and select **Add Widget**", comment: "Title for the VPN widget onboarding screen") // MARK: Custom DNS diff --git a/DuckDuckGo/Widgets/Education/NumberedParagraphView/NumberedParagraphView.swift b/DuckDuckGo/Widgets/Education/NumberedParagraphView/NumberedParagraphView.swift index e284fefad5..079f16bfd7 100644 --- a/DuckDuckGo/Widgets/Education/NumberedParagraphView/NumberedParagraphView.swift +++ b/DuckDuckGo/Widgets/Education/NumberedParagraphView/NumberedParagraphView.swift @@ -76,7 +76,9 @@ private struct NumberedParagraph: View { NumberedCircle(number: number) VStack(alignment: .leading, spacing: Const.Spacing.textAndImage) { HStack { - Text(config.text) + // The LocalizedStringKey wrapper is necessary to properly parse markdown + Text(LocalizedStringKey(config.text)) + .foregroundStyle(Color(designSystemColor: .textPrimary)) .font(Font(uiFont: Const.Font.text)) .lineSpacing(Const.Spacing.line) @@ -124,8 +126,8 @@ private struct NumberedCircle: View { } private extension Color { - static let circle = Color.blue0 - static let numbers = Color.blueBase + static let circle = Color(designSystemColor: .textSelectionFill) + static let numbers = Color(designSystemColor: .textLink) } private enum Const { diff --git a/DuckDuckGo/Widgets/Education/WidgetEducation.xcassets/Colors/controlCenterWidgetBackground.colorset/Contents.json b/DuckDuckGo/Widgets/Education/WidgetEducation.xcassets/Colors/controlCenterWidgetBackground.colorset/Contents.json index 8b549e3d48..56e647db3c 100644 --- a/DuckDuckGo/Widgets/Education/WidgetEducation.xcassets/Colors/controlCenterWidgetBackground.colorset/Contents.json +++ b/DuckDuckGo/Widgets/Education/WidgetEducation.xcassets/Colors/controlCenterWidgetBackground.colorset/Contents.json @@ -5,9 +5,9 @@ "color-space" : "srgb", "components" : { "alpha" : "1.000", - "blue" : "0x83", + "blue" : "0x87", "green" : "0x83", - "red" : "0x83" + "red" : "0x81" } }, "idiom" : "universal" @@ -23,9 +23,9 @@ "color-space" : "srgb", "components" : { "alpha" : "1.000", - "blue" : "0x13", - "green" : "0x13", - "red" : "0x13" + "blue" : "0x87", + "green" : "0x83", + "red" : "0x81" } }, "idiom" : "universal" diff --git a/DuckDuckGo/en.lproj/Localizable.strings b/DuckDuckGo/en.lproj/Localizable.strings index 2bf9b37de1..19cce5fe6f 100644 --- a/DuckDuckGo/en.lproj/Localizable.strings +++ b/DuckDuckGo/en.lproj/Localizable.strings @@ -125,13 +125,13 @@ "addWidget.description" = "Get quick access to private search and the sites you love."; /* No comment provided by engineer. */ -"addWidget.settings.firstParagraph" = "Long-press on the home screen until the apps jiggle."; +"addWidget.settings.firstParagraph" = "Long-press anywhere on the Home Screen until the apps jiggle"; /* No comment provided by engineer. */ -"addWidget.settings.secondParagraph" = "Tap the “Edit” button, then choose “Add Widget”."; +"addWidget.settings.secondParagraph" = "Tap the **Edit** button, then choose **Add Widget**"; /* No comment provided by engineer. */ -"addWidget.settings.title" = "Find and select DuckDuckGo. Then swipe to VPN and select Add Widget."; +"addWidget.settings.title" = "Find and select **DuckDuckGo**. Then choose a widget."; /* No comment provided by engineer. */ "addWidget.title" = "One tap to your favorite sites."; @@ -873,16 +873,16 @@ "contextual.onboarding.try-search.surprise-me-title" = "Surprise me!"; /* Fourth paragraph of the Control Center VPN Widget Education screen */ -"control.center.vpn.widget.education.paragraph" = "Find DuckDuckGo in the list, then tap the VPN control to add it to your Control Center."; +"control.center.vpn.widget.education.paragraph" = "Find **DuckDuckGo** in the list, then tap **VPN control** to add it"; /* First paragraph of the Control Center Widget Education screen */ -"control.center.widget.education.paragraph.1" = "Swipe down from the top-right corner of the screen."; +"control.center.widget.education.paragraph.1" = "Swipe down from the top-right corner of the screen"; /* Second paragraph of the Control Center Widget Education screen */ -"control.center.widget.education.paragraph.2" = "Tap the “+” button at the top left of Control Center."; +"control.center.widget.education.paragraph.2" = "Tap the **+** button at the top left of **Control Center**"; /* Third paragraph of the Control Center Widget Education screen */ -"control.center.widget.education.paragraph.3" = "Tap “+ Add a Control” at the bottom of the screen."; +"control.center.widget.education.paragraph.3" = "Tap **Add a Control** at the bottom of the screen"; /* Crash Report always send button title */ "crash.report.dialog.always.send" = "Always Send Crash Reports"; @@ -2842,7 +2842,7 @@ But if you *do* want a peek under the hood, you can find more information about "vpn.access-revoked.alert.title" = "VPN disconnected due to expired subscription"; /* Title for the VPN widget onboarding screen */ -"vpn.addWidget.settings.title" = "Find and select DuckDuckGo. Then swipe to VPN and select Add Widget."; +"vpn.addWidget.settings.title" = "Find and select **DuckDuckGo**, then swipe to **VPN** and select **Add Widget**"; /* Title for the Cancel button of the VPN feedback form */ "vpn.feedback-form.button.cancel" = "Cancel"; diff --git a/Widgets/WidgetsShared.xcassets/SFSymbols/ControlCenter-VPN-off.symbolset/Contents.json b/Widgets/WidgetsShared.xcassets/SFSymbols/ControlCenter-VPN-off.symbolset/Contents.json index 3332d2eacf..87a30f4e23 100644 --- a/Widgets/WidgetsShared.xcassets/SFSymbols/ControlCenter-VPN-off.symbolset/Contents.json +++ b/Widgets/WidgetsShared.xcassets/SFSymbols/ControlCenter-VPN-off.symbolset/Contents.json @@ -3,6 +3,9 @@ "author" : "xcode", "version" : 1 }, + "properties" : { + "symbol-rendering-intent" : "template" + }, "symbols" : [ { "filename" : "VPN-Off.svg", diff --git a/Widgets/WidgetsShared.xcassets/SFSymbols/ControlCenter-VPN-on.symbolset/Contents.json b/Widgets/WidgetsShared.xcassets/SFSymbols/ControlCenter-VPN-on.symbolset/Contents.json index 7650ae7485..3cf25de919 100644 --- a/Widgets/WidgetsShared.xcassets/SFSymbols/ControlCenter-VPN-on.symbolset/Contents.json +++ b/Widgets/WidgetsShared.xcassets/SFSymbols/ControlCenter-VPN-on.symbolset/Contents.json @@ -3,6 +3,9 @@ "author" : "xcode", "version" : 1 }, + "properties" : { + "symbol-rendering-intent" : "template" + }, "symbols" : [ { "filename" : "VPN-On.svg",