Skip to content

Commit 3d949a9

Browse files
authoredMar 12, 2025
Remove FXIOS-11602 [Tab tray UI experiment] No more toasts on tab tray (#25269)
* No more toasts * Skip undo toast test
1 parent b1337f4 commit 3d949a9

File tree

2 files changed

+49
-37
lines changed

2 files changed

+49
-37
lines changed
 

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

+26-15
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import Storage
99

1010
import enum MozillaAppServices.BookmarkRoots
1111

12-
class TabManagerMiddleware: BookmarksRefactorFeatureFlagProvider {
12+
class TabManagerMiddleware: BookmarksRefactorFeatureFlagProvider,
13+
FeatureFlaggable {
1314
private let profile: Profile
1415
private let logger: Logger
1516
private let inactiveTabTelemetry = InactiveTabsTelemetry()
@@ -383,27 +384,33 @@ class TabManagerMiddleware: BookmarksRefactorFeatureFlagProvider {
383384
let shouldDismiss = await self.closeTab(with: tabUUID, uuid: uuid, isPrivate: isPrivate)
384385
triggerRefresh(uuid: uuid, isPrivate: isPrivate)
385386

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

392-
let toastAction = TabPanelMiddlewareAction(toastType: .closedSingleTab,
393-
windowUUID: uuid,
394-
actionType: TabPanelMiddlewareActionType.showToast)
395-
store.dispatch(toastAction)
395+
if !isTabTrayExperimentEnabled {
396+
let toastAction = TabPanelMiddlewareAction(toastType: .closedSingleTab,
397+
windowUUID: uuid,
398+
actionType: TabPanelMiddlewareActionType.showToast)
399+
store.dispatch(toastAction)
400+
}
396401
} else if shouldDismiss {
397402
let dismissAction = TabTrayAction(windowUUID: uuid,
398403
actionType: TabTrayActionType.dismissTabTray)
399404
store.dispatch(dismissAction)
400405

401-
let toastAction = GeneralBrowserAction(toastType: .closedSingleTab,
402-
windowUUID: uuid,
403-
actionType: GeneralBrowserActionType.showToast)
404-
store.dispatch(toastAction)
406+
if !isTabTrayExperimentEnabled {
407+
let toastAction = GeneralBrowserAction(toastType: .closedSingleTab,
408+
windowUUID: uuid,
409+
actionType: GeneralBrowserActionType.showToast)
410+
store.dispatch(toastAction)
411+
}
405412
addNewTabIfPrivate(uuid: uuid)
406-
} else {
413+
} else if !isTabTrayExperimentEnabled {
407414
let toastAction = TabPanelMiddlewareAction(toastType: .closedSingleTab,
408415
windowUUID: uuid,
409416
actionType: TabPanelMiddlewareActionType.showToast)
@@ -487,16 +494,20 @@ class TabManagerMiddleware: BookmarksRefactorFeatureFlagProvider {
487494
actionType: TabPanelMiddlewareActionType.refreshTabs)
488495
store.dispatch(action)
489496

490-
if tabsState.isPrivateMode {
497+
let isTabTrayExperimentEnabled = featureFlags.isFeatureEnabled(.tabTrayUIExperiments,
498+
checking: .buildOnly)
499+
if tabsState.isPrivateMode && !isTabTrayExperimentEnabled {
491500
let action = TabPanelMiddlewareAction(toastType: .closedAllTabs(count: privateCount),
492501
windowUUID: uuid,
493502
actionType: TabPanelMiddlewareActionType.showToast)
494503
store.dispatch(action)
495504
} else {
496-
let toastAction = GeneralBrowserAction(toastType: .closedAllTabs(count: normalCount),
497-
windowUUID: uuid,
498-
actionType: GeneralBrowserActionType.showToast)
499-
store.dispatch(toastAction)
505+
if !isTabTrayExperimentEnabled {
506+
let toastAction = GeneralBrowserAction(toastType: .closedAllTabs(count: normalCount),
507+
windowUUID: uuid,
508+
actionType: GeneralBrowserActionType.showToast)
509+
store.dispatch(toastAction)
510+
}
500511
addNewTabIfPrivate(uuid: uuid)
501512
}
502513
}

‎firefox-ios/firefox-ios-tests/Tests/XCUITests/TopTabsTest.swift

+23-22
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class TopTabsTest: BaseTestCase {
124124

125125
// https://mozilla.testrail.io/index.php?/cases/view/2306865
126126
// Smoketest
127-
func testCloseAllTabsUndo() {
127+
func testCloseAllTabsUndo() throws {
128128
navigator.nowAt(NewTabScreen)
129129
// A different tab than home is open to do the proper checks
130130
navigator.openURL(path(forTestPage: "test-mozilla-org.html"))
@@ -146,27 +146,28 @@ class TopTabsTest: BaseTestCase {
146146
}
147147
checkNumberOfTabsExpectedToBeOpen(expectedNumberOfTabsOpen: 2)
148148

149-
// Close all tabs, undo it and check that the number of tabs is correct
150-
navigator.performAction(Action.AcceptRemovingAllTabs)
151-
152-
app.otherElements.buttons.staticTexts["Undo"].waitAndTap()
153-
154-
mozWaitForElementToExist(
155-
app.collectionViews.links[AccessibilityIdentifiers.FirefoxHomepage.TopSites.itemCell]
156-
)
157-
navigator.nowAt(BrowserTab)
158-
if !iPad() {
159-
mozWaitForElementToExist(app.buttons[AccessibilityIdentifiers.Toolbar.tabsButton])
160-
}
161-
162-
if iPad() {
163-
navigator.goto(TabTray)
164-
} else {
165-
navigator.performAction(Action.CloseURLBarOpen)
166-
}
167-
checkNumberOfTabsExpectedToBeOpen(expectedNumberOfTabsOpen: 2)
168-
169-
mozWaitForElementToExist(app.cells.staticTexts[urlLabel])
149+
throw XCTSkip("Skipping since the tab UI experiment doesn't have this toast anymore")
150+
// // Close all tabs, undo it and check that the number of tabs is correct
151+
// navigator.performAction(Action.AcceptRemovingAllTabs)
152+
//
153+
// app.otherElements.buttons.staticTexts["Undo"].waitAndTap()
154+
//
155+
// mozWaitForElementToExist(
156+
// app.collectionViews.links[AccessibilityIdentifiers.FirefoxHomepage.TopSites.itemCell]
157+
// )
158+
// navigator.nowAt(BrowserTab)
159+
// if !iPad() {
160+
// mozWaitForElementToExist(app.buttons[AccessibilityIdentifiers.Toolbar.tabsButton])
161+
// }
162+
//
163+
// if iPad() {
164+
// navigator.goto(TabTray)
165+
// } else {
166+
// navigator.performAction(Action.CloseURLBarOpen)
167+
// }
168+
// checkNumberOfTabsExpectedToBeOpen(expectedNumberOfTabsOpen: 2)
169+
//
170+
// mozWaitForElementToExist(app.cells.staticTexts[urlLabel])
170171
}
171172

172173
// https://mozilla.testrail.io/index.php?/cases/view/2354473

0 commit comments

Comments
 (0)
Failed to load comments.