Fix search screen preview tests and add snapshots

This commit is contained in:
Stefan Ceriu
2026-07-02 17:40:14 +03:00
parent a433793418
commit 4c2243cda1
21 changed files with 64 additions and 17 deletions
@@ -74,7 +74,7 @@ struct SearchScreen: View {
}
.frame(maxHeight: .infinity, alignment: .top)
.background(Color.compound.bgCanvasDefault)
.searchable(text: $context.searchQuery, placement: .toolbarPrincipal)
.conditionalSearchable(searchQuery: $context.searchQuery)
.searchFocused($isSearchFieldFocused)
.autocorrectionDisabled(true)
.background(tabShortcuts)
@@ -213,6 +213,17 @@ struct SearchScreen: View {
}
}
private extension View {
/// Searchable makes the preview contents randomly appear lower
@ViewBuilder func conditionalSearchable(searchQuery: Binding<String>) -> some View {
if !ProcessInfo.isXcodePreview, !ProcessInfo.isRunningTests {
searchable(text: searchQuery, placement: .toolbarPrincipal)
} else {
self
}
}
}
private struct SearchScreenRoomCell: View {
let room: SearchScreenRoom
let context: SearchScreenViewModel.Context
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0a93a6802d8a053abd390e9311921294dfbab18844eb17a63eaf4b8c623173a9
size 85119
oid sha256:8332e6211e8fdad7dd1623748771d2008c17c2d8193a3ffe957346c8d94f4086
size 94641
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:72835c30b6f459759cbbae44aaba4aed0c39674c49879602c7a8a319323b9db1
size 88205
oid sha256:aa5e1fa38d7bbfadb55daf260435e11c9860ae1f63411dfb756cbcf6a50f70c5
size 102168
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:25f1c159081bfcf7e1fb181bb6f1ee2f614a1ae3759052cc5dac3f7266b271ba
size 42662
oid sha256:b5fa800dc1baf2e5e52b39cdeb460d0463bde64f3ab721124050cfc992f308cf
size 50335
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:513a8d3815582253be1eecf22a7726c7917c9e83e7465aa5e7b90ef2d7944c1e
size 49713
oid sha256:98a12236fc3813000eec89080c4a5e6fb4414ab690750c0c9fbf6ddc79b5d7fb
size 61874
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:11753001e5dbeb4bf3d2b71991096ffacba68ac9e4b244763affcefca20567cb
size 94885
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:df702d4f0929233e211341424ff14f8ed6ff1f558f7dcbfdcc627338e0612c79
size 103618
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:759a3218edd55b0d4505108523f6d620a5db73fbf5f3b46ceb4f348e2b890486
size 52394
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:fd7cdf5319f41f891a6577565db68863f002c1fec23f7be265e039d3a51aaa9d
size 62596
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:11753001e5dbeb4bf3d2b71991096ffacba68ac9e4b244763affcefca20567cb
size 94885
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:df702d4f0929233e211341424ff14f8ed6ff1f558f7dcbfdcc627338e0612c79
size 103618
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:759a3218edd55b0d4505108523f6d620a5db73fbf5f3b46ceb4f348e2b890486
size 52394
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:fd7cdf5319f41f891a6577565db68863f002c1fec23f7be265e039d3a51aaa9d
size 62596
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3d6cd51861f45a9e393eb3194ee7224a094646ce4385f2aa8ecb1be404bbaa6d
size 87898
oid sha256:2e2a5821c0b45c566cbf23b7fc4a20c89d944e3b7fa7d0e527976926fe162386
size 94721
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c96db7daacd17e38fb6d0d74cc9de51f52b0c17fb2c02c2c162d8384ca1ab6d2
size 94243
oid sha256:a31e6c8f3c6c12244291dfbe8796d46e68f77b7f4601bd6af8ef248024ce84c8
size 102826
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:31369bff674e454cb3cacdcb7a33efe035c838e4d09b549ba07979597d74a744
size 49368
oid sha256:09248c6998a1e731ed447c927f2f8a03c3ed72083090f56a8d8864d2d51db579
size 51932
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7cc94abaa65358e0cf82a0635b0aaa5f7858f0a765b3ddf0f8b647cba493cfe6
size 58249
oid sha256:1f28caa2bc1a7aef205404d2af3ffb348b389c9eb83169482fcc1350c6120bab
size 62489
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b4aa5c23728897a395066dab65511f747347ed866968d96191377a206c037938
size 174905
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5b58acb1090b90d13fa175b3dd8bf4318bdb41b51dcbe26d328d7ab0c57be0f4
size 177766
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:795306316da27b79588f5e941988c9ec851d59aa23b8c0153ffa5401837dc9ec
size 123602
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1ad0f4d5f683254c0e0cf59f103f462338c77b56616570ef77cd8e334a76243a
size 126165