From da5ad145b067dc412c907fcd66bc20c0a62fc074 Mon Sep 17 00:00:00 2001 From: Christophe Vila Date: Sat, 19 Sep 2026 19:08:36 +0200 Subject: [PATCH] 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 Claude-Session: https://claude.ai/code/session_01WYqycDFsynHH9VnnK7LNSf --- MyPass/Views/EntryListView.swift | 11 +---------- docs/superpowers/specs/2026-05-21-mypass-design.md | 2 +- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/MyPass/Views/EntryListView.swift b/MyPass/Views/EntryListView.swift index 7e8f8f2..1d969e8 100644 --- a/MyPass/Views/EntryListView.swift +++ b/MyPass/Views/EntryListView.swift @@ -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") diff --git a/docs/superpowers/specs/2026-05-21-mypass-design.md b/docs/superpowers/specs/2026-05-21-mypass-design.md index 9a22033..e673116 100644 --- a/docs/superpowers/specs/2026-05-21-mypass-design.md +++ b/docs/superpowers/specs/2026-05-21-mypass-design.md @@ -152,7 +152,7 @@ NavigationSplitView(columnVisibility:) `NavigationSplitView` is used on **both** platforms instead of maintaining separate iOS/macOS navigation code. On iPhone-width layouts it automatically collapses the sidebar into an overlay; on iPad/Mac it can sit persistently alongside the detail column. This behavior is built into the component — no platform-specific branching needed for it. - **Hamburger button** (leading toolbar item, `"line.3.horizontal"`) toggles `columnVisibility` between `.all` and `.detailOnly`, showing/hiding the sidebar. -- **Search icon** (trailing toolbar item, `"magnifyingglass"`) toggles a `.searchable()` bar over `EntryListView`; tapping again hides it and clears the query. +- **Search** is always visible via `.searchable()` over `EntryListView` (no toggle icon -- changed 2026-09-19 after hands-on use showed the extra tap added no value over an always-present search field). - Swipe-to-delete on entry rows; toolbar `+` button opens `EntryEditView` for a new entry (see "Add-entry flow" below). - Tapping a password field in `EntryDetailView` copies to clipboard (clears after 30 s). - TOTP code displays with a countdown ring and refreshes automatically.