Skip to content

Commit

Permalink
update fe onboarding (#3415)
Browse files Browse the repository at this point in the history
Task/Issue URL: https://app.asana.com/0/0/1208077416568652/f

**Description**: Adds modification to the import dialog (reviewed in
another PR), updates to use the new front end onboarding, re-set up the
experiment
  • Loading branch information
SabrinaTardio authored Oct 28, 2024
1 parent cb1122b commit b305224
Show file tree
Hide file tree
Showing 30 changed files with 575 additions and 49 deletions.
2 changes: 1 addition & 1 deletion DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -14498,7 +14498,7 @@
repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = 200.2.1;
version = 200.3.0;
};
};
9FF521422BAA8FF300B9819B /* XCRemoteSwiftPackageReference "lottie-spm" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/BrowserServicesKit",
"state" : {
"revision" : "fdf6f75d570a5ef6058efa881e11f9467627fbf4",
"version" : "200.2.1"
"revision" : "44d747d56bc73cb74de0e9d7127314ea30eca371",
"version" : "200.3.0"
}
},
{
"identity" : "content-scope-scripts",
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/content-scope-scripts",
"state" : {
"revision" : "1ed569676555d493c9c5575eaed22aa02569aac9",
"version" : "6.19.0"
"revision" : "b74549bd869fdecc16fad851f2f608b1724764df",
"version" : "6.25.0"
}
},
{
Expand Down Expand Up @@ -75,7 +75,7 @@
{
"identity" : "lottie-spm",
"kind" : "remoteSourceControl",
"location" : "https://github.com/airbnb/lottie-spm.git",
"location" : "https://github.com/airbnb/lottie-spm",
"state" : {
"revision" : "1d29eccc24cc8b75bff9f6804155112c0ffc9605",
"version" : "4.4.3"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "Success-96x96.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion DuckDuckGo/Common/Localizables/UserText.swift
Original file line number Diff line number Diff line change
Expand Up @@ -472,10 +472,12 @@ struct UserText {
static let importPasswords = NSLocalizedString("import.browser.data.passwords", value: "Import Passwords…", comment: "Opens Import Browser Data dialog")

static let importDataTitle = NSLocalizedString("import.browser.data", value: "Import to DuckDuckGo", comment: "Import Browser Data dialog title")
static let importDataTitleOnboarding = NSLocalizedString("import.browser.data.onboarding", value: "Great, let’s keep this simple!", comment: "Import Browser Data dialog title")
static let importDataShortcutsTitle = NSLocalizedString("import.browser.data.shortcuts", value: "Almost done!", comment: "Import Browser Data dialog title for final stage when choosing shortcuts to enable")
static let importDataShortcutsSubtitle = NSLocalizedString("import.browser.data.shortcuts.subtitle", value: "You can always right-click on the browser toolbar to find more shortcuts like these.", comment: "Subtitle explaining how users can find toolbar shortcuts.")
static let importDataSourceTitle = NSLocalizedString("import.browser.data.source.title", value: "Import From", comment: "Import Browser Data title for option to choose source browser to import from")
static let importDataSourceTitle = NSLocalizedString("import.browser.data.source.title", value: "Where do you want to import from?", comment: "Import Browser Data title for option to choose source browser to import from")
static let importDataSubtitle = NSLocalizedString("import.browser.data.source.subtitle", value: "Access and manage your passwords in DuckDuckGo Settings > Passwords & Autofill.", comment: "Subtitle explaining where users can find imported passwords.")
static let importDataSuccessTitle = NSLocalizedString("import.browser.data.success.title", value: "Import complete!", comment: "message about Passwords and or bookmarks Data Import completion")

static let exportLogins = NSLocalizedString("export.logins.data", value: "Export Passwords…", comment: "Opens Export Logins Data dialog")
static let exportBookmarks = NSLocalizedString("export.bookmarks.menu.item", value: "Export Bookmarks…", comment: "Export bookmarks menu item")
Expand Down
4 changes: 4 additions & 0 deletions DuckDuckGo/DataImport/Model/DataImportViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,10 @@ extension DataImportViewModel {
return DataImportViewSummarizedError(errors: errors)
}

var hasAnySummaryError: Bool {
!summary.allSatisfy { $0.result.isSuccess }
}

private static func requestPrimaryPasswordCallback(_ source: DataImport.Source) -> String? {
let alert = NSAlert.passwordRequiredAlert(source: source)
let response = alert.runModal()
Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo/DataImport/View/DataImportTypePicker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct DataImportTypePicker: View {

var body: some View {
VStack(alignment: .leading) {
Text("Select Data to Import:",
Text("What do you want to import?",
comment: "Data Import section title for checkboxes of data type to import: Passwords or Bookmarks.")

ForEach(DataImport.DataType.allCases, id: \.self) { dataType in
Expand Down
27 changes: 23 additions & 4 deletions DuckDuckGo/DataImport/View/DataImportView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ struct DataImportView: ModalView {

@Environment(\.dismiss) private var dismiss

@State var model = DataImportViewModel()
@State var model: DataImportViewModel
let title: String

init(model: DataImportViewModel = DataImportViewModel(), title: String = UserText.importDataTitle) {
self._model = State(initialValue: model)
self.title = title
}

struct ProgressState {
let text: String?
Expand Down Expand Up @@ -76,14 +82,27 @@ struct DataImportView: ModalView {
}

private func viewHeader() -> some View {
VStack(alignment: .leading, spacing: 0) {
if case .shortcuts = model.screen {
return VStack(alignment: .leading, spacing: 0) {
// If there are no errors show summary success header
if case .summary = model.screen, !model.hasAnySummaryError {
VStack(alignment: .leading) {
Image(.success96)
Text(UserText.importDataSuccessTitle)
.foregroundColor(.primary)
.font(.system(size: 17, weight: .bold))
}
.padding(.bottom, 16)
} else if case .shortcuts = model.screen {
Text(UserText.importDataShortcutsTitle)
.font(.title2.weight(.semibold))
.padding(.bottom, 24)

} else {
Text(UserText.importDataTitle)
// If screen is not the first screen where the user choose the type of import they want to do show the generic title.
// Otherwise show the injected title.
let title = model.screen == .profileAndDataTypesPicker ? self.title : UserText.importDataTitle

Text(title)
.font(.title2.weight(.semibold))
.padding(.bottom, 24)

Expand Down
6 changes: 3 additions & 3 deletions DuckDuckGo/FeatureFlagging/Model/FeatureFlag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public enum FeatureFlag: String {
// https://app.asana.com/0/1206488453854252/1207136666798700/f
case freemiumPIR

case highlightsOnboarding
case contextualOnboarding

// https://app.asana.com/0/1201462886803403/1208030658792310/f
case unknownUsernameCategorization
Expand Down Expand Up @@ -60,8 +60,8 @@ extension FeatureFlag: FeatureFlagSourceProviding {
return .remoteReleasable(.subfeature(PhishingDetectionSubfeature.allowErrorPage))
case .phishingDetectionPreferences:
return .remoteReleasable(.subfeature(PhishingDetectionSubfeature.allowPreferencesToggle))
case .highlightsOnboarding:
return .internalOnly
case .contextualOnboarding:
return .remoteReleasable(.feature(.contextualOnboarding))
case .credentialsImportPromotionForExistingUsers:
return .remoteReleasable(.subfeature(AutofillSubfeature.credentialsImportPromotionForExistingUsers))
case .networkProtectionUserTips:
Expand Down
Loading

0 comments on commit b305224

Please sign in to comment.