Skip to content

Commit ea8fc32

Browse files
authoredMar 14, 2025
Refactor FXIOS-11638 [Tab tray UI experiment] Make sure we disable any changes for iPad (#25354)
Make sure we disable any changes for iPad
1 parent 51a6600 commit ea8fc32

7 files changed

+22
-16
lines changed
 

‎firefox-ios/Client/Frontend/Browser/Tabs/LayoutManager/TabsSectionManager.swift

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class TabsSectionManager: FeatureFlaggable {
2020

2121
private var isTabTrayUIExperimentsEnabled: Bool {
2222
return featureFlags.isFeatureEnabled(.tabTrayUIExperiments, checking: .buildOnly)
23+
&& UIDevice.current.userInterfaceIdiom != .pad
2324
}
2425

2526
static func leadingInset(traitCollection: UITraitCollection,

‎firefox-ios/Client/Frontend/Browser/Tabs/Middleware/TabManagerMiddleware.swift

+10-9
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ class TabManagerMiddleware: BookmarksRefactorFeatureFlagProvider,
1616
private let inactiveTabTelemetry = InactiveTabsTelemetry()
1717
private let bookmarksSaver: BookmarksSaver
1818

19+
private var isTabTrayUIExperimentsEnabled: Bool {
20+
return featureFlags.isFeatureEnabled(.tabTrayUIExperiments, checking: .buildOnly)
21+
&& UIDevice.current.userInterfaceIdiom != .pad
22+
}
23+
1924
init(profile: Profile = AppContainer.shared.resolve(),
2025
logger: Logger = DefaultLogger.shared,
2126
bookmarksSaver: BookmarksSaver? = nil) {
@@ -384,15 +389,13 @@ class TabManagerMiddleware: BookmarksRefactorFeatureFlagProvider,
384389
let shouldDismiss = await self.closeTab(with: tabUUID, uuid: uuid, isPrivate: isPrivate)
385390
triggerRefresh(uuid: uuid, isPrivate: isPrivate)
386391

387-
let isTabTrayExperimentEnabled = featureFlags.isFeatureEnabled(.tabTrayUIExperiments,
388-
checking: .buildOnly)
389392
if isPrivate && tabManager(for: uuid).privateTabs.isEmpty {
390393
let didLoadAction = TabPanelViewAction(panelType: isPrivate ? .privateTabs : .tabs,
391394
windowUUID: uuid,
392395
actionType: TabPanelViewActionType.tabPanelDidLoad)
393396
store.dispatch(didLoadAction)
394397

395-
if !isTabTrayExperimentEnabled {
398+
if !isTabTrayUIExperimentsEnabled {
396399
let toastAction = TabPanelMiddlewareAction(toastType: .closedSingleTab,
397400
windowUUID: uuid,
398401
actionType: TabPanelMiddlewareActionType.showToast)
@@ -403,14 +406,14 @@ class TabManagerMiddleware: BookmarksRefactorFeatureFlagProvider,
403406
actionType: TabTrayActionType.dismissTabTray)
404407
store.dispatch(dismissAction)
405408

406-
if !isTabTrayExperimentEnabled {
409+
if !isTabTrayUIExperimentsEnabled {
407410
let toastAction = GeneralBrowserAction(toastType: .closedSingleTab,
408411
windowUUID: uuid,
409412
actionType: GeneralBrowserActionType.showToast)
410413
store.dispatch(toastAction)
411414
}
412415
addNewTabIfPrivate(uuid: uuid)
413-
} else if !isTabTrayExperimentEnabled {
416+
} else if !isTabTrayUIExperimentsEnabled {
414417
let toastAction = TabPanelMiddlewareAction(toastType: .closedSingleTab,
415418
windowUUID: uuid,
416419
actionType: TabPanelMiddlewareActionType.showToast)
@@ -494,15 +497,13 @@ class TabManagerMiddleware: BookmarksRefactorFeatureFlagProvider,
494497
actionType: TabPanelMiddlewareActionType.refreshTabs)
495498
store.dispatch(action)
496499

497-
let isTabTrayExperimentEnabled = featureFlags.isFeatureEnabled(.tabTrayUIExperiments,
498-
checking: .buildOnly)
499-
if tabsState.isPrivateMode && !isTabTrayExperimentEnabled {
500+
if tabsState.isPrivateMode && !isTabTrayUIExperimentsEnabled {
500501
let action = TabPanelMiddlewareAction(toastType: .closedAllTabs(count: privateCount),
501502
windowUUID: uuid,
502503
actionType: TabPanelMiddlewareActionType.showToast)
503504
store.dispatch(action)
504505
} else {
505-
if !isTabTrayExperimentEnabled {
506+
if !isTabTrayUIExperimentsEnabled {
506507
let toastAction = GeneralBrowserAction(toastType: .closedAllTabs(count: normalCount),
507508
windowUUID: uuid,
508509
actionType: GeneralBrowserActionType.showToast)

‎firefox-ios/Client/Frontend/Browser/Tabs/Views/ExperimentTabCell.swift

+1-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Shared
99
import SiteImageView
1010

1111
/// Tab cell used in the tab tray under the .tabTrayUIExperiments Nimbus experiment
12-
class ExperimentTabCell: UICollectionViewCell, ThemeApplicable, ReusableCell, FeatureFlaggable {
12+
class ExperimentTabCell: UICollectionViewCell, ThemeApplicable, ReusableCell {
1313
struct UX {
1414
static let selectedBorderWidth: CGFloat = 3.0
1515
static let unselectedBorderWidth: CGFloat = 1
@@ -89,10 +89,6 @@ class ExperimentTabCell: UICollectionViewCell, ThemeApplicable, ReusableCell, Fe
8989
button.alpha = 0.5
9090
}
9191

92-
private var isTabTrayUIExperimentsEnabled: Bool {
93-
return featureFlags.isFeatureEnabled(.tabTrayUIExperiments, checking: .buildOnly)
94-
}
95-
9692
override func layoutSubviews() {
9793
super.layoutSubviews()
9894
favicon.layer.cornerRadius = UX.faviconSize.height / 2

‎firefox-ios/Client/Frontend/Browser/Tabs/Views/RemoteTabsTableViewController.swift

+6-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ class RemoteTabsTableViewController: UITableViewController,
2727
private var hiddenSections = Set<Int>()
2828
private let logger: Logger
2929

30+
private var isTabTrayUIExperimentsEnabled: Bool {
31+
return featureFlags.isFeatureEnabled(.tabTrayUIExperiments, checking: .buildOnly)
32+
&& UIDevice.current.userInterfaceIdiom != .pad
33+
}
34+
3035
var themeManager: ThemeManager
3136
var themeObserver: NSObjectProtocol?
3237
var notificationCenter: NotificationProtocol
@@ -36,7 +41,7 @@ class RemoteTabsTableViewController: UITableViewController,
3641

3742
private var isShowingEmptyView: Bool { state.showingEmptyState != nil }
3843
private lazy var emptyView: RemoteTabsEmptyViewProtocol = {
39-
if featureFlags.isFeatureEnabled(.tabTrayUIExperiments, checking: .buildOnly) {
44+
if isTabTrayUIExperimentsEnabled {
4045
let view = ExperimentRemoteTabsEmptyView()
4146
view.translatesAutoresizingMaskIntoConstraints = false
4247
return view

‎firefox-ios/Client/Frontend/Browser/Tabs/Views/TabDisplayPanelViewController.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class TabDisplayPanelViewController: UIViewController,
2424

2525
private var isTabTrayUIExperimentsEnabled: Bool {
2626
return featureFlags.isFeatureEnabled(.tabTrayUIExperiments, checking: .buildOnly)
27+
&& UIDevice.current.userInterfaceIdiom != .pad
2728
}
2829

2930
private lazy var layout: TabTrayLayoutType = {
@@ -44,7 +45,7 @@ class TabDisplayPanelViewController: UIViewController,
4445
}()
4546
private var backgroundPrivacyOverlay: UIView = .build()
4647
private lazy var emptyPrivateTabsView: EmptyPrivateTabView = {
47-
if featureFlags.isFeatureEnabled(.tabTrayUIExperiments, checking: .buildOnly) {
48+
if isTabTrayUIExperimentsEnabled {
4849
let view = ExperimentEmptyPrivateTabsView()
4950
view.translatesAutoresizingMaskIntoConstraints = false
5051
return view

‎firefox-ios/Client/Frontend/Browser/Tabs/Views/TabDisplayView.swift

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class TabDisplayView: UIView,
3131

3232
private var isTabTrayUIExperimentsEnabled: Bool {
3333
return featureFlags.isFeatureEnabled(.tabTrayUIExperiments, checking: .buildOnly)
34+
&& UIDevice.current.userInterfaceIdiom != .pad
3435
}
3536

3637
var shouldHideInactiveTabs: Bool {

‎firefox-ios/Client/Frontend/Browser/Tabs/Views/TabTrayViewController.swift

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ class TabTrayViewController: UIViewController,
5656

5757
private var isTabTrayUIExperimentsEnabled: Bool {
5858
return featureFlags.isFeatureEnabled(.tabTrayUIExperiments, checking: .buildOnly)
59+
&& UIDevice.current.userInterfaceIdiom != .pad
5960
}
6061

6162
// MARK: - Redux state

0 commit comments

Comments
 (0)
Failed to load comments.