Skip to content

Commit 800347c

Browse files
Revert "Fix FXIOS-13214 [Tab Animation] Fix increase in time to present and dismiss tab tray on iOS 26 (backport #28881)" (#28940)
Revert "Fix FXIOS-13214 [Tab Animation] Fix increase in time to present and d…" This reverts commit ce28dc5.
1 parent ce28dc5 commit 800347c

File tree

5 files changed

+15
-59
lines changed

5 files changed

+15
-59
lines changed

firefox-ios/Client/Frontend/Browser/Tabs/Views/Animation/TabAnimation.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ extension TabTrayViewController: BasicAnimationControllerDelegate {
7575

7676
let finalFrame = context.finalFrame(for: destinationController)
7777

78-
ensureMainThread { [self] in
78+
DispatchQueue.main.async { [self] in
7979
runPresentationAnimation(
8080
context: context,
8181
browserVC: bvc,
@@ -129,7 +129,7 @@ extension TabTrayViewController: BasicAnimationControllerDelegate {
129129
toView.frame = finalFrame
130130

131131
// Allow the UI to render to make the snapshotting code more performant
132-
ensureMainThread { [self] in
132+
DispatchQueue.main.async { [self] in
133133
runDismissalAnimation(
134134
context: context,
135135
toView: toView,

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,10 @@ class TabDisplayView: UIView,
170170
return
171171
}
172172

173-
// TODO: FXIOS-13264 - Fix compositional layout using estimated heights for cells so this check isn't necessary.
174-
if tabsState != state {
175-
dataSource.updateSnapshot(state: tabsState)
176-
}
177-
178173
tabsState = state
179174

175+
dataSource.updateSnapshot(state: tabsState)
176+
180177
if let scrollState = state.scrollState {
181178
scrollToTab(scrollState)
182179
}

firefox-ios/Client/Frontend/Home/Homepage Rebuild/HomepageViewController.swift

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -309,17 +309,13 @@ final class HomepageViewController: UIViewController,
309309
}
310310

311311
func newState(state: HomepageState) {
312+
self.homepageState = state
312313
wallpaperView.wallpaperState = state.wallpaperState
313314

314-
// TODO: FXIOS-13265 - Fix compositional layout using estimated heights for cells so this check isn't necessary.
315-
if self.homepageState != state {
316-
dataSource?.updateSnapshot(
317-
state: state,
318-
jumpBackInDisplayConfig: getJumpBackInDisplayConfig()
319-
)
320-
}
321-
322-
self.homepageState = state
315+
dataSource?.updateSnapshot(
316+
state: state,
317+
jumpBackInDisplayConfig: getJumpBackInDisplayConfig()
318+
)
323319
// FXIOS-11523 - Trigger impression when user opens homepage view new tab + scroll to top
324320
if homepageState.shouldTriggerImpression {
325321
scrollToTop()

firefox-ios/Client/Frontend/ShortcutsLibrary/ShortcutsLibraryViewController.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,6 @@ class ShortcutsLibraryViewController: UIViewController,
103103
}
104104

105105
func newState(state: ShortcutsLibraryState) {
106-
// TODO: FXIOS-13265 Fix compositional layout using estimated heights for cells so this check isn't necessary.
107-
guard self.shortcutsLibraryState != state else { return }
108106
self.shortcutsLibraryState = state
109107

110108
dataSource?.updateSnapshot(state: state)

firefox-ios/firefox-ios-tests/Tests/ClientTests/Frontend/Homepage Rebuild/HomepageViewControllerTests.swift

Lines changed: 6 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -219,39 +219,21 @@ final class HomepageViewControllerTests: XCTestCase, StoreTestUtility {
219219
func test_viewDidAppear_withStoriesRedesignDisabled_triggersHomepageAction() throws {
220220
setIsStoriesRedesignEnabled(isEnabled: false)
221221
let subject = createSubject()
222-
let initialState = HomepageState(windowUUID: .XCTestDefaultUUID)
223222
// Need to call loadViewIfNeeded and newState to populate the datasource
224223
// used to check whether we should send dispatch action or not
225224
// layoutIfNeeded() recalculates the collection view to have items
226225
subject.loadViewIfNeeded()
227-
subject.newState(state: initialState)
228-
subject.view.layoutIfNeeded()
229-
230-
let firstActionCalled = try XCTUnwrap(
231-
mockStore.dispatchedActions.last(where: { $0 is HomepageAction }) as? HomepageAction
232-
)
233-
let firstActionType = try XCTUnwrap(firstActionCalled.actionType as? HomepageActionType)
234-
XCTAssertEqual(firstActionType, HomepageActionType.initialize)
235-
236-
// Trigger a new state so that we have a snapshot update
237-
let newState = HomepageState.reducer(
238-
HomepageState(windowUUID: .XCTestDefaultUUID),
239-
GeneralBrowserAction(
240-
windowUUID: .XCTestDefaultUUID,
241-
actionType: GeneralBrowserActionType.didSelectedTabChangeToHomepage
242-
)
243-
)
244-
subject.newState(state: newState)
226+
subject.newState(state: HomepageState(windowUUID: .XCTestDefaultUUID))
245227
subject.view.layoutIfNeeded()
246228
subject.viewDidAppear(false)
247229

248230
XCTAssertTrue(mockThrottler.didCallThrottle)
249-
let secondActionCalled = try XCTUnwrap(
231+
let actionCalled = try XCTUnwrap(
250232
mockStore.dispatchedActions.last(where: { $0 is HomepageAction }) as? HomepageAction
251233
)
252-
let secondActionType = try XCTUnwrap(secondActionCalled.actionType as? HomepageActionType)
253-
XCTAssertEqual(secondActionType, HomepageActionType.sectionSeen)
254-
XCTAssertEqual(secondActionCalled.windowUUID, .XCTestDefaultUUID)
234+
let actionType = try XCTUnwrap(actionCalled.actionType as? HomepageActionType)
235+
XCTAssertEqual(actionType, HomepageActionType.sectionSeen)
236+
XCTAssertEqual(actionCalled.windowUUID, .XCTestDefaultUUID)
255237
}
256238

257239
// This test differs from the one above in that is has the `stories-redesign` feature flag enabled.
@@ -286,30 +268,13 @@ final class HomepageViewControllerTests: XCTestCase, StoreTestUtility {
286268
func test_scrollViewDidEndDecelerating_withStoriesRedesignDisabled_triggersHomepageAction() throws {
287269
setIsStoriesRedesignEnabled(isEnabled: false)
288270
let subject = createSubject()
289-
let initialState = HomepageState(windowUUID: .XCTestDefaultUUID)
290271
// Need to call loadViewIfNeeded and newState to populate the datasource
291272
// used to check whether we should send dispatch action or not
292273
// layoutIfNeeded() recalculates the collection view to have items
293274
subject.loadViewIfNeeded()
294-
subject.newState(state: initialState)
275+
subject.newState(state: HomepageState(windowUUID: .XCTestDefaultUUID))
295276
subject.view.layoutIfNeeded()
296277

297-
let firstActionCalled = try XCTUnwrap(
298-
mockStore.dispatchedActions.last(where: { $0 is HomepageAction }) as? HomepageAction
299-
)
300-
let firstActionType = try XCTUnwrap(firstActionCalled.actionType as? HomepageActionType)
301-
XCTAssertEqual(firstActionType, HomepageActionType.initialize)
302-
303-
// Trigger a new state so that we have a snapshot update
304-
let newState = HomepageState.reducer(
305-
HomepageState(windowUUID: .XCTestDefaultUUID),
306-
GeneralBrowserAction(
307-
windowUUID: .XCTestDefaultUUID,
308-
actionType: GeneralBrowserActionType.didSelectedTabChangeToHomepage
309-
)
310-
)
311-
subject.newState(state: newState)
312-
subject.view.layoutIfNeeded()
313278
subject.scrollViewDidEndDecelerating(UIScrollView())
314279

315280
XCTAssertTrue(mockThrottler.didCallThrottle)

0 commit comments

Comments
 (0)