Search tab (#5754)

* Add a developer flag for the search tab
Introduces a globalSearchEnabled user preference (off by default) with a toggle in Developer Options, used to gate the new search experience.

* Support search role tabs in the tab coordinator
Migrates the NavigationTabCoordinator to SwiftUI's value-based Tab API and adds an isSearch option so a tab can adopt the iOS 26 .search role, which detaches it into the trailing search button in the tab bar.

* Moves room search to a new screen
Adds a new screen that filters the alternate room summary provider as you type, shows an empty state, and lists matching rooms with their matrix identifier. Supports hardware keyboard selection (arrow keys to move through results, return to open) by reaching into the system search field.

* Present search in a dedicated tab
Adds the search tab to the chats flow on iOS 26 when the flag is enabled, rendered as the detached .search role button. The Cmd+K shortcut now selects this tab, and the home screen's inline search is hidden while the tab is available.

* Remove the old global search screen
The dedicated search tab replaces the Cmd+K floating window, so the GlobalSearchScreen, its window plumbing in the WindowManager, and its presentation in the chats flow are all removed.
This commit is contained in:
Stefan Ceriu
2026-06-19 13:50:17 +03:00
committed by GitHub
parent 9a6f7595e5
commit 7f1b6086ae
58 changed files with 731 additions and 780 deletions
@@ -14961,7 +14961,6 @@ nonisolated class VoiceMessageRecorderMock: VoiceMessageRecorderProtocol, @unche
nonisolated class WindowManagerMock: WindowManagerProtocol, @unchecked Sendable {
nonisolated(unsafe) var mainWindow: UIWindow!
nonisolated(unsafe) var overlayWindow: UIWindow!
nonisolated(unsafe) var globalSearchWindow: UIWindow!
nonisolated(unsafe) var alternateWindow: UIWindow!
nonisolated(unsafe) var windows: [UIWindow] = []
var secondaryWindowsEnabled: Bool {
@@ -14970,40 +14969,6 @@ nonisolated class WindowManagerMock: WindowManagerProtocol, @unchecked Sendable
}
nonisolated(unsafe) var underlyingSecondaryWindowsEnabled: Bool!
//MARK: - showGlobalSearch
private let showGlobalSearchCallsCountLock = NSLock()
private nonisolated(unsafe) var showGlobalSearchUnderlyingCallsCount = 0
var showGlobalSearchCallsCount: Int {
get { showGlobalSearchCallsCountLock.withLock { showGlobalSearchUnderlyingCallsCount } }
set { showGlobalSearchCallsCountLock.withLock { showGlobalSearchUnderlyingCallsCount = newValue } }
}
var showGlobalSearchCalled: Bool {
return showGlobalSearchCallsCount > 0
}
nonisolated(unsafe) var showGlobalSearchClosure: (() -> Void)?
func showGlobalSearch() {
showGlobalSearchCallsCountLock.withLock { showGlobalSearchUnderlyingCallsCount += 1 }
showGlobalSearchClosure?()
}
//MARK: - hideGlobalSearch
private let hideGlobalSearchCallsCountLock = NSLock()
private nonisolated(unsafe) var hideGlobalSearchUnderlyingCallsCount = 0
var hideGlobalSearchCallsCount: Int {
get { hideGlobalSearchCallsCountLock.withLock { hideGlobalSearchUnderlyingCallsCount } }
set { hideGlobalSearchCallsCountLock.withLock { hideGlobalSearchUnderlyingCallsCount = newValue } }
}
var hideGlobalSearchCalled: Bool {
return hideGlobalSearchCallsCount > 0
}
nonisolated(unsafe) var hideGlobalSearchClosure: (() -> Void)?
func hideGlobalSearch() {
hideGlobalSearchCallsCountLock.withLock { hideGlobalSearchUnderlyingCallsCount += 1 }
hideGlobalSearchClosure?()
}
//MARK: - registerCoordinator
private let registerCoordinatorFlowCoordinatorForWindowTypeCallsCountLock = NSLock()