Show recent searches on the search screen

The search screen's empty state now lists the queries the user searched
for and the rooms they opened from the results, newest first, capped at 25
and stored in AppSettings. Tapping a query fills the search field, tapping
a room opens it, and both are reachable with a hardware keyboard.

Rooms are resolved from their identifiers as the room list loads, and
those the user has left or is only invited to are dropped. The history is
cleared on logout.
This commit is contained in:
Stefan Ceriu
2026-09-10 17:26:35 +03:00
parent 9bff070648
commit 482cc0fee8
16 changed files with 295 additions and 21 deletions
@@ -73,6 +73,7 @@ final nonisolated class AppSettings: @unchecked Sendable {
func resetSessionSpecificSettings() {
MXLog.warning("Resetting the user session specific AppSettings.")
resetHasRunIdentityConfirmationOnboarding()
resetSearchBreadcrumbs()
}
// MARK: - Hooks
@@ -360,6 +361,12 @@ final nonisolated class AppSettings: @unchecked Sendable {
@UserPreference(defaultValue: false)
var roomListNotificationCountEnabled: Bool
// MARK: - Search Screen
/// The queries the user searched for and the rooms they opened from the results, most recent first.
@UserPreference(defaultValue: [SearchBreadcrumb]())
var searchBreadcrumbs: [SearchBreadcrumb]
// MARK: - Room Screen
@UserPreference(defaultValue: AppBuildType.current == .debug)