Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data Import ux redo #1754

Merged
merged 96 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
988dbc8
Add new browser import sources
mallexxx Oct 9, 2023
5cdfa77
fix tests
mallexxx Oct 9, 2023
b1ee94a
Bitwarden source, Refactor CSV parser, improve column detection
mallexxx Oct 9, 2023
a64117c
minor cleanup
mallexxx Oct 9, 2023
8521ae3
cleanup
mallexxx Oct 9, 2023
24a24ac
Add Passwords import as CSV step to Yandex
mallexxx Oct 10, 2023
4d21895
rename ChromiumPreferences
mallexxx Oct 10, 2023
b60be62
handle ImportError separately in DataImportViewController
mallexxx Oct 10, 2023
748c285
rename ChromiumPreferences in pbxproj
mallexxx Oct 10, 2023
e7a5566
fix browser isInstalled detection
mallexxx Oct 10, 2023
fc03dd1
Fix a glitch on switching import button state when changing import so…
mallexxx Oct 10, 2023
bafd5e7
Merge remote-tracking branch 'origin/develop' into alex/new-import-br…
mallexxx Oct 10, 2023
620a01e
Merge branch 'alex/new-import-browsers' into alex/improve-import-info
mallexxx Oct 12, 2023
46de2a9
Merge branch 'alex/new-import-csv' into alex/improve-import-info
mallexxx Oct 12, 2023
491a801
Disable import passwords/bookmarks checkboxes if data file not found
mallexxx Oct 12, 2023
fb55c63
fix tests
mallexxx Oct 12, 2023
8f4531c
Merge remote-tracking branch 'origin/develop' into alex/improve-impor…
mallexxx Nov 6, 2023
c642307
Merge branch 'develop' into alex/new-import-browsers
mallexxx Nov 17, 2023
c50b7f0
Bitwarden source, Refactor CSV parser, improve column detection (#1740)
mallexxx Nov 17, 2023
1358f18
Merge remote-tracking branch 'origin/develop' into alex/improve-impor…
mallexxx Nov 17, 2023
74d8c5b
Merge remote-tracking branch 'origin/alex/new-import-browsers' into a…
mallexxx Nov 17, 2023
5348e1e
New Data Import UX in SwiftUI
mallexxx Nov 17, 2023
7a6cb40
show summary if all sources succeeded; disable Select file button whe…
mallexxx Nov 17, 2023
ea33df9
fix CSV, 1Password 8 selection in picker; Remove Skip button for file…
mallexxx Nov 17, 2023
795c1dc
fix build
mallexxx Nov 17, 2023
278820a
cleanup
mallexxx Nov 17, 2023
5b28b0e
refactor data import feedback
mallexxx Nov 20, 2023
0771496
fix typo
mallexxx Nov 20, 2023
552d318
fix pbxproj
mallexxx Nov 20, 2023
8848513
fix typo
mallexxx Nov 20, 2023
76025c2
remove source arg from Importers
mallexxx Nov 21, 2023
132f3fd
fix tests
mallexxx Nov 21, 2023
32d92f4
fix linter issues
mallexxx Nov 21, 2023
e00d76b
update CSV import source name
mallexxx Nov 21, 2023
e64a46a
fix build
mallexxx Nov 21, 2023
1ed18de
fix invalid profile folders shown for tor/firefox
mallexxx Nov 21, 2023
76d28f0
allow file drop on file import button
mallexxx Nov 22, 2023
3e78e35
code adjustment; handle chromium userDeniedKeychainPrompt
mallexxx Nov 23, 2023
627e442
rollback unneded pbxproj changes
mallexxx Nov 23, 2023
c726e5c
rollback failing test
mallexxx Nov 23, 2023
cf0b6fa
Validate profiles data in profile picker
mallexxx Nov 24, 2023
ff589e1
adjust data import view after ship review
mallexxx Nov 24, 2023
be4cf26
Localizable xcstrings
mallexxx Nov 24, 2023
15418c4
add comments, naming adjustment, add suppot for custom localized argu…
mallexxx Nov 27, 2023
b445919
add localization comments
mallexxx Nov 27, 2023
245bbe6
mostly there; tests in progress
mallexxx Dec 4, 2023
eb80e9a
show back button on getReadPermission, noData screens
mallexxx Dec 4, 2023
03e327f
spaces
mallexxx Dec 4, 2023
80c92f5
Merge branch 'main' into alex/improve-import-info
mallexxx Dec 7, 2023
9cbca92
exclude .noData screen
mallexxx Dec 7, 2023
33e0748
drop .noData screen
mallexxx Dec 7, 2023
684a986
show Skip for failed passwords if there were errors
mallexxx Dec 7, 2023
90603f9
don‘t get stuck on the same error screen
mallexxx Dec 7, 2023
944f0fd
fix build
mallexxx Dec 7, 2023
5cd617f
fix build
mallexxx Dec 7, 2023
774f067
fix typo
mallexxx Dec 12, 2023
15eeb6c
fix fiferox profile primary password
mallexxx Dec 12, 2023
4a6f627
fix ux flow on failure
mallexxx Dec 12, 2023
c1ddad4
design adjustments and fixes
mallexxx Dec 12, 2023
f752210
fix yandex csv import instructions
mallexxx Dec 12, 2023
17165e5
FileImportView testability
mallexxx Dec 13, 2023
e005c99
FileImportView instructions localization tests
mallexxx Dec 13, 2023
2f9d5fa
fix naming
mallexxx Dec 13, 2023
1f0c01c
rm todo
mallexxx Dec 13, 2023
d6c05f0
Merge remote-tracking branch 'origin/main' into alex/improve-import-info
mallexxx Dec 15, 2023
7310f71
added Review/simulated successful zero import result
mallexxx Dec 15, 2023
df8b63b
fix pbxproj
mallexxx Dec 15, 2023
fb474be
add throttled cancellable progress tracking to data importers/data im…
mallexxx Dec 15, 2023
7742cd8
fix doubling import when keychain password/primary password rejected
mallexxx Dec 15, 2023
64ba065
tests
mallexxx Dec 15, 2023
bd08e8f
fix linter issues
mallexxx Dec 15, 2023
3ee7d70
fix FileImportViewLocalizationTests CI assertions
mallexxx Dec 15, 2023
377ffea
Merge remote-tracking branch 'origin/main' into alex/improve-import-info
mallexxx Dec 15, 2023
73cd5a1
fix failing test
mallexxx Dec 15, 2023
e452806
Show generic summary header when there‘s a failure in summary results
mallexxx Dec 15, 2023
252ef22
align file import instructions with numbers in circles by top
mallexxx Dec 15, 2023
549b4d6
add localization comment
mallexxx Dec 15, 2023
fb60932
fix SwiftUI crash on Big Sur
mallexxx Dec 17, 2023
8064382
fix dialog dismiss on Big Sur
mallexxx Dec 17, 2023
5d5451b
Ship review styling and copy fixes
mallexxx Dec 17, 2023
4e7fb31
minor fixes
mallexxx Dec 17, 2023
9a5a0b3
Merge remote-tracking branch 'origin/main' into alex/improve-import-info
mallexxx Dec 17, 2023
5d054ca
fix sandboxed build
mallexxx Dec 18, 2023
6538b13
Merge remote-tracking branch 'origin/main' into alex/improve-import-info
mallexxx Dec 18, 2023
36b47df
fix missing import sources
mallexxx Dec 18, 2023
22d6d62
minor styling fix
mallexxx Dec 20, 2023
d5125d1
add missing import
mallexxx Dec 20, 2023
8b1a452
fix support of Chrome Dev/Beta/Canary builds
mallexxx Dec 20, 2023
f588e0f
fix safari get read permission assertion
mallexxx Dec 20, 2023
26b0c25
fix feedback view styling, add focus ring
mallexxx Dec 21, 2023
3916ead
fix invalid default profile selection
mallexxx Dec 21, 2023
5f19488
Merge remote-tracking branch 'origin/main' into alex/improve-import-info
mallexxx Dec 21, 2023
5199d15
cleanup files committed by mistake
mallexxx Dec 21, 2023
761a444
last touches
mallexxx Dec 22, 2023
04e69eb
Report browser version in Pixel on data import failure (#1873)
mallexxx Dec 22, 2023
ec97729
rm todo
mallexxx Dec 22, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Configuration/Global.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,10 @@ DDG_SLOW_COMPILE_CHECK_THRESHOLD[config=CI] = 250
DDG_SLOW_COMPILE_CHECK = -Xfrontend -warn-long-expression-type-checking=$(DDG_SLOW_COMPILE_CHECK_THRESHOLD) -Xfrontend -warn-long-function-bodies=$(DDG_SLOW_COMPILE_CHECK_THRESHOLD)
OTHER_SWIFT_FLAGS[config=Debug][arch=*][sdk=*] = $(inherited) $(DDG_SLOW_COMPILE_CHECK)
OTHER_SWIFT_FLAGS[config=CI][arch=*][sdk=*] = $(inherited) $(DDG_SLOW_COMPILE_CHECK)

// Automatically generate Color and Image asset accessor extensions
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES

// Automatically generate localization string catalogs
LOCALIZATION_PREFERS_STRING_CATALOGS = YES
SWIFT_EMIT_LOC_STRINGS = YES
373 changes: 227 additions & 146 deletions DuckDuckGo.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<PreActions>
<ExecutionAction
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "Import-Export-16D.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "Menu-Hamburger-16.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "Menu-16.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "Menu-Vertical-16.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Binary file not shown.
4 changes: 2 additions & 2 deletions DuckDuckGo/Bookmarks/Model/BookmarkManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ protocol BookmarkManager: AnyObject {
func canMoveObjectWithUUID(objectUUID uuid: String, to parent: BookmarkFolder) -> Bool
func move(objectUUIDs: [String], toIndex: Int?, withinParentFolder: ParentFolderType, completion: @escaping (Error?) -> Void)
func moveFavorites(with objectUUIDs: [String], toIndex: Int?, completion: @escaping (Error?) -> Void)
func importBookmarks(_ bookmarks: ImportedBookmarks, source: BookmarkImportSource) -> BookmarkImportResult
func importBookmarks(_ bookmarks: ImportedBookmarks, source: BookmarkImportSource) -> BookmarksImportSummary

func handleFavoritesAfterDisablingSync()

Expand Down Expand Up @@ -313,7 +313,7 @@ final class LocalBookmarkManager: BookmarkManager {

// MARK: - Import

func importBookmarks(_ bookmarks: ImportedBookmarks, source: BookmarkImportSource) -> BookmarkImportResult {
func importBookmarks(_ bookmarks: ImportedBookmarks, source: BookmarkImportSource) -> BookmarksImportSummary {
let results = bookmarkStore.importBookmarks(bookmarks, source: source)
loadBookmarks()
requestSync()
Expand Down
6 changes: 3 additions & 3 deletions DuckDuckGo/Bookmarks/Services/BookmarkStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ enum ParentFolderType {
case parent(uuid: String)
}

struct BookmarkImportResult: Equatable {
struct BookmarksImportSummary: Equatable {
var successful: Int
var duplicates: Int
var failed: Int

static func += (left: inout BookmarkImportResult, right: BookmarkImportResult) {
static func += (left: inout BookmarksImportSummary, right: BookmarksImportSummary) {
left.successful += right.successful
left.duplicates += right.duplicates
left.failed += right.failed
Expand All @@ -57,7 +57,7 @@ protocol BookmarkStore {
func canMoveObjectWithUUID(objectUUID uuid: String, to parent: BookmarkFolder) -> Bool
func move(objectUUIDs: [String], toIndex: Int?, withinParentFolder: ParentFolderType, completion: @escaping (Error?) -> Void)
func moveFavorites(with objectUUIDs: [String], toIndex: Int?, completion: @escaping (Error?) -> Void)
func importBookmarks(_ bookmarks: ImportedBookmarks, source: BookmarkImportSource) -> BookmarkImportResult
func importBookmarks(_ bookmarks: ImportedBookmarks, source: BookmarkImportSource) -> BookmarksImportSummary

func handleFavoritesAfterDisablingSync()
}
4 changes: 2 additions & 2 deletions DuckDuckGo/Bookmarks/Services/BookmarkStoreMock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ public final class BookmarkStoreMock: BookmarkStore {
}

var importBookmarksCalled = false
func importBookmarks(_ bookmarks: ImportedBookmarks, source: BookmarkImportSource) -> BookmarkImportResult {
func importBookmarks(_ bookmarks: ImportedBookmarks, source: BookmarkImportSource) -> BookmarksImportSummary {
importBookmarksCalled = true
return BookmarkImportResult(successful: 0, duplicates: 0, failed: 0)
return BookmarksImportSummary(successful: 0, duplicates: 0, failed: 0)
}

var canMoveObjectWithUUIDCalled = false
Expand Down
12 changes: 6 additions & 6 deletions DuckDuckGo/Bookmarks/Services/LocalBookmarkStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -705,8 +705,8 @@ final class LocalBookmarkStore: BookmarkStore {
/// 2. **Safari:** Create a root level "Imported Favorites" folder to store bookmarks from the bookmarks bar, and all other bookmarks go at the root level.
/// 3. **Chrome:** Put all bookmarks at the root level, except for Other Bookmarks which go in a root level "Other Bookmarks" folder.
/// 4. **Firefox:** Put all bookmarks at the root level, except for Other Bookmarks which go in a root level "Other Bookmarks" folder.
func importBookmarks(_ bookmarks: ImportedBookmarks, source: BookmarkImportSource) -> BookmarkImportResult {
var total = BookmarkImportResult(successful: 0, duplicates: 0, failed: 0)
func importBookmarks(_ bookmarks: ImportedBookmarks, source: BookmarkImportSource) -> BookmarksImportSummary {
var total = BookmarksImportSummary(successful: 0, duplicates: 0, failed: 0)

do {
let context = makeContext()
Expand Down Expand Up @@ -747,15 +747,15 @@ final class LocalBookmarkStore: BookmarkStore {
private func createEntitiesFromBookmarks(allFolders: [BookmarkEntity],
bookmarks: ImportedBookmarks,
importSourceName: String,
in context: NSManagedObjectContext) -> BookmarkImportResult {
in context: NSManagedObjectContext) -> BookmarksImportSummary {

guard let root = bookmarksRoot(in: context) else {
return .init(successful: 0,
duplicates: 0,
failed: bookmarks.numberOfBookmarks)
}

var total = BookmarkImportResult(successful: 0, duplicates: 0, failed: 0)
var total = BookmarksImportSummary(successful: 0, duplicates: 0, failed: 0)

var parent = root
var makeFavorties = true
Expand Down Expand Up @@ -791,8 +791,8 @@ final class LocalBookmarkStore: BookmarkStore {
private func recursivelyCreateEntities(from bookmarks: [ImportedBookmarks.BookmarkOrFolder],
parent: BookmarkEntity,
markBookmarksAsFavorite: Bool? = false,
in context: NSManagedObjectContext) -> BookmarkImportResult {
var total = BookmarkImportResult(successful: 0, duplicates: 0, failed: 0)
in context: NSManagedObjectContext) -> BookmarksImportSummary {
var total = BookmarksImportSummary(successful: 0, duplicates: 0, failed: 0)

let favoritesFolders = BookmarkUtils.fetchFavoritesFolders(for: favoritesDisplayMode, in: context)

Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo/Bookmarks/View/BookmarkListViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ final class BookmarkListViewController: NSViewController {
}

@IBAction func onImportClicked(_ sender: NSButton) {
DataImportViewController.show()
DataImportView.show()
}

// MARK: NSOutlineView Configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ final class BookmarkManagementDetailViewController: NSViewController, NSMenuItem
}

@IBAction func onImportClicked(_ sender: NSButton) {
DataImportViewController.show()
DataImportView.show()
}

@IBAction func handleDoubleClick(_ sender: NSTableView) {
Expand Down
12 changes: 0 additions & 12 deletions DuckDuckGo/Common/Extensions/NSColorExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ extension NSColor {
NSColor(named: "FindInPageFocusedBackgroundColor")!
}

static var inactiveSearchBarBackground: NSColor {
NSColor(named: "InactiveSearchBarBackground")!
}

static var suggestionTextColor: NSColor {
NSColor(named: "SuggestionTextColor")!
}
Expand Down Expand Up @@ -138,14 +134,6 @@ extension NSColor {
NSColor(named: "DialogPanelBackground")!
}

static let bookmarkFilledTint = NSColor(named: "BookmarkFilledTint")!
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Swift 5.9 auto-generates the asset names


static let bookmarkRepresentingColor1 = NSColor(named: "BookmarkRepresentingColor1")!
static let bookmarkRepresentingColor2 = NSColor(named: "BookmarkRepresentingColor2")!
static let bookmarkRepresentingColor3 = NSColor(named: "BookmarkRepresentingColor3")!
static let bookmarkRepresentingColor4 = NSColor(named: "BookmarkRepresentingColor4")!
static let bookmarkRepresentingColor5 = NSColor(named: "BookmarkRepresentingColor5")!

static var buttonMouseDownColor: NSColor {
NSColor(named: "ButtonMouseDownColor")!
}
Expand Down
15 changes: 7 additions & 8 deletions DuckDuckGo/Common/Extensions/NSOpenPanelExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,13 @@ extension NSOpenPanel {
return panel
}

static func filePanel(allowedExtension: String) -> NSOpenPanel {
let panel = NSOpenPanel()

panel.directoryURL = FileManager.default.homeDirectoryForCurrentUser.appendingPathComponent("Desktop")
panel.canChooseFiles = true
panel.allowedContentTypes = UTType(filenameExtension: allowedExtension).map { [$0] } ?? []
panel.canChooseDirectories = false
convenience init(allowedFileTypes: [UTType], directoryURL: URL? = nil) {
self.init()

return panel
self.directoryURL = directoryURL
canChooseFiles = true
allowedContentTypes = allowedFileTypes
canChooseDirectories = false
}

}
8 changes: 8 additions & 0 deletions DuckDuckGo/Common/Extensions/NSWorkspaceExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,12 @@ extension NSWorkspace {
return missionControlWindows.count > allScreenSizes.count
}

@available(macOS, obsoleted: 14.0, message: "This needs to be removed as it‘s no longer necessary.")
@nonobjc func urls(forApplicationsWithBundleId bundleId: String) -> [URL] {
if #available(macOS 12.0, *) {
return self.urlsForApplications(withBundleIdentifier: bundleId)
}
return LSCopyApplicationURLsForBundleIdentifier(bundleId as CFString, nil)?.takeRetainedValue() as? [URL] ?? []
}

}
8 changes: 8 additions & 0 deletions DuckDuckGo/Common/Extensions/SetExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,11 @@ extension Set where Element == String {
}

}

extension Set {

@inlinable func intersects<S: Sequence>(_ other: S) -> Bool where Element == S.Element {
!isDisjoint(with: other)
}

}
Loading
Loading