Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
442 changes: 408 additions & 34 deletions Resources/Localizable.xcstrings

Large diffs are not rendered by default.

37 changes: 37 additions & 0 deletions Sources/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2301,6 +2301,24 @@ final class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCent
// In UI tests, `WindowGroup` occasionally fails to materialize a window quickly on the VM.
// If there are no windows shortly after launch, force-create one so XCUITest can proceed.
if isRunningUnderXCTest {
if let rawVariant = env["CMUX_UI_TEST_BROWSER_IMPORT_HINT_VARIANT"] {
UserDefaults.standard.set(
BrowserImportHintSettings.variant(for: rawVariant).rawValue,
forKey: BrowserImportHintSettings.variantKey
)
}
if let rawShow = env["CMUX_UI_TEST_BROWSER_IMPORT_HINT_SHOW"] {
UserDefaults.standard.set(
rawShow == "1",
forKey: BrowserImportHintSettings.showOnBlankTabsKey
)
}
if let rawDismissed = env["CMUX_UI_TEST_BROWSER_IMPORT_HINT_DISMISSED"] {
UserDefaults.standard.set(
rawDismissed == "1",
forKey: BrowserImportHintSettings.dismissedKey
)
}
DispatchQueue.main.asyncAfter(deadline: .now() + 0.25) { [weak self] in
guard let self else { return }
if NSApp.windows.isEmpty {
Expand All @@ -2309,6 +2327,25 @@ final class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCent
NSRunningApplication.current.activate(options: [.activateAllWindows, .activateIgnoringOtherApps])
self.writeUITestDiagnosticsIfNeeded(stage: "afterForceWindow")
}
if env["CMUX_UI_TEST_BROWSER_IMPORT_HINT_OPEN_BLANK_BROWSER"] == "1" {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.45) { [weak self] in
guard let self else { return }
_ = self.openBrowserAndFocusAddressBar(insertAtEnd: true)
}
}
if env["CMUX_UI_TEST_BROWSER_IMPORT_HINT_OPEN_SETTINGS"] == "1" {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.55) { [weak self] in
self?.openPreferencesWindow(
debugSource: "uiTest.browserImportHint",
navigationTarget: .browser
)
}
}
if env["CMUX_UI_TEST_BROWSER_IMPORT_AUTO_OPEN"] == "1" {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.4) {
BrowserDataImportCoordinator.shared.presentImportDialog()
}
}
}
#endif
}
Expand Down
12 changes: 12 additions & 0 deletions Sources/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9144,6 +9144,7 @@ private final class FeedbackComposerMessageEditorView: NSView {
}

private enum SidebarHelpMenuAction {
case importBrowserData
case keyboardShortcuts
case docs
case changelog
Expand Down Expand Up @@ -9714,6 +9715,12 @@ private struct SidebarHelpMenuButton: View {
accessibilityIdentifier: "SidebarHelpMenuOptionKeyboardShortcuts",
isExternalLink: false
)
helpOptionButton(
title: String(localized: "menu.view.importFromBrowser", defaultValue: "Import From Browser…"),
action: .importBrowserData,
accessibilityIdentifier: "SidebarHelpMenuOptionImportBrowserData",
isExternalLink: false
)
if docsURL != nil {
helpOptionButton(
title: String(localized: "about.docs", defaultValue: "Docs"),
Expand Down Expand Up @@ -9818,6 +9825,11 @@ private struct SidebarHelpMenuButton: View {

private func perform(_ action: SidebarHelpMenuAction) {
switch action {
case .importBrowserData:
isPopoverPresented = false
DispatchQueue.main.async {
BrowserDataImportCoordinator.shared.presentImportDialog()
}
case .keyboardShortcuts:
isPopoverPresented = false
DispatchQueue.main.asyncAfter(deadline: .now() + 0.12) {
Expand Down
Loading
Loading