Commit 6833641ef2

6833641ef2e0266e0a76279d33a3bfffafb9e130

parent: ca2e56c4b6

Verified · cmc

cmc <hello@cleberg.net> · 2026-10-10 20:34 UTC

iOS: Search in the Agenda and Folders navigation bars, not a tab

Layout: unified · split

Sources/OrgstarMobile/OrgstarMobileApp.swift +15 −10
@@ -57,7 +57,10 @@ final class AppDelegate: NSObject, UIApplicationDelegate, UNUserNotificationCent
5757 }
5858}
5959
60enum AppTab: Hashable { case agenda, folders, settings, search }
60enum AppTab: Hashable { case agenda, folders, settings }
61
62/// The search screen, pushed from the Agenda and Folders tabs.
63struct SearchRoute: Hashable {}
6164
6265extension View {
6366 /// Readers pushed for `ReaderRoute`s.
@@ -68,6 +71,9 @@ extension View {
6871 .navigationDestination(for: EditorRoute.self) { route in
6972 EditorScreen(path: route.path, offset: route.offset, workspace: workspace, session: session)
7073 }
74 .navigationDestination(for: SearchRoute.self) { _ in
75 SearchScreen(workspace: workspace, session: session)
76 }
7177 }
7278}
7379
@@ -156,21 +162,14 @@ struct RootView: View {
156162 NavigationStack(path: $agendaPath) {
157163 AgendaScreen(workspace: workspace, session: session, agenda: agenda, scheduler: model.scheduler)
158164 .equatable()
159 .toolbar { captureButton }
165 .toolbar { searchButton; captureButton }
160166 .readerDestination(workspace: workspace, session: session)
161167 }
162168 }
163169 Tab("Folders", systemImage: "folder", value: .folders) {
164170 NavigationStack {
165171 FoldersScreen(workspace: workspace, session: session)
166 .toolbar { captureButton }
167 .readerDestination(workspace: workspace, session: session)
168 }
169 }
170 // An ordinary tab, not the search role, which the tab bar always puts last.
171 Tab("Search", systemImage: "magnifyingglass", value: .search) {
172 NavigationStack {
173 SearchScreen(workspace: workspace, session: session)
172 .toolbar { searchButton; captureButton }
174173 .readerDestination(workspace: workspace, session: session)
175174 }
176175 }
@@ -298,6 +297,12 @@ struct RootView: View {
298297 }
299298 }
300299
300 private var searchButton: some ToolbarContent {
301 ToolbarItem(placement: .primaryAction) {
302 NavigationLink(value: SearchRoute()) { Label("Search", systemImage: "magnifyingglass") }
303 }
304 }
305
301306 private var captureButton: some ToolbarContent {
302307 ToolbarItem(placement: .primaryAction) {
303308 Button("Capture", systemImage: "square.and.pencil") { capture = CaptureRequest() }
docs/manual/guide/14-ios.org +4 −3
@@ -4,13 +4,14 @@
44
55* Overview
66
7The app has four tabs:
7The app has three tabs:
88
99- Agenda :: the agenda over your folders, with capture.
1010- Folders :: the folders of org files you added. Each shows its subfolders and org files; tap a subfolder to open it.
11- Search :: file names and the words of headings.
1211- Settings :: where the app's settings come from.
1312
13The search button (the magnifying glass) at the top right of Agenda and Folders opens Search.
14
1415Files open in a reader first. The Edit button in the reader opens the editor. Both use the same open file, so an edit in the editor shows in the reader when you go back.
1516
1617* Folders and file access
@@ -145,7 +146,7 @@ See [[file:03-keys.org][Keys and commands]] for the Emacs bindings.
145146
146147* Search
147148
148The Search tab finds:
149Search finds:
149150
150151- Files :: up to eight org files whose path matches what you type, ranked as Quick Open ranks them on the Mac.
151152- Headings :: headings whose title or text contains your words, including unsaved edits in the open file.