Add support for quick room search through the Cmd+K shortcut (#2363)

This commit is contained in:
Stefan Ceriu
2024-01-29 14:55:11 +02:00
committed by GitHub
parent c442afa5f6
commit 197b088662
28 changed files with 796 additions and 61 deletions
@@ -94,6 +94,12 @@ struct HomeScreenContent: View {
.onChange(of: context.viewState.visibleRooms) { _ in
updateVisibleRange()
}
.background(
Button("", action: {
context.send(viewAction: .globalSearch)
})
.keyboardShortcut(KeyEquivalent("k"), modifiers: [.command])
)
.scrollDismissesKeyboard(.immediately)
.scrollDisabled(context.viewState.roomListMode == .skeletons)
.scrollBounceBehavior(context.viewState.roomListMode == .empty ? .basedOnSize : .automatic)