From 9abdef9cdf99eeebc3ce5c4dddd4810bba021c2f Mon Sep 17 00:00:00 2001 From: Winnie Teichmann <4530+thatswinnie@users.noreply.github.com> Date: Mon, 3 Nov 2025 15:50:41 +0100 Subject: [PATCH 1/5] Trigger a layout refresh to correctly position mask for translucent toolbars --- .../Client/Coordinators/Browser/BrowserCoordinator.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/firefox-ios/Client/Coordinators/Browser/BrowserCoordinator.swift b/firefox-ios/Client/Coordinators/Browser/BrowserCoordinator.swift index 2af5083c2b3d..460ed41de604 100644 --- a/firefox-ios/Client/Coordinators/Browser/BrowserCoordinator.swift +++ b/firefox-ios/Client/Coordinators/Browser/BrowserCoordinator.swift @@ -558,6 +558,14 @@ class BrowserCoordinator: BaseCoordinator, func didFinishSettings(from coordinator: SettingsCoordinator) { router.dismiss(animated: true, completion: nil) remove(child: coordinator) + + // FXIOS-13959: Changing address toolbar position from settings prevents content interaction homepage/webpage + // This bug is only happening in iOS 15 + 16 + // Trigger a layout refresh to correctly position mask for translucent toolbars + if #unavailable(iOS 17) { + browserViewController.view.setNeedsLayout() + browserViewController.view.layoutIfNeeded() + } } func openDebugTestTabs(count: Int) { From 801f313aaccee6bcfb936835221c1c7c7a0c9608 Mon Sep 17 00:00:00 2001 From: Winnie Teichmann <4530+thatswinnie@users.noreply.github.com> Date: Wed, 5 Nov 2025 14:13:46 +0100 Subject: [PATCH 2/5] Move ThemedNavigationController and ModalSettingsNavigationController plus create new SettingsNavigationController --- firefox-ios/Client.xcodeproj/project.pbxproj | 40 ++++++----- .../ModalSettingsNavigationController.swift | 11 +++ .../ThemedNavigationController.swift | 68 ++++++++++++++++++ .../SettingsNavigationController.swift | 69 ++----------------- 4 files changed, 107 insertions(+), 81 deletions(-) create mode 100644 firefox-ios/Client/Frontend/Components/ModalSettingsNavigationController.swift create mode 100644 firefox-ios/Client/Frontend/Components/ThemedNavigationController.swift diff --git a/firefox-ios/Client.xcodeproj/project.pbxproj b/firefox-ios/Client.xcodeproj/project.pbxproj index ead6b8d274fb..2e4067eead2c 100644 --- a/firefox-ios/Client.xcodeproj/project.pbxproj +++ b/firefox-ios/Client.xcodeproj/project.pbxproj @@ -406,7 +406,7 @@ 2CF9D9AA20067FA10083DF2A /* BrowsingPDFTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CF9D9A920067FA10083DF2A /* BrowsingPDFTests.swift */; }; 2F13E79B1AC0C02700D75081 /* StringExtensionsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F13E79A1AC0C02700D75081 /* StringExtensionsTests.swift */; }; 2F44FA1B1A9D426A00FD20CC /* TestHashExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F44FA1A1A9D426A00FD20CC /* TestHashExtensions.swift */; }; - 2F44FC721A9E840300FD20CC /* SettingsNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F44FC711A9E840300FD20CC /* SettingsNavigationController.swift */; }; + 2F44FC721A9E840300FD20CC /* ThemedNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F44FC711A9E840300FD20CC /* ThemedNavigationController.swift */; }; 2F44FCC51A9E85E900FD20CC /* SettingsTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F44FCC41A9E85E900FD20CC /* SettingsTableViewController.swift */; }; 2F44FCC71A9E8CF500FD20CC /* SearchSettingsTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F44FCC61A9E8CF500FD20CC /* SearchSettingsTableViewController.swift */; }; 2F44FCCB1A9E972E00FD20CC /* SearchEnginePicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F44FCCA1A9E972E00FD20CC /* SearchEnginePicker.swift */; }; @@ -1508,6 +1508,8 @@ C2200A6A2B7D148C00DC062A /* ContentBlockerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2200A692B7D148C00DC062A /* ContentBlockerTests.swift */; }; C22753402A3C9E1300B9C0D1 /* WebsiteDataManagementViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C227533F2A3C9E1300B9C0D1 /* WebsiteDataManagementViewModel.swift */; }; C2296FCC2A601C190046ECA6 /* IntensityVisualEffectView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2296FCB2A601C190046ECA6 /* IntensityVisualEffectView.swift */; }; + C234BFC02EBB8321004BF5A8 /* SettingsNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C234BFBF2EBB82E1004BF5A8 /* SettingsNavigationController.swift */; }; + C234BFC22EBB8356004BF5A8 /* ModalSettingsNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C234BFC12EBB8352004BF5A8 /* ModalSettingsNavigationController.swift */; }; C23889DF2A4EFCE500429673 /* ShareSheetCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C23889DE2A4EFCE500429673 /* ShareSheetCoordinator.swift */; }; C23889E12A4F3E7200429673 /* ParentCoordinatorDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C23889E02A4F3E7200429673 /* ParentCoordinatorDelegate.swift */; }; C23889E32A50319A00429673 /* ShareSheetCoordinatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C23889E22A50319A00429673 /* ShareSheetCoordinatorTests.swift */; }; @@ -3177,7 +3179,7 @@ 2F13E79A1AC0C02700D75081 /* StringExtensionsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StringExtensionsTests.swift; sourceTree = ""; }; 2F14E1391ABB890800FF98DB /* Account-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Account-Bridging-Header.h"; sourceTree = ""; }; 2F44FA1A1A9D426A00FD20CC /* TestHashExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestHashExtensions.swift; sourceTree = ""; }; - 2F44FC711A9E840300FD20CC /* SettingsNavigationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingsNavigationController.swift; sourceTree = ""; }; + 2F44FC711A9E840300FD20CC /* ThemedNavigationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ThemedNavigationController.swift; sourceTree = ""; }; 2F44FCC41A9E85E900FD20CC /* SettingsTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingsTableViewController.swift; sourceTree = ""; }; 2F44FCC61A9E8CF500FD20CC /* SearchSettingsTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SearchSettingsTableViewController.swift; sourceTree = ""; }; 2F44FCCA1A9E972E00FD20CC /* SearchEnginePicker.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SearchEnginePicker.swift; sourceTree = ""; }; @@ -9769,6 +9771,8 @@ C2200A692B7D148C00DC062A /* ContentBlockerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentBlockerTests.swift; sourceTree = ""; }; C227533F2A3C9E1300B9C0D1 /* WebsiteDataManagementViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebsiteDataManagementViewModel.swift; sourceTree = ""; }; C2296FCB2A601C190046ECA6 /* IntensityVisualEffectView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IntensityVisualEffectView.swift; sourceTree = ""; }; + C234BFBF2EBB82E1004BF5A8 /* SettingsNavigationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsNavigationController.swift; sourceTree = ""; }; + C234BFC12EBB8352004BF5A8 /* ModalSettingsNavigationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModalSettingsNavigationController.swift; sourceTree = ""; }; C23889DE2A4EFCE500429673 /* ShareSheetCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareSheetCoordinator.swift; sourceTree = ""; }; C23889E02A4F3E7200429673 /* ParentCoordinatorDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParentCoordinatorDelegate.swift; sourceTree = ""; }; C23889E22A50319A00429673 /* ShareSheetCoordinatorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareSheetCoordinatorTests.swift; sourceTree = ""; }; @@ -12012,37 +12016,37 @@ 2F44FC551A9E83E200FD20CC /* Settings */ = { isa = PBXGroup; children = ( - AAD861A92E9E757D00F6E0E0 /* Translation */, - BCBE04E22E3A52D4004B6039 /* Summarize */, + 8D8251721F4DE67E00780643 /* AdvancedAccountSettingViewController.swift */, BA4BB9962D7F371F006BD137 /* AppearanceSettings */, + ED8B49B72D6CF2AE00743444 /* AppIconSelection */, 2152473D2D6E4A4A0078D78A /* AutoFillPasswordSettingsViewController.swift */, - 8ADED55B2D6679B200345293 /* BrowsingSettingsViewController.swift */, - EDADF77B2D70C58200C39295 /* SettingsTelemetry.swift */, 8A15AB742D5FDB80008BB03C /* AutoplaySettingsViewController.swift */, - ED8B49B72D6CF2AE00743444 /* AppIconSelection */, - 216A0D772A40E83F008077BA /* ThemeSettings */, - 8A3EF7ED2A2FCEC900796E3A /* Main */, - EBB895322193FFF400EB91A0 /* ContentBlockerSettingViewController.swift */, - 8D8251721F4DE67E00780643 /* AdvancedAccountSettingViewController.swift */, + 8ADED55B2D6679B200345293 /* BrowsingSettingsViewController.swift */, 0B62EFD11AD63CD100ACB9CD /* Clearables.swift */, D3E8EEE71B97A87A001900FB /* ClearPrivateDataTableViewController.swift */, + EBB895322193FFF400EB91A0 /* ContentBlockerSettingViewController.swift */, 3B39EDCA1E16E1AA00EF029F /* CustomSearchViewController.swift */, BCFF93F32AAF9879005B5B71 /* FirefoxSuggestSettingsViewController.swift */, DFACBF83277B9B36003D5F41 /* HomepageSettings */, - C82F4C2A29AE2DF0005BD116 /* NotificationsSettingsViewController.swift */, + 8A3EF7ED2A2FCEC900796E3A /* Main */, D81E45121F82C56C004EFFBA /* NewTabContentSettingsViewController.swift */, + C82F4C2A29AE2DF0005BD116 /* NotificationsSettingsViewController.swift */, + 8AE1E1CE27B191160024C45E /* SearchBar */, 2F44FCCA1A9E972E00FD20CC /* SearchEnginePicker.swift */, 2F44FCC61A9E8CF500FD20CC /* SearchSettingsTableViewController.swift */, 74E36D771B71323500D69DA1 /* SettingsContentViewController.swift */, D04CD717215EBD85004FF5B0 /* SettingsLoadingView.swift */, - 2F44FC711A9E840300FD20CC /* SettingsNavigationController.swift */, + C234BFBF2EBB82E1004BF5A8 /* SettingsNavigationController.swift */, 2F44FCC41A9E85E900FD20CC /* SettingsTableViewController.swift */, + EDADF77B2D70C58200C39295 /* SettingsTelemetry.swift */, F85C7F0D2711C555004BDBA4 /* SettingsViewController.swift */, D821E9052141B71C00452C55 /* SiriSettingsViewController.swift */, + BCBE04E22E3A52D4004B6039 /* Summarize */, CEFA977D1FAA6B490016F365 /* SyncContentSettingsViewController.swift */, - 8AE1E1CE27B191160024C45E /* SearchBar */, - C22753422A3CA25100B9C0D1 /* WebsiteDataManagement */, + 216A0D772A40E83F008077BA /* ThemeSettings */, 211046CC2A7D842A00A7309F /* TPAccessoryInfo.swift */, + AAD861A92E9E757D00F6E0E0 /* Translation */, + C22753422A3CA25100B9C0D1 /* WebsiteDataManagement */, ); path = Settings; sourceTree = ""; @@ -13896,9 +13900,11 @@ 8A36BE2829EDBC6900AC1C5C /* ContentContainer.swift */, 8ACE9BFA2A54A010001E7A73 /* ExpandButtonState.swift */, 43AB6F9E25DC53D20016B015 /* LegacyLabelButtonHeaderView.swift */, + C234BFC12EBB8352004BF5A8 /* ModalSettingsNavigationController.swift */, 8AAC7C442D52C18A0011F87A /* SaveLoginAlert.swift */, 8A0D32832A61E1CC007D976D /* StatusBarOverlay.swift */, E17496362991A2480096900A /* SwiftUI */, + 2F44FC711A9E840300FD20CC /* ThemedNavigationController.swift */, ); path = Components; sourceTree = ""; @@ -18552,7 +18558,7 @@ D3B6923D1B9F9444004B87A4 /* FindInPageBar.swift in Sources */, 8A4B148B2CF919C800FCE2D0 /* UnifiedAdsConverter.swift in Sources */, 1D5CBF492B17E3CB0001D033 /* NotificationPayloads.swift in Sources */, - 2F44FC721A9E840300FD20CC /* SettingsNavigationController.swift in Sources */, + 2F44FC721A9E840300FD20CC /* ThemedNavigationController.swift in Sources */, 5A96FB5F2D96DAA300917B12 /* TabTraySelectorView.swift in Sources */, AB9CBC052C53B64C00102610 /* TrackingProtectionState.swift in Sources */, D0E89A2920910917001CE5C7 /* DownloadsPanel.swift in Sources */, @@ -18602,6 +18608,7 @@ 43E69EC3254D081D00B591C2 /* SimpleTab.swift in Sources */, 0BDDB33D2CA6B1DA00D501DF /* EditFolderViewController.swift in Sources */, AB8EE2D32C750E6100BD0A6B /* TrackingProtectionVerifiedByView.swift in Sources */, + C234BFC02EBB8321004BF5A8 /* SettingsNavigationController.swift in Sources */, 8ADAE4202A33A0FD007BF926 /* SendFeedbackSetting.swift in Sources */, C29B64812AD6959E00F3244B /* QRCodeCoordinator.swift in Sources */, 21A7C45028353D0E0071D996 /* OnboardingBasicCardViewController.swift in Sources */, @@ -18862,6 +18869,7 @@ E1CEC2022A28C3F100B177D5 /* LoginDetailCenteredTableViewCell.swift in Sources */, C2D71B972A384F40003DEC7A /* ThemedSubtitleTableViewCell.swift in Sources */, 2122EE552DDCFD8C00D42716 /* PageZoomSettingsViewModel.swift in Sources */, + C234BFC22EBB8356004BF5A8 /* ModalSettingsNavigationController.swift in Sources */, BC129A2D2E452082004A6875 /* SummarizeMiddleware.swift in Sources */, 8A83B7462A264FA0002FF9AC /* SettingsCoordinator.swift in Sources */, 619FE8932CE6595B004F83E2 /* WallpaperMiddleware.swift in Sources */, diff --git a/firefox-ios/Client/Frontend/Components/ModalSettingsNavigationController.swift b/firefox-ios/Client/Frontend/Components/ModalSettingsNavigationController.swift new file mode 100644 index 000000000000..a6eaa6f6ac8e --- /dev/null +++ b/firefox-ios/Client/Frontend/Components/ModalSettingsNavigationController.swift @@ -0,0 +1,11 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/ + +import UIKit + +class ModalSettingsNavigationController: UINavigationController { + override var preferredStatusBarStyle: UIStatusBarStyle { + return .default + } +} diff --git a/firefox-ios/Client/Frontend/Components/ThemedNavigationController.swift b/firefox-ios/Client/Frontend/Components/ThemedNavigationController.swift new file mode 100644 index 000000000000..511c62906660 --- /dev/null +++ b/firefox-ios/Client/Frontend/Components/ThemedNavigationController.swift @@ -0,0 +1,68 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/ + +import UIKit +import Common + +class ThemedNavigationController: DismissableNavigationViewController, Themeable { + var themeManager: ThemeManager + var themeListenerCancellable: Any? + var notificationCenter: NotificationProtocol + let windowUUID: WindowUUID + var currentWindowUUID: UUID? { windowUUID } + + init(windowUUID: WindowUUID, + themeManager: ThemeManager = AppContainer.shared.resolve(), + notificationCenter: NotificationProtocol = NotificationCenter.default) { + self.themeManager = themeManager + self.notificationCenter = notificationCenter + self.windowUUID = windowUUID + super.init(nibName: nil, bundle: nil) + } + + required init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + init(rootViewController: UIViewController, + windowUUID: WindowUUID, + themeManager: ThemeManager = AppContainer.shared.resolve(), + notificationCenter: NotificationProtocol = NotificationCenter.default) { + self.windowUUID = windowUUID + self.themeManager = themeManager + self.notificationCenter = notificationCenter + super.init(rootViewController: rootViewController) + } + + override var preferredStatusBarStyle: UIStatusBarStyle { + return topViewController?.preferredStatusBarStyle ?? .default + } + + override func viewDidLoad() { + super.viewDidLoad() + modalPresentationStyle = .overFullScreen + modalPresentationCapturesStatusBarAppearance = true + + listenForThemeChanges(withNotificationCenter: notificationCenter) + applyTheme() + } + + private func setupNavigationBarAppearance(theme: Theme) { + let standardAppearance = UINavigationBarAppearance() + standardAppearance.configureWithDefaultBackground() + standardAppearance.backgroundColor = theme.colors.layer1 + standardAppearance.titleTextAttributes = [.foregroundColor: theme.colors.textPrimary] + + navigationBar.standardAppearance = standardAppearance + navigationBar.compactAppearance = standardAppearance + navigationBar.scrollEdgeAppearance = standardAppearance + navigationBar.compactScrollEdgeAppearance = standardAppearance + navigationBar.tintColor = theme.colors.actionPrimary + } + + func applyTheme() { + setupNavigationBarAppearance(theme: themeManager.getCurrentTheme(for: windowUUID)) + setNeedsStatusBarAppearanceUpdate() + } +} diff --git a/firefox-ios/Client/Frontend/Settings/SettingsNavigationController.swift b/firefox-ios/Client/Frontend/Settings/SettingsNavigationController.swift index 99e17d81619b..4ba1bedbedb0 100644 --- a/firefox-ios/Client/Frontend/Settings/SettingsNavigationController.swift +++ b/firefox-ios/Client/Frontend/Settings/SettingsNavigationController.swift @@ -3,72 +3,11 @@ // file, You can obtain one at http://mozilla.org/MPL/2.0/ import UIKit -import Common -class ThemedNavigationController: DismissableNavigationViewController, Themeable { - var themeManager: ThemeManager - var themeListenerCancellable: Any? - var notificationCenter: NotificationProtocol - let windowUUID: WindowUUID - var currentWindowUUID: UUID? { windowUUID } +class SettingsNavigationController: ThemedNavigationController { + override func viewDidDisappear(_ animated: Bool) { + super.viewDidDisappear(animated) - init(windowUUID: WindowUUID, - themeManager: ThemeManager = AppContainer.shared.resolve(), - notificationCenter: NotificationProtocol = NotificationCenter.default) { - self.themeManager = themeManager - self.notificationCenter = notificationCenter - self.windowUUID = windowUUID - super.init(nibName: nil, bundle: nil) - } - - required init?(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - init(rootViewController: UIViewController, - windowUUID: WindowUUID, - themeManager: ThemeManager = AppContainer.shared.resolve(), - notificationCenter: NotificationProtocol = NotificationCenter.default) { - self.windowUUID = windowUUID - self.themeManager = themeManager - self.notificationCenter = notificationCenter - super.init(rootViewController: rootViewController) - } - - override var preferredStatusBarStyle: UIStatusBarStyle { - return topViewController?.preferredStatusBarStyle ?? .default - } - - override func viewDidLoad() { - super.viewDidLoad() - modalPresentationStyle = .overFullScreen - modalPresentationCapturesStatusBarAppearance = true - - listenForThemeChanges(withNotificationCenter: notificationCenter) - applyTheme() - } - - private func setupNavigationBarAppearance(theme: Theme) { - let standardAppearance = UINavigationBarAppearance() - standardAppearance.configureWithDefaultBackground() - standardAppearance.backgroundColor = theme.colors.layer1 - standardAppearance.titleTextAttributes = [.foregroundColor: theme.colors.textPrimary] - - navigationBar.standardAppearance = standardAppearance - navigationBar.compactAppearance = standardAppearance - navigationBar.scrollEdgeAppearance = standardAppearance - navigationBar.compactScrollEdgeAppearance = standardAppearance - navigationBar.tintColor = theme.colors.actionPrimary - } - - func applyTheme() { - setupNavigationBarAppearance(theme: themeManager.getCurrentTheme(for: windowUUID)) - setNeedsStatusBarAppearanceUpdate() - } -} - -class ModalSettingsNavigationController: UINavigationController { - override var preferredStatusBarStyle: UIStatusBarStyle { - return .default + NotificationCenter.default.post(name: .SettingsDismissed, object: self) } } From 9abe0b14922829d6f94d985e385985596a1a61b0 Mon Sep 17 00:00:00 2001 From: Winnie Teichmann <4530+thatswinnie@users.noreply.github.com> Date: Wed, 5 Nov 2025 14:14:33 +0100 Subject: [PATCH 3/5] Add notification --- BrowserKit/Sources/Common/Constants/NotificationConstants.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/BrowserKit/Sources/Common/Constants/NotificationConstants.swift b/BrowserKit/Sources/Common/Constants/NotificationConstants.swift index aea27e628ab2..330cf88ac5fa 100644 --- a/BrowserKit/Sources/Common/Constants/NotificationConstants.swift +++ b/BrowserKit/Sources/Common/Constants/NotificationConstants.swift @@ -99,6 +99,7 @@ extension Notification.Name { public static let TopSitesUpdated = Notification.Name("TopSitesUpdated") public static let PageZoomLevelUpdated = Notification.Name("PageZoomLevelUpdated") public static let PageZoomSettingsChanged = Notification.Name("PageZoomSettingsChanged") + public static let SettingsDismissed = Notification.Name("SettingsDismissed") // Search public static let DefaultSearchEngineUpdated = Notification.Name("DefaultSearchEngineUpdated") From 9c8acf953befb7743871525070c6f3c1097dd593 Mon Sep 17 00:00:00 2001 From: Winnie Teichmann <4530+thatswinnie@users.noreply.github.com> Date: Wed, 5 Nov 2025 14:14:47 +0100 Subject: [PATCH 4/5] Adjust fix --- .../Coordinators/Browser/BrowserCoordinator.swift | 10 +--------- .../Views/BrowserViewController.swift | 14 +++++++++++++- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/firefox-ios/Client/Coordinators/Browser/BrowserCoordinator.swift b/firefox-ios/Client/Coordinators/Browser/BrowserCoordinator.swift index 21b7a837a001..7b431cb9f86c 100644 --- a/firefox-ios/Client/Coordinators/Browser/BrowserCoordinator.swift +++ b/firefox-ios/Client/Coordinators/Browser/BrowserCoordinator.swift @@ -498,7 +498,7 @@ class BrowserCoordinator: BaseCoordinator, return // route is handled with existing child coordinator } windowManager.postWindowEvent(event: .settingsOpened, windowUUID: windowUUID) - let navigationController = ThemedNavigationController(windowUUID: windowUUID) + let navigationController = SettingsNavigationController(windowUUID: windowUUID) let isPad = UIDevice.current.userInterfaceIdiom == .pad let modalPresentationStyle: UIModalPresentationStyle = isPad ? .fullScreen: .formSheet navigationController.modalPresentationStyle = modalPresentationStyle @@ -558,14 +558,6 @@ class BrowserCoordinator: BaseCoordinator, func didFinishSettings(from coordinator: SettingsCoordinator) { router.dismiss(animated: true, completion: nil) remove(child: coordinator) - - // FXIOS-13959: Changing address toolbar position from settings prevents content interaction homepage/webpage - // This bug is only happening in iOS 15 + 16 - // Trigger a layout refresh to correctly position mask for translucent toolbars - if #unavailable(iOS 17) { - browserViewController.view.setNeedsLayout() - browserViewController.view.layoutIfNeeded() - } } func openDebugTestTabs(count: Int) { diff --git a/firefox-ios/Client/Frontend/Browser/BrowserViewController/Views/BrowserViewController.swift b/firefox-ios/Client/Frontend/Browser/BrowserViewController/Views/BrowserViewController.swift index 830da03b23b0..5ebf0e4337b9 100644 --- a/firefox-ios/Client/Frontend/Browser/BrowserViewController/Views/BrowserViewController.swift +++ b/firefox-ios/Client/Frontend/Browser/BrowserViewController/Views/BrowserViewController.swift @@ -1110,6 +1110,7 @@ class BrowserViewController: UIViewController, case .PageZoomSettingsChanged: handlePageZoomSettingsChanged(notification) case .RemoteTabNotificationTapped: openRecentlyClosedTabs() case .StopDownloads: onStopDownloads(notification) + case .SettingsDismissed: onSettingsDismissed() default: break } } @@ -1135,11 +1136,22 @@ class BrowserViewController: UIViewController, .PageZoomLevelUpdated, .PageZoomSettingsChanged, .RemoteTabNotificationTapped, - .StopDownloads + .StopDownloads, + .SettingsDismissed ] ) } + private func onSettingsDismissed() { + // FXIOS-13959: Changing address toolbar position from settings prevents content interaction homepage/webpage + // This bug is only happening in iOS 15 + 16 + // Trigger a layout refresh to correctly position mask for translucent toolbars + if #unavailable(iOS 17) { + view.setNeedsLayout() + view.layoutIfNeeded() + } + } + private func onStopDownloads(_ notification: Notification) { ensureMainThread { guard let notiWindowUUID = notification.userInfo?["windowUUID"] as? String, From e87a21e15ff1255c5384b67b44ce6ec4b608cf3e Mon Sep 17 00:00:00 2001 From: Winnie Teichmann <4530+thatswinnie@users.noreply.github.com> Date: Wed, 5 Nov 2025 15:04:59 +0100 Subject: [PATCH 5/5] Add comment --- .../BrowserViewController/Views/BrowserViewController.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/firefox-ios/Client/Frontend/Browser/BrowserViewController/Views/BrowserViewController.swift b/firefox-ios/Client/Frontend/Browser/BrowserViewController/Views/BrowserViewController.swift index 5ebf0e4337b9..9b68cd7a2e8e 100644 --- a/firefox-ios/Client/Frontend/Browser/BrowserViewController/Views/BrowserViewController.swift +++ b/firefox-ios/Client/Frontend/Browser/BrowserViewController/Views/BrowserViewController.swift @@ -1146,6 +1146,7 @@ class BrowserViewController: UIViewController, // FXIOS-13959: Changing address toolbar position from settings prevents content interaction homepage/webpage // This bug is only happening in iOS 15 + 16 // Trigger a layout refresh to correctly position mask for translucent toolbars + // Remove when support for iOS 15 + 16 is dropped: FXIOS-14024 if #unavailable(iOS 17) { view.setNeedsLayout() view.layoutIfNeeded()