Skip to content

Remove FXIOS-12029 [Feature flag cleanup] Remove the preferSwitchToOpenTabOverDuplicate flag #26202

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

Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ enum NimbusFeatureFlagID: String, CaseIterable {
case noInternetConnectionErrorPage
case pdfRefactor
case downloadLiveActivities
case preferSwitchToOpenTabOverDuplicate
case ratingPromptFeature
case reduxSearchSettings
case reportSiteIssue
Expand Down Expand Up @@ -135,7 +134,6 @@ struct NimbusFlaggableFeature: HasNimbusSearchBar {
.noInternetConnectionErrorPage,
.pdfRefactor,
.downloadLiveActivities,
.preferSwitchToOpenTabOverDuplicate,
.ratingPromptFeature,
.reduxSearchSettings,
.reportSiteIssue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3274,10 +3274,6 @@ class BrowserViewController: UIViewController,
applyThemeForPreferences(profile.prefs, contentScript: contentScript)
}

var isPreferSwitchToOpenTabOverDuplicateFeatureEnabled: Bool {
featureFlags.isFeatureEnabled(.preferSwitchToOpenTabOverDuplicate, checking: .buildOnly)
}

// MARK: - Telemetry

private func logTelemetryForAppDidEnterBackground() {
Expand All @@ -3301,20 +3297,12 @@ class BrowserViewController: UIViewController,
func libraryPanel(didSelectURL url: URL, visitType: VisitType) {
guard let tab = tabManager.selectedTab else { return }

if isPreferSwitchToOpenTabOverDuplicateFeatureEnabled,
let tab = tabManager.tabs.reversed().first(where: {
// URL for reading mode comes encoded and we need a separate case to check if it's equal with the tab url
($0.url == url || $0.url == url.safeEncodedUrl) && $0.isPrivate == tab.isPrivate
}) {
tabManager.selectTab(tab)
} else {
// Handle keyboard shortcuts from homepage with url selection
// (ex: Cmd + Tap on Link; which is a cell in this case)
if navigateLinkShortcutIfNeeded(url: url) {
return
}
finishEditingAndSubmit(url, visitType: visitType, forTab: tab)
// Handle keyboard shortcuts from homepage with url selection
// (ex: Cmd + Tap on Link; which is a cell in this case)
if navigateLinkShortcutIfNeeded(url: url) {
return
}
finishEditingAndSubmit(url, visitType: visitType, forTab: tab)
}

func libraryPanelDidRequestToOpenInNewTab(_ url: URL, isPrivate: Bool) {
Expand Down Expand Up @@ -3768,26 +3756,18 @@ extension BrowserViewController: HomePanelDelegate {
func homePanel(didSelectURL url: URL, visitType: VisitType, isGoogleTopSite: Bool) {
guard let tab = tabManager.selectedTab else { return }

if isPreferSwitchToOpenTabOverDuplicateFeatureEnabled,
let tab = tabManager.tabs.reversed().first(where: {
// URL for reading mode comes encoded and we need a separate case to check if it's equal with the tab url
($0.url == url || $0.url == url.safeEncodedUrl) && $0.isPrivate == tab.isPrivate
}) {
tabManager.selectTab(tab)
} else {
if isGoogleTopSite {
tab.urlType = .googleTopSite
searchTelemetry.shouldSetGoogleTopSiteSearch = true
}

// Handle keyboard shortcuts from homepage with url selection
// (ex: Cmd + Tap on Link; which is a cell in this case)
if navigateLinkShortcutIfNeeded(url: url) {
return
}
if isGoogleTopSite {
tab.urlType = .googleTopSite
searchTelemetry.shouldSetGoogleTopSiteSearch = true
}

finishEditingAndSubmit(url, visitType: visitType, forTab: tab)
// Handle keyboard shortcuts from homepage with url selection
// (ex: Cmd + Tap on Link; which is a cell in this case)
if navigateLinkShortcutIfNeeded(url: url) {
return
}

finishEditingAndSubmit(url, visitType: visitType, forTab: tab)
}

func homePanelDidRequestToOpenInNewTab(_ url: URL, isPrivate: Bool, selectNewTab: Bool = false) {
Expand Down
7 changes: 0 additions & 7 deletions firefox-ios/Client/Nimbus/NimbusFeatureFlagLayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@ final class NimbusFeatureFlagLayer {
case .pdfRefactor:
return checkPdfRefactorFeature(from: nimbus)

case .preferSwitchToOpenTabOverDuplicate:
return checkPreferSwitchToOpenTabOverDuplicate(from: nimbus)

case .ratingPromptFeature:
return checkRatingPromptFeature(from: nimbus)

Expand Down Expand Up @@ -341,10 +338,6 @@ final class NimbusFeatureFlagLayer {
return nimbus.features.pdfRefactorFeature.value().enabled
}

private func checkPreferSwitchToOpenTabOverDuplicate(from nimbus: FxNimbus) -> Bool {
return nimbus.features.homescreenFeature.value().preferSwitchToOpenTab
}
Comment on lines -320 to -322
Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for the PR, we also need to remove the "prefer-switch-to-open-tab" feature flag under the .yaml file here.


private func checkRatingPromptFeature(from nimbus: FxNimbus) -> Bool {
return nimbus.features.ratingPromptFeature.value().enabled
}
Expand Down
8 changes: 0 additions & 8 deletions firefox-ios/nimbus-features/homescreenFeature.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,20 @@ features:
"jump-back-in": true,
"recent-explorations": false,
}
prefer-switch-to-open-tab:
description: >
Enables the feature to automatically switch to an existing tab
with the same content instead of opening a new one.
type: Boolean
default: false
defaults:
- channel: developer
value: {
"sections-enabled": {
"jump-back-in": true,
"recent-explorations": false,
},
"prefer-switch-to-open-tab": true
}
- channel: beta
value: {
"sections-enabled": {
"jump-back-in": true,
"recent-explorations": false,
},
"prefer-switch-to-open-tab": false
}

enums:
Expand Down