Hide the search mode picker until there's a query

The chats/messages picker has nothing to switch between before a query is
entered, so it only shows once the user starts searching.
This commit is contained in:
Stefan Ceriu
2026-09-10 17:24:03 +03:00
parent af202f3466
commit 9bff070648
5 changed files with 17 additions and 14 deletions
@@ -40,14 +40,17 @@ struct SearchScreen: View {
.padding(.horizontal, 16)
.padding(.vertical, 8)
Picker(L10n.actionSearch, selection: $context.searchMode) {
ForEach(SearchScreenMode.allCases) { mode in
Text(mode.title).tag(mode)
// There's nothing to switch between until the user searches for something.
if context.viewState.isSearching {
Picker(L10n.actionSearch, selection: $context.searchMode) {
ForEach(SearchScreenMode.allCases) { mode in
Text(mode.title).tag(mode)
}
}
.pickerStyle(.segmented)
.padding(.horizontal, 16)
.padding(.bottom, 8)
}
.pickerStyle(.segmented)
.padding(.horizontal, 16)
.padding(.bottom, 8)
switch context.viewState.bindings.searchMode {
case .rooms:
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7bfea050d80105ee2383b4c53466ca42f2a17bebad5d8211882292f75803a3e2
size 93453
oid sha256:99f93030951c29a907a1097916bb5a783211e6f6fed89b9d7bda87a35a0f024c
size 86970
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e40f5ec001e372489b4ae212080364b779caaeb80e5cea0fbc42b0626d57e2a1
size 100371
oid sha256:bee04cd0aec01b6559ad6e76f6be1809950ee62fde425880d4efd5d7bbfebb6b
size 92348
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2ad035e3a8905a8c16aa69cb6f7a640b022454812fd808eec45649995d85a4aa
size 49390
oid sha256:9d7e618d79d4a0c0fd7b931880f87ee000f57f75d52b51e50fd421bbc3a0a478
size 44012
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:37a6276be4d882858a34511cbc743154c84630e080835980d3744b5d5f6cf080
size 60230
oid sha256:a446fa6595aa3199c60a97ee3d4df423fcc2e07a2726343c3c0d1c12678d997f
size 53981