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

Address tab feedback #2705

Merged
merged 18 commits into from
May 4, 2024
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
24 changes: 24 additions & 0 deletions DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@
objects = {

/* Begin PBXBuildFile section */
021EA0802BD2A9D500772C9A /* TabsPreferences.swift in Sources */ = {isa = PBXBuildFile; fileRef = 021EA07F2BD2A9D500772C9A /* TabsPreferences.swift */; };
021EA0812BD2A9D500772C9A /* TabsPreferences.swift in Sources */ = {isa = PBXBuildFile; fileRef = 021EA07F2BD2A9D500772C9A /* TabsPreferences.swift */; };
021EA0842BD6E01A00772C9A /* TabsPreferencesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 021EA0822BD6DF1B00772C9A /* TabsPreferencesTests.swift */; };
021EA0852BD6E0EB00772C9A /* TabsPreferencesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 021EA0822BD6DF1B00772C9A /* TabsPreferencesTests.swift */; };
0230C0A3272080090018F728 /* KeyedCodingExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0230C0A2272080090018F728 /* KeyedCodingExtension.swift */; };
026ADE1426C3010C002518EE /* macos-config.json in Resources */ = {isa = PBXBuildFile; fileRef = 026ADE1326C3010C002518EE /* macos-config.json */; };
028904202A7B25380028369C /* AppConfigurationURLProviderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0289041E2A7B23CE0028369C /* AppConfigurationURLProviderTests.swift */; };
028904212A7B25770028369C /* AppConfigurationURLProviderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0289041E2A7B23CE0028369C /* AppConfigurationURLProviderTests.swift */; };
02C0737D2BE5B7E000BFE2F5 /* InfoPlist.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 02C0737C2BE5B7E000BFE2F5 /* InfoPlist.xcstrings */; };
142879DA24CE1179005419BB /* SuggestionViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 142879D924CE1179005419BB /* SuggestionViewModelTests.swift */; };
142879DC24CE1185005419BB /* SuggestionContainerViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 142879DB24CE1185005419BB /* SuggestionContainerViewModelTests.swift */; };
1430DFF524D0580F00B8978C /* TabBarViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1430DFF424D0580F00B8978C /* TabBarViewController.swift */; };
Expand Down Expand Up @@ -2745,9 +2750,12 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
021EA07F2BD2A9D500772C9A /* TabsPreferences.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabsPreferences.swift; sourceTree = "<group>"; };
021EA0822BD6DF1B00772C9A /* TabsPreferencesTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabsPreferencesTests.swift; sourceTree = "<group>"; };
0230C0A2272080090018F728 /* KeyedCodingExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyedCodingExtension.swift; sourceTree = "<group>"; };
026ADE1326C3010C002518EE /* macos-config.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "macos-config.json"; sourceTree = "<group>"; };
0289041E2A7B23CE0028369C /* AppConfigurationURLProviderTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppConfigurationURLProviderTests.swift; sourceTree = "<group>"; };
02C0737C2BE5B7E000BFE2F5 /* InfoPlist.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = InfoPlist.xcstrings; sourceTree = "<group>"; };
142879D924CE1179005419BB /* SuggestionViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SuggestionViewModelTests.swift; sourceTree = "<group>"; };
142879DB24CE1185005419BB /* SuggestionContainerViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SuggestionContainerViewModelTests.swift; sourceTree = "<group>"; };
1430DFF424D0580F00B8978C /* TabBarViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabBarViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -4773,6 +4781,7 @@
37F19A6628E1B43200740DC6 /* DuckPlayerPreferences.swift */,
37CD54C527F2FDD100F1F7B9 /* AboutModel.swift */,
1D220BFB2B87AACF00F8BBC6 /* PrivacyProtectionStatus.swift */,
021EA07F2BD2A9D500772C9A /* TabsPreferences.swift */,
);
path = Model;
sourceTree = "<group>";
Expand Down Expand Up @@ -4884,6 +4893,7 @@
1D9FDEC22B9B63C90040B78C /* DataClearingPreferencesTests.swift */,
3714B1E628EDB7FA0056C57A /* DuckPlayerPreferencesTests.swift */,
1D9FDEC52B9B64DB0040B78C /* PrivacyProtectionStatusTests.swift */,
021EA0822BD6DF1B00772C9A /* TabsPreferencesTests.swift */,
);
path = Preferences;
sourceTree = "<group>";
Expand Down Expand Up @@ -7914,6 +7924,7 @@
B6E6B9F42BA1FD90008AA7E1 /* sandbox-test-tool */ = {
isa = PBXGroup;
children = (
02C0737C2BE5B7E000BFE2F5 /* InfoPlist.xcstrings */,
B6E6BA212BA2E4FB008AA7E1 /* Info.plist */,
B6E6B9F52BA1FD90008AA7E1 /* SandboxTestTool.swift */,
B6E6BA222BA2EDDE008AA7E1 /* FileReadResult.swift */,
Expand Down Expand Up @@ -8618,6 +8629,7 @@
B6E6B9EF2BA1FD90008AA7E1 /* Sources */,
B6E6B9F02BA1FD90008AA7E1 /* Frameworks */,
B6AEB5532BA3029B00781A09 /* Cleanup entitlements */,
02C0737E2BE5B7E000BFE2F5 /* Resources */,
);
buildRules = (
);
Expand Down Expand Up @@ -8774,6 +8786,14 @@
/* End PBXProject section */

/* Begin PBXResourcesBuildPhase section */
02C0737E2BE5B7E000BFE2F5 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
02C0737D2BE5B7E000BFE2F5 /* InfoPlist.xcstrings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
3706FCB1293F65D500E42796 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -9922,6 +9942,7 @@
3706FC06293F65D500E42796 /* OnboardingViewModel.swift in Sources */,
3706FC07293F65D500E42796 /* ScriptSourceProviding.swift in Sources */,
31EF1E832B63FFCA00E6DB17 /* LoginItem+DataBrokerProtection.swift in Sources */,
021EA0812BD2A9D500772C9A /* TabsPreferences.swift in Sources */,
B6619EFC2B111CC600CD9186 /* InstructionsFormatParser.swift in Sources */,
3706FC08293F65D500E42796 /* CoreDataBookmarkImporter.swift in Sources */,
3706FC09293F65D500E42796 /* SuggestionViewModel.swift in Sources */,
Expand Down Expand Up @@ -10392,6 +10413,7 @@
C1E961F32B87B273001760E1 /* MockAutofillActionExecutor.swift in Sources */,
376E2D2729428353001CD31B /* BrokenSiteReportingReferenceTests.swift in Sources */,
3707C72F294B5D4F00682A9F /* WebViewTests.swift in Sources */,
021EA0852BD6E0EB00772C9A /* TabsPreferencesTests.swift in Sources */,
5682C69429B79B57004DE3C8 /* TabBarViewItemTests.swift in Sources */,
3706FE77293F661700E42796 /* PreferencesSidebarModelTests.swift in Sources */,
3706FE78293F661700E42796 /* HistoryCoordinatingMock.swift in Sources */,
Expand Down Expand Up @@ -11289,6 +11311,7 @@
B684592725C93C0500DC17B6 /* Publishers.NestedObjectChanges.swift in Sources */,
B6DA06E62913F39400225DE2 /* MenuItemSelectors.swift in Sources */,
85589E9A27BFE3C30038AD11 /* FaviconView.swift in Sources */,
021EA0802BD2A9D500772C9A /* TabsPreferences.swift in Sources */,
85707F2C276A364E00DC0649 /* OnboardingFlow.swift in Sources */,
4BE65480271FCD4D008D1D63 /* PasswordManagementLoginModel.swift in Sources */,
AA9FF95B24A1EFC20039E328 /* TabViewModel.swift in Sources */,
Expand Down Expand Up @@ -11729,6 +11752,7 @@
56D145EE29E6DAD900E3488A /* DataImportProviderTests.swift in Sources */,
4BB99D0F26FE1A84001E4761 /* ChromiumBookmarksReaderTests.swift in Sources */,
1D9FDEB72B9B5D150040B78C /* SearchPreferencesTests.swift in Sources */,
021EA0842BD6E01A00772C9A /* TabsPreferencesTests.swift in Sources */,
1D12F2E2298BC660009A65FD /* InternalUserDeciderStoreMock.swift in Sources */,
4BB99D1026FE1A84001E4761 /* FirefoxBookmarksReaderTests.swift in Sources */,
9FBD84702BB3DD8400220859 /* MockAttributionsPixelHandler.swift in Sources */,
Expand Down
16 changes: 16 additions & 0 deletions DuckDuckGo/Common/Localizables/UserText.swift
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ struct UserText {
static let muteTab = NSLocalizedString("mute.tab", value: "Mute Tab", comment: "Menu item. Mute tab")
static let unmuteTab = NSLocalizedString("unmute.tab", value: "Unmute Tab", comment: "Menu item. Unmute tab")
static let closeOtherTabs = NSLocalizedString("close.other.tabs", value: "Close Other Tabs", comment: "Menu item")
static let closeAllOtherTabs = NSLocalizedString("close.all.other.tabs", value: "Close All Other Tabs", comment: "Menu item")
static let closeTabsToTheLeft = NSLocalizedString("close.tabs.to.the.left", value: "Close Tabs to the Left", comment: "Menu item")
static let closeTabsToTheRight = NSLocalizedString("close.tabs.to.the.right", value: "Close Tabs to the Right", comment: "Menu item")
static let openInNewTab = NSLocalizedString("open.in.new.tab", value: "Open in New Tab", comment: "Menu item that opens the link in a new tab")
static let openInNewWindow = NSLocalizedString("open.in.new.window", value: "Open in New Window", comment: "Menu item that opens the link in a new window")
Expand Down Expand Up @@ -606,6 +608,20 @@ struct UserText {
static let setHomePage = NSLocalizedString("preferences-homepage-set-homePage", value: "Set Homepage", comment: "Set Homepage dialog title")
static let addressLabel = NSLocalizedString("preferences-homepage-address", value: "Address:", comment: "Homepage address field label")

static let tabs = NSLocalizedString("preferences-tabs.title", value: "Tabs", comment: "Title for tabs section in settings")
static let preferNewTabsToWindows = NSLocalizedString("preferences-tabs.prefer.new.tabs.to.windows", value: "Open links in new tabs instead of new windows whenever possible", comment: "Option to prefer opening new tabs instead of windows when opening links")
static let switchToNewTabWhenOpened = NSLocalizedString("preferences-tabs.switch.tab.when.opened", value: "When opening links, switch to the new tab or window immediately", comment: "Option to switch to a new tab/window when it is opened")
static let newTabPositionTitle = NSLocalizedString("preferences-tabs.new.tab.position.title", value: "When creating a new tab", comment: "Title for new tab positioning")

static func newTabPositionMode(for position: NewTabPosition) -> String {
switch position {
case .atEnd:
return NSLocalizedString("context.menu.new.tab.mode.at.end", value: "Add to the right of other tabs", comment: "Preferences > Tabs > At end of list")
case .nextToCurrent:
return NSLocalizedString("context.menu.new.tab.mode.next.to.current", value: "Add to the right of the current tab", comment: "Preferences > Tabs > Next to current tab")
}
}

static func homeButtonMode(for position: HomeButtonPosition) -> String {
switch position {
case .hidden:
Expand Down
3 changes: 3 additions & 0 deletions DuckDuckGo/Common/Utilities/UserDefaultsWrapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ public struct UserDefaultsWrapper<T> {
case currentThemeName = "com.duckduckgo.macos.currentThemeNameKey"
case showFullURL = "preferences.appearance.show-full-url"
case showAutocompleteSuggestions = "preferences.appearance.show-autocomplete-suggestions"
case preferNewTabsToWindows = "preferences.tabs.prefer-new-tabs-to-windows"
case switchToNewTabWhenOpened = "preferences.tabs.switch-to-new-tab-when-opened"
case newTabPosition = "preferences.tabs.new-tab-position"
case defaultPageZoom = "preferences.appearance.default-page-zoom"
case bookmarksBarAppearance = "preferences.appearance.bookmarks-bar"

Expand Down
Loading
Loading