Commit c4d5cb219a

c4d5cb219ab6fe95c4d840f835a207f3da933181

parent: 97747b094d

Verified · cmc

cmc <hello@cleberg.net> · 2026-11-26 04:04 UTC

iOS reader: Find, Edit and Commands in the toolbar; Outline and Export in Commands

The file name shows in full on iPhone. Snippet field commands are in the
Commands list and the Org menu's Text group.

Ref #135

Layout: unified · split

Changed files (5)
Sources/OrgApp/CommandRanking.swift +1 −1 · view
@@ -84,7 +84,7 @@ public enum CommandGroups {
8484 Group(title: String(localized: "Tables", comment: "Org menu submenu"), prefixes: ["org.table", "app.table-", "app.plot"]),
8585 Group(title: String(localized: "Links and Footnotes", comment: "Org menu submenu"), prefixes: ["org.link.", "org.id.", "org.footnote."]),
8686 Group(title: String(localized: "Blocks", comment: "Org menu submenu"), prefixes: ["org.babel.", "org.structure-template", "org.edit-special", "org.dblock.", "org.clock.report", "org.denote."]),
87 Group(title: String(localized: "Text", comment: "Org menu submenu"), prefixes: ["org.emphasize", "org.fill-"]),
87 Group(title: String(localized: "Text", comment: "Org menu submenu"), prefixes: ["org.emphasize", "org.fill-", "org.snippet"]),
8888 Group(title: String(localized: "Attachments", comment: "Org menu submenu"), prefixes: ["app.attach."]),
8989 Group(title: String(localized: "Notes", comment: "Org menu submenu"), prefixes: ["app.dailies.", "app.node.", "app.backlinks"]),
9090 Group(title: String(localized: "Encryption", comment: "Org menu submenu"), prefixes: ["app.crypt."]),
Sources/OrgstarMobile/EditorScreen.swift +3 −2 · view
@@ -443,12 +443,12 @@ struct EditorScreen: View {
443443 } else if id == "app.archive" {
444444 if let caret = self.editor?.editContext().caret { message = session.archive(from: (path, caret)) }
445445 } else if id == "app.copy-rich-text" {
446 if let text = session.document(of: path)?.text { message = ExportMenu.copy(path: path, text: text, theme: model.theme) }
446 if let text = session.document(of: path)?.text { message = ExportItems.copy(path: path, text: text, theme: model.theme) }
447447 } else if id == "app.export.html-open" {
448448 exportHTMLAndOpen()
449449 } else if id == "app.export-body-only" {
450450 let on = !ExportSettings.saved(for: path).bodyOnly
451 ExportMenu.setBodyOnly(on, path: path)
451 ExportItems.setBodyOnly(on, path: path)
452452 message = on ? "Export: body only" : "Export: whole document"
453453 } else if id == "app.export.icalendar-agenda" || id == "app.export.icalendar-combined" {
454454 agendaCalendars(combined: id == "app.export.icalendar-combined")
@@ -1174,6 +1174,7 @@ struct CommandPalette: View {
11741174 ("app.publish", "Publish Project…"), ("app.publish.all", "Publish All Projects"), ("app.publish.current-file", "Publish Current File"),
11751175 ("app.publish.current-project", "Publish Current Project"),
11761176 ("app.toggle-markup", "Show or Hide Markup"), ("app.word-count", "Word Count"),
1177 ("org.snippet.next-field", "Next Snippet Field"), ("org.snippet.previous-field", "Previous Snippet Field"),
11771178 ("app.recovery", "Recovery Versions…"), ("app.sync-conflicts", "Resolve Sync Conflicts…"),
11781179 ("org.toggle-inline-images", "Show or Hide Inline Images"), ("org.toggle-inline-images-linked", "Show or Hide Inline Images, Including Described Links"), ("org.latex-preview", "Show or Hide LaTeX Previews"), ("editor.toggle-truncate-lines", "Truncate or Wrap Long Lines"), ("editor.toggle-auto-fill", "Turn Auto Fill On or Off"),
11791180 ("edit.isearch-forward", "Incremental Search"), ("edit.isearch-backward", "Incremental Search Backward"),
Sources/OrgstarMobile/ExportMenu.swift +33 −2 · view
@@ -163,6 +163,37 @@ struct OrgExport: Transferable {
163163/// Sharing the file as HTML, Markdown, PDF, Word, RTF, plain text, ODT, iCalendar, LaTeX or ASCII: to another app, or saved with
164164/// Save to Files; or copying it as rich text.
165165struct ExportMenu: View {
166 let path: String
167 let tree: OrgTree
168 var report: (String) -> Void = { _ in }
169 var exportSubtree: (() -> Void)?
170
171 var body: some View {
172 Menu("Export", systemImage: "square.and.arrow.up") {
173 ExportItems(path: path, tree: tree, report: report, exportSubtree: exportSubtree)
174 }
175 }
176}
177
178/// The export menu's items as a list, for a screen without the menu in its toolbar.
179struct ExportScreen: View {
180 let path: String
181 let tree: OrgTree
182 var report: (String) -> Void = { _ in }
183 @Environment(\.dismiss) private var dismiss
184
185 var body: some View {
186 NavigationStack {
187 List { ExportItems(path: path, tree: tree, report: report) }
188 .navigationTitle("Export")
189 .navigationBarTitleDisplayMode(.inline)
190 .toolbar { ToolbarItem(placement: .confirmationAction) { Button("Done") { dismiss() } } }
191 }
192 }
193}
194
195/// Export's formats, Body Only, the agenda calendars and Copy as Rich Text.
196struct ExportItems: View {
166197 let path: String
167198 let tree: OrgTree
168199 @Environment(MobileModel.self) private var model
@@ -178,7 +209,7 @@ struct ExportMenu: View {
178209 let text = tree.text
179210 // From the open tree: SwiftUI evaluates the menu on every edit.
180211 let name = ExportScope.fileName(tree, settings: OrgPreferences.orgSettings())
181 Menu("Export", systemImage: "square.and.arrow.up") {
212 Group {
182213 ForEach(OrgExport.Format.allCases, id: \.self) { format in
183214 if format.locked {
184215 Button("\(format.name) (orgstar+)") { ProAccess.shared.allows(.export) }
@@ -190,7 +221,7 @@ struct ExportMenu: View {
190221 ShareLink(item: export, preview: SharePreview(export.fileName)) { Text(format.name) }
191222 }
192223 }
193 Toggle("Body Only", isOn: Binding(get: { bodyOnly }, set: { ExportMenu.setBodyOnly($0, path: path) }))
224 Toggle("Body Only", isOn: Binding(get: { bodyOnly }, set: { ExportItems.setBodyOnly($0, path: path) }))
194225 if let exportSubtree {
195226 Button("Export Subtree…", systemImage: "list.bullet.indent") { exportSubtree() }
196227 }
Sources/OrgstarMobile/ReaderScreen.swift +6 −2 · view
@@ -41,6 +41,7 @@ struct ReaderScreen: View {
4141 @State private var width: CGFloat = 0
4242 @State private var showingOutline = false
4343 @State private var showingCommands = false
44 @State private var showingExport = false
4445 /// The command chosen in Commands, run once the list is gone.
4546 @State private var chosenCommand: String?
4647 @State private var message: String?
@@ -129,9 +130,7 @@ struct ReaderScreen: View {
129130 findRequest += 1
130131 }
131132 .disabled(document == nil)
132 Button("Outline", systemImage: "list.bullet.indent") { showingOutline = true }.disabled(outline.isEmpty)
133133 if let path = shownPath {
134 if let tree = document?.tree { ExportMenu(path: path, tree: tree) { message = $0 } }
135134 NavigationLink(value: EditorRoute(path: path, offset: nil)) { Label("Edit", systemImage: "pencil") }
136135 }
137136 Button("Commands", systemImage: "command") { showingCommands = true }
@@ -148,6 +147,9 @@ struct ReaderScreen: View {
148147 }
149148 .quickLookPreview($previewed)
150149 .sheet(isPresented: $showingOutline) { outlineSheet }
150 .sheet(isPresented: $showingExport) {
151 if let path = shownPath, let tree = document?.tree { ExportScreen(path: path, tree: tree) { message = $0 } }
152 }
151153 .message($message)
152154 .environment(\.openURL, OpenURLAction { url in follow(url) })
153155 .background { FindHost(find: find, request: findRequest) }
@@ -165,6 +167,7 @@ struct ReaderScreen: View {
165167 [
166168 CommandRow(id: "reader.find", title: String(localized: "Find"), reason: document == nil ? String(localized: "Nothing to do here") : nil),
167169 CommandRow(id: "reader.outline", title: String(localized: "Outline"), reason: outline.isEmpty ? String(localized: "Nothing to do here") : nil),
170 CommandRow(id: "reader.export", title: String(localized: "Export…"), reason: document == nil ? String(localized: "Nothing to do here") : nil),
168171 CommandRow(id: "app.toggle-markup", title: CommandTitle.localized("Show or Hide Markup")),
169172 CommandRow(id: "app.capture", title: CommandTitle.localized("Capture…")),
170173 ] + MobileClock.screenCommands.map { CommandRow(id: $0.id, title: CommandTitle.localized($0.title)) }
@@ -176,6 +179,7 @@ struct ReaderScreen: View {
176179 find.text = (document?.tree.text ?? "") as NSString
177180 findRequest += 1
178181 case "reader.outline": showingOutline = true
182 case "reader.export": showingExport = true
179183 case "app.toggle-markup": model.showMarkup.toggle()
180184 case "app.capture": model.captureRequest = CaptureRequest()
181185 default: _ = MobileClock.run(id, model: model, workspace: workspace) { message = $0 }
docs/manual/guide/14-ios.org +4 −4 · view
@@ -42,7 +42,7 @@ Tap a file in Folders or Search, or Open in File in an agenda entry's sheet, to
4242- Text is styled as in the editor, in the theme's colours, font, size, line spacing and heading sizes, on the theme's background: TODO keywords, priorities, tags, emphasis, code, timestamps, links, and the code in src blocks. Text can be selected and copied.
4343- The reader follows the editor's display settings (see Themes and display below): Show Markup, hidden emphasis markers, pretty entities, indentation, leading stars, inline images and truncated lines. Tables show at full width, without narrowed columns.
4444- Tap a link to follow it. Links to headings and files in your folders open in the reader; links to other files, such as an attached PDF or image, open in Quick Look; web links open in the browser.
45- The toolbar has Find, Outline (a list of headings to jump to), Export, Edit (the pencil) and Commands: Find, Outline, Show or Hide Markup, Capture… and the clock commands that need no caret.
45- The toolbar has Find, Edit (the pencil) and Commands, which has Outline (a list of headings to jump to) and Export… as well; see Commands below.
4646- Tags aligned with spaces show at the right edge of the heading's line, or on a line of their own at the right when the heading wraps (see [[file:02-the-editor.org][The editor]], Wrapping and filling).
4747- Find opens the system find bar over the file's text. Results are marked, and the one shown is unfolded and scrolled to.
4848
@@ -156,9 +156,9 @@ Bold, Italic and Code are in the edit menu of a selection, under Format: each pu
156156
157157Commands, in the key bar and in the toolbar of the editor, the reader and the agenda, lists the commands of the screen. With nothing typed, the ten you ran from Commands most recently come first under Recent, then every command by subject, in the Org menu's groups (Visibility, Headings, TODO and Tags, and so on) followed by Clock, Export, File, Edit and View. Type to search: the letters you type must appear in the title in order, as in the Mac's command palette, and commands you run often rank a little higher. The command runs once the list closes.
158158
159Named keyboard macros are listed by name under Edit. In the editor, a command that doesn't apply at the caret is listed greyed, with the reason, such as =Not in a list= or =No table at point=, so a search finds everything the editor can do. With a hardware keyboard attached, each command shows its Emacs key.
159Named keyboard macros are listed by name under Edit, and Next Snippet Field and Previous Snippet Field under Text with the other snippet commands. In the editor, a command that doesn't apply at the caret is listed greyed, with the reason, such as =Not in a list= or =No table at point=, so a search finds everything the editor can do. With a hardware keyboard attached, each command shows its Emacs key.
160160
161The reader's list has Find, Outline, Show or Hide Markup, Capture… and the clock commands that need no caret. The agenda's has its views, Tags and Properties…, Search…, Save as View…, Today, Earlier, Later, Go to Date…, Log Mode, Filter…, Select, Board, Capture… and the same clock commands.
161The reader's list has Find, Outline, Export…, Show or Hide Markup, Capture… and the clock commands that need no caret. The agenda's has its views, Tags and Properties…, Search…, Save as View…, Today, Earlier, Later, Go to Date…, Log Mode, Filter…, Select, Board, Capture… and the same clock commands.
162162
163163When a command asks a question, a sheet opens:
164164
@@ -375,7 +375,7 @@ The app icon's badge counts the entries in the agenda's Overdue section that are
375375
376376* Export
377377
378Export (in the reader's and the editor's toolbars) offers HTML, Markdown, PDF, Word, Rich Text (RTF), Plain Text, ODT, iCalendar, LaTeX and Plain Text (ASCII), and Copy as Rich Text. Each opens the share sheet with a file named after the org file, which you can send to another app or keep with Save to Files. The export reads the file's setup files and follows its export keywords, as the Mac's export does. For a file the LaTeX or ASCII export can't write as Emacs would, the share sheet stops and "Can't export to LaTeX: " or "Can't export to plain text: " and the reason show at the bottom of the screen.
378Export (in the editor's toolbar, and Export… in the reader's Commands) offers HTML, Markdown, PDF, Word, Rich Text (RTF), Plain Text, ODT, iCalendar, LaTeX and Plain Text (ASCII), and Copy as Rich Text. Each opens the share sheet with a file named after the org file, which you can send to another app or keep with Save to Files. The export reads the file's setup files and follows its export keywords, as the Mac's export does. For a file the LaTeX or ASCII export can't write as Emacs would, the share sheet stops and "Can't export to LaTeX: " or "Can't export to plain text: " and the reason show at the bottom of the screen.
379379
380380PDF export follows =pdf-margin=, =pdf-font= and =pdf-page-numbers= in =config.toml=, and Word files get heading styles and the file's images, as on the Mac. PDF through LaTeX isn't available on iOS.
381381
Keyboard shortcuts

Global

⌘K
Command palette & jump
/
Focus search
?
Show this help
g d
Dashboard
g e
Explore repositories
g n
Notifications

Repository & editor

t
Find file in repository
y
Copy immutable SHA permalink
g c
Code tab
g i
Issues tab
g m
Merge requests tab
g b
Builds tab
⌘↵
Submit active form