fix: make search bar always visible instead of toggle-behind-icon
Removed the magnifying-glass toolbar button and the isSearching state it drove -- .searchable() now shows the search field unconditionally, which is simpler and was requested after hands-on use showed the extra tap added no value. Updated the spec to match. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WYqycDFsynHH9VnnK7LNSf
This commit is contained in:
@@ -4,7 +4,6 @@ import MyPassCore
|
||||
|
||||
struct EntryListView: View {
|
||||
@ObservedObject var vm: VaultViewModel
|
||||
@State private var isSearching = false
|
||||
@State private var showAddEntry = false
|
||||
|
||||
var body: some View {
|
||||
@@ -25,16 +24,8 @@ struct EntryListView: View {
|
||||
}
|
||||
}
|
||||
.navigationTitle("MyPass")
|
||||
.searchable(text: $vm.searchQuery, isPresented: $isSearching, prompt: "Search entries…")
|
||||
.searchable(text: $vm.searchQuery, prompt: "Search entries…")
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .primaryAction) {
|
||||
Button {
|
||||
if isSearching { vm.searchQuery = "" }
|
||||
isSearching.toggle()
|
||||
} label: {
|
||||
Image(systemName: "magnifyingglass")
|
||||
}
|
||||
}
|
||||
ToolbarItem(placement: .primaryAction) {
|
||||
Button { showAddEntry = true } label: {
|
||||
Image(systemName: "plus")
|
||||
|
||||
Reference in New Issue
Block a user