Skip to content

Commit 2b77518

Browse files
authored
Remove FXIOS-12029 [Feature flag cleanup] Remove the preferSwitchToOpenTabOverDuplicate flag (#26202)
* Remove feature flag * pr fix
1 parent c30f8bc commit 2b77518

File tree

4 files changed

+15
-52
lines changed

4 files changed

+15
-52
lines changed

firefox-ios/Client/FeatureFlags/NimbusFlaggableFeature.swift

-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ enum NimbusFeatureFlagID: String, CaseIterable {
3333
case noInternetConnectionErrorPage
3434
case pdfRefactor
3535
case downloadLiveActivities
36-
case preferSwitchToOpenTabOverDuplicate
3736
case ratingPromptFeature
3837
case reportSiteIssue
3938
case searchEngineConsolidation
@@ -129,7 +128,6 @@ struct NimbusFlaggableFeature: HasNimbusSearchBar {
129128
.noInternetConnectionErrorPage,
130129
.pdfRefactor,
131130
.downloadLiveActivities,
132-
.preferSwitchToOpenTabOverDuplicate,
133131
.ratingPromptFeature,
134132
.reportSiteIssue,
135133
.feltPrivacySimplifiedUI,

firefox-ios/Client/Frontend/Browser/BrowserViewController/Views/BrowserViewController.swift

+15-35
Original file line numberDiff line numberDiff line change
@@ -3239,10 +3239,6 @@ class BrowserViewController: UIViewController,
32393239
view.backgroundColor = toolbarLayoutStyle == .baseline ? theme.colors.layer1 : theme.colors.layer3
32403240
}
32413241

3242-
var isPreferSwitchToOpenTabOverDuplicateFeatureEnabled: Bool {
3243-
featureFlags.isFeatureEnabled(.preferSwitchToOpenTabOverDuplicate, checking: .buildOnly)
3244-
}
3245-
32463242
// MARK: - Telemetry
32473243

32483244
private func logTelemetryForAppDidEnterBackground() {
@@ -3266,20 +3262,12 @@ class BrowserViewController: UIViewController,
32663262
func libraryPanel(didSelectURL url: URL, visitType: VisitType) {
32673263
guard let tab = tabManager.selectedTab else { return }
32683264

3269-
if isPreferSwitchToOpenTabOverDuplicateFeatureEnabled,
3270-
let tab = tabManager.tabs.reversed().first(where: {
3271-
// URL for reading mode comes encoded and we need a separate case to check if it's equal with the tab url
3272-
($0.url == url || $0.url == url.safeEncodedUrl) && $0.isPrivate == tab.isPrivate
3273-
}) {
3274-
tabManager.selectTab(tab)
3275-
} else {
3276-
// Handle keyboard shortcuts from homepage with url selection
3277-
// (ex: Cmd + Tap on Link; which is a cell in this case)
3278-
if navigateLinkShortcutIfNeeded(url: url) {
3279-
return
3280-
}
3281-
finishEditingAndSubmit(url, visitType: visitType, forTab: tab)
3265+
// Handle keyboard shortcuts from homepage with url selection
3266+
// (ex: Cmd + Tap on Link; which is a cell in this case)
3267+
if navigateLinkShortcutIfNeeded(url: url) {
3268+
return
32823269
}
3270+
finishEditingAndSubmit(url, visitType: visitType, forTab: tab)
32833271
}
32843272

32853273
func libraryPanelDidRequestToOpenInNewTab(_ url: URL, isPrivate: Bool) {
@@ -3733,26 +3721,18 @@ extension BrowserViewController: HomePanelDelegate {
37333721
func homePanel(didSelectURL url: URL, visitType: VisitType, isGoogleTopSite: Bool) {
37343722
guard let tab = tabManager.selectedTab else { return }
37353723

3736-
if isPreferSwitchToOpenTabOverDuplicateFeatureEnabled,
3737-
let tab = tabManager.tabs.reversed().first(where: {
3738-
// URL for reading mode comes encoded and we need a separate case to check if it's equal with the tab url
3739-
($0.url == url || $0.url == url.safeEncodedUrl) && $0.isPrivate == tab.isPrivate
3740-
}) {
3741-
tabManager.selectTab(tab)
3742-
} else {
3743-
if isGoogleTopSite {
3744-
tab.urlType = .googleTopSite
3745-
searchTelemetry.shouldSetGoogleTopSiteSearch = true
3746-
}
3747-
3748-
// Handle keyboard shortcuts from homepage with url selection
3749-
// (ex: Cmd + Tap on Link; which is a cell in this case)
3750-
if navigateLinkShortcutIfNeeded(url: url) {
3751-
return
3752-
}
3724+
if isGoogleTopSite {
3725+
tab.urlType = .googleTopSite
3726+
searchTelemetry.shouldSetGoogleTopSiteSearch = true
3727+
}
37533728

3754-
finishEditingAndSubmit(url, visitType: visitType, forTab: tab)
3729+
// Handle keyboard shortcuts from homepage with url selection
3730+
// (ex: Cmd + Tap on Link; which is a cell in this case)
3731+
if navigateLinkShortcutIfNeeded(url: url) {
3732+
return
37553733
}
3734+
3735+
finishEditingAndSubmit(url, visitType: visitType, forTab: tab)
37563736
}
37573737

37583738
func homePanelDidRequestToOpenInNewTab(_ url: URL, isPrivate: Bool, selectNewTab: Bool = false) {

firefox-ios/Client/Nimbus/NimbusFeatureFlagLayer.swift

-7
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,6 @@ final class NimbusFeatureFlagLayer {
7676
case .pdfRefactor:
7777
return checkPdfRefactorFeature(from: nimbus)
7878

79-
case .preferSwitchToOpenTabOverDuplicate:
80-
return checkPreferSwitchToOpenTabOverDuplicate(from: nimbus)
81-
8279
case .ratingPromptFeature:
8380
return checkRatingPromptFeature(from: nimbus)
8481

@@ -317,10 +314,6 @@ final class NimbusFeatureFlagLayer {
317314
return nimbus.features.pdfRefactorFeature.value().enabled
318315
}
319316

320-
private func checkPreferSwitchToOpenTabOverDuplicate(from nimbus: FxNimbus) -> Bool {
321-
return nimbus.features.homescreenFeature.value().preferSwitchToOpenTab
322-
}
323-
324317
private func checkRatingPromptFeature(from nimbus: FxNimbus) -> Bool {
325318
return nimbus.features.ratingPromptFeature.value().enabled
326319
}

firefox-ios/nimbus-features/homescreenFeature.yaml

-8
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,18 @@ features:
1111
{
1212
"recent-explorations": false,
1313
}
14-
prefer-switch-to-open-tab:
15-
description: >
16-
Enables the feature to automatically switch to an existing tab
17-
with the same content instead of opening a new one.
18-
type: Boolean
19-
default: false
2014
defaults:
2115
- channel: developer
2216
value: {
2317
"sections-enabled": {
2418
"recent-explorations": false,
2519
},
26-
"prefer-switch-to-open-tab": true
2720
}
2821
- channel: beta
2922
value: {
3023
"sections-enabled": {
3124
"recent-explorations": false,
3225
},
33-
"prefer-switch-to-open-tab": false
3426
}
3527

3628
enums:

0 commit comments

Comments
 (0)