iOS: suggestion row above the keyboard; editor file name !484

merged merged by cmc on 2026-11-26 06:03 UTC · krz/orgstar:m4-suggestions into main

10 files changed, +314 −20

Layout: unified · split

Changed files (10)
Sources/OrgApp/CommandTitles.swift +1 · view
@@ -90,6 +90,7 @@ enum CommandTitles {
9090 String(localized: "Expand Table Columns", comment: "Command title"),
9191 String(localized: "Expand Word", comment: "Command title"),
9292 String(localized: "Export Agenda Files to iCalendar", comment: "Command title"),
93 String(localized: "Export Subtree…", comment: "Command title"),
9394 String(localized: "Export Table as TSV…", comment: "Command title"),
9495 String(localized: "Export Table to File…", comment: "Command title"),
9596 String(localized: "Export to HTML", comment: "Command title"),
Sources/OrgApp/SuggestionRow.swift added +40 · view
@@ -0,0 +1,40 @@
1import Foundation
2import OrgCore
3
4/// The iOS suggestion row: completion candidates in the key bar's place, tapped as the
5/// system's QuickType bar is. It shows the candidates the completion list would; the list
6/// stays for a hardware keyboard, whose keys move through it.
7public enum SuggestionRow {
8 /// A candidate as the row shows it: what is inserted, and what the list adds after it
9 /// (a snippet's name, a template's block, a heading's file).
10 public struct Item: Equatable, Sendable {
11 public let candidate: String
12 public let detail: String?
13 public let snippet: Bool
14 }
15
16 /// The most candidates the row holds; it scrolls through them.
17 public static let limit = 30
18
19 /// Candidates show in the row rather than the floating list: while the on-screen keyboard
20 /// is used, so not with a hardware keyboard.
21 public static func usesRow(hardwareKeyboard: Bool) -> Bool {
22 !hardwareKeyboard
23 }
24
25 /// The row takes the key bar's place: there are candidates, and the row wasn't put away
26 /// for this completion.
27 public static func shows(_ completion: Completion?, dismissed: Bool) -> Bool {
28 guard let completion, !dismissed else { return false }
29 return !completion.candidates.isEmpty
30 }
31
32 /// The candidates in the list's order, up to `limit`.
33 public static func items(_ completion: Completion, limit: Int = limit) -> [Item] {
34 completion.candidates.prefix(limit).map { candidate in
35 let label = completion.label(candidate)
36 let detail = label.hasPrefix(candidate) ? label.dropFirst(candidate.count).trimmingCharacters(in: .whitespaces) : ""
37 return Item(candidate: candidate, detail: detail.isEmpty ? nil : detail, snippet: completion.kind == .snippet)
38 }
39 }
40}
Sources/OrgstarMobile/EditorScreen.swift +19 −4 · view
@@ -83,7 +83,7 @@ struct EditorScreen: View {
8383 }
8484
8585 enum Sheet: Identifiable {
86 case palette, conflict, syncCopies, recovery
86 case palette, conflict, syncCopies, recovery, export
8787 /// `app.refile`, `app.refile.copy` or `app.refile.goto`.
8888 case refile(String)
8989 case block(BlockEdit)
@@ -102,6 +102,7 @@ struct EditorScreen: View {
102102 case .conflict: "conflict"
103103 case .syncCopies: "syncCopies"
104104 case .recovery: "recovery"
105 case .export: "export"
105106 case .block(let edit): "block \(edit.range)"
106107 case .columns: "columns"
107108 case .plot: "plot"
@@ -115,6 +116,9 @@ struct EditorScreen: View {
115116
116117 private var pane: EditorPane? { givenPane ?? holder.pane }
117118
119 /// Export Subtree…, which shows the export formats for the subtree at the caret.
120 static let exportSubtreeCommand = "app.export-subtree-dialog"
121
118122 /// The pane commands, as the Mac's View menu has them.
119123 static let paneCommands = ["app.split-right", "app.split-below", "app.pane-next", "app.pane-close", "app.pane-only"]
120124
@@ -138,7 +142,8 @@ struct EditorScreen: View {
138142 if syncCopies > 0 {
139143 Button("Resolve Sync Conflicts…", systemImage: "doc.on.doc") { sheet = .syncCopies }
140144 }
141 if recoveries > 0 {
145 // On iPhone, in Commands, so the file name has room at the largest text sizes.
146 if recoveries > 0, sizeClass == .regular {
142147 Button("Recovery Versions…", systemImage: "clock.arrow.circlepath") { sheet = .recovery }
143148 }
144149 Button("Find", systemImage: "magnifyingglass") {
@@ -152,7 +157,8 @@ struct EditorScreen: View {
152157 } primaryAction: {
153158 editor?.run("edit.undo")
154159 }
155 if let tree = session.document(of: path)?.tree {
160 // On iPhone, Export is in Commands, so the file name has room.
161 if sizeClass == .regular, let tree = session.document(of: path)?.tree {
156162 ExportMenu(path: path, tree: tree, report: { message = $0 }, exportSubtree: exportSubtree)
157163 }
158164 Button("Commands", systemImage: "command") { sheet = .palette }
@@ -220,6 +226,8 @@ struct EditorScreen: View {
220226 PlotScreen(plot: plot)
221227 case .crypt(let request):
222228 CryptScreen(request: request, session: session, editor: editor) { message = $0 }
229 case .export:
230 if let tree = session.document(of: path)?.tree { ExportScreen(path: path, tree: tree) { message = $0 } }
223231 case .exportSubtree(let caret):
224232 if let tree = session.document(of: path)?.tree { SubtreeExportScreen(path: path, tree: tree, caret: caret) }
225233 case .backlinks:
@@ -449,6 +457,10 @@ struct EditorScreen: View {
449457 if let caret = self.editor?.editContext().caret { message = session.archive(from: (path, caret)) }
450458 } else if id == "app.copy-rich-text" {
451459 if let text = session.document(of: path)?.text { message = ExportItems.copy(path: path, text: text, theme: model.theme) }
460 } else if id == "app.export-dialog" {
461 sheet = .export
462 } else if id == EditorScreen.exportSubtreeCommand {
463 exportSubtree()
452464 } else if id == "app.export.html-open" {
453465 exportHTMLAndOpen()
454466 } else if id == "app.export-body-only" {
@@ -1020,7 +1032,8 @@ struct CommandPalette: View {
10201032 ("app.clock.in-last", "Clock In to Last Entry"), ("app.clock.goto-recent", "Go to Recent Clocked Entry…"),
10211033 ("app.clock.default", "Mark as Default Clock Task"), ("app.clock.resolve", "Resolve Open Clocks…"),
10221034 ("app.refile", "Refile…"), ("app.refile.copy", "Copy to Refile Target…"), ("app.refile.goto", "Go to Refile Target…"),
1023 ("app.archive", "Archive Subtree"), ("app.copy-rich-text", "Copy as Rich Text"), ("app.export.html-open", "Export to HTML and Open"),
1035 ("app.archive", "Archive Subtree"), ("app.export-dialog", "Export…"), ("app.export-subtree-dialog", "Export Subtree…"),
1036 ("app.copy-rich-text", "Copy as Rich Text"), ("app.export.html-open", "Export to HTML and Open"),
10241037 ("app.export-body-only", "Turn Body-Only Export On or Off"),
10251038 ("app.export.icalendar-agenda", "Export Agenda Files to iCalendar"), ("app.export.icalendar-combined", "Combine Agenda Files into iCalendar"),
10261039 ("app.publish", "Publish Project…"), ("app.publish.all", "Publish All Projects"), ("app.publish.current-file", "Publish Current File"),
@@ -1112,6 +1125,8 @@ struct CommandPalette: View {
11121125 switch id {
11131126 case "app.recovery": return recoveries > 0 ? nil : String(localized: "No Recovery Versions")
11141127 case "app.sync-conflicts": return syncCopies > 0 ? nil : String(localized: "No sync conflict copies", comment: "Why Resolve Sync Conflicts… is greyed in the Commands list")
1128 case EditorScreen.exportSubtreeCommand:
1129 return ExportScope.subtree(context.text, at: context.caret) != nil ? nil : String(localized: "Not in a subtree", comment: "Why Export Subtree… is greyed in the Commands list")
11151130 default: return editor.applies(id, in: context) ? nil : CommandReason.reason(for: id, in: context)
11161131 }
11171132 }
Sources/OrgstarMobile/KeyBar.swift +93 −7 · view
@@ -7,7 +7,8 @@ import UIKit
77/// Org's keys for a touch keyboard: each button does what its key does at the caret, as the
88/// Emacs keymap binds it (M-→ demotes a heading, indents an item, moves a table column), or
99/// runs a command. The buttons are `[key-bar]` in config.toml, or the default; they share the
10/// width without scrolling, and those that don't fit go under More.
10/// width without scrolling, and those that don't fit go under More. While completion has
11/// candidates at the caret, they show in the bar's place.
1112struct KeyBar: View {
1213 let editor: MobileEditor
1314 let palette: () -> Void
@@ -109,6 +110,22 @@ struct KeyBar: View {
109110 @ScaledMetric(relativeTo: .body) private var size = KeyBar.target
110111
111112 var body: some View {
113 Group {
114 if SuggestionRow.shows(editor.suggestions.completion, dismissed: editor.suggestions.dismissed), let completion = editor.suggestions.completion {
115 suggestionRow(completion)
116 } else {
117 keys
118 }
119 }
120 .labelStyle(.iconOnly)
121 .padding(.horizontal, 6)
122 .padding(.vertical, Self.padding)
123 .frame(maxWidth: .infinity)
124 .onGeometryChange(for: CGFloat.self) { $0.size.width } action: { width = $0 }
125 .background(.bar)
126 }
127
128 private var keys: some View {
112129 let layout = sizeClass == .regular ? KeyBarLayout.Width.ipad : .iphone
113130 var ids = ((layout == .ipad ? ipad : iphone).map(KeyBarLayout.ids) ?? layout.defaultIDs).filter { Self.item($0) != nil }
114131 if editor.fields.active { ids = KeyBarLayout.withSnippetFields(ids) }
@@ -120,12 +137,52 @@ struct KeyBar: View {
120137 }
121138 if !more.isEmpty { moreButton(more) }
122139 }
123 .labelStyle(.iconOnly)
124 .padding(.horizontal, 6)
125 .padding(.vertical, Self.padding)
126 .frame(maxWidth: .infinity)
127 .onGeometryChange(for: CGFloat.self) { $0.size.width } action: { width = $0 }
128 .background(.bar)
140 }
141
142 /// The candidates at the caret in the bar's place, scrolling on their own, and at the end
143 /// the button that puts them away and brings the keys back.
144 private func suggestionRow(_ completion: Completion) -> some View {
145 HStack(spacing: 4) {
146 ScrollView(.horizontal, showsIndicators: false) {
147 HStack(spacing: 4) {
148 ForEach(SuggestionRow.items(completion), id: \.candidate) { item in
149 Button {
150 editor.chooseSuggestion(item.candidate)
151 } label: {
152 suggestionLabel(item)
153 }
154 .buttonStyle(SuggestionStyle(size: size))
155 .accessibilityLabel([item.candidate, item.detail, item.snippet ? String(localized: "snippet", comment: "Marks a snippet in the completion list") : nil]
156 .compactMap { $0 }.joined(separator: ", "))
157 }
158 }
159 .padding(.horizontal, 2)
160 }
161 // Back at the start for each new completion.
162 .id(completion.range.lowerBound)
163 Button {
164 editor.suggestions.dismissed = true
165 } label: {
166 Label(String(localized: "Hide Suggestions"), systemImage: "xmark")
167 }
168 .buttonStyle(KeyStyle(size: size, slots: 1))
169 .frame(width: KeyBar.widest)
170 .accessibilityLabel(String(localized: "Hide Suggestions"))
171 }
172 .dynamicTypeSize(...Self.largestSymbolSize)
173 .accessibilityIdentifier("suggestions")
174 }
175
176 private func suggestionLabel(_ item: SuggestionRow.Item) -> some View {
177 CappedWidth(width: 240) {
178 HStack(spacing: 4) {
179 if item.snippet { Image(systemName: "text.badge.plus").foregroundStyle(.tint) }
180 Text(item.candidate).foregroundStyle(.primary)
181 if let detail = item.detail { Text(detail).foregroundStyle(.secondary) }
182 }
183 .font(.body)
184 .lineLimit(1)
185 }
129186 }
130187
131188 @ViewBuilder
@@ -266,6 +323,35 @@ private struct KeyShape: ViewModifier {
266323 }
267324}
268325
326/// As wide as its content wants up to `width`, where a long suggestion is cut short.
327private struct CappedWidth: Layout {
328 let width: CGFloat
329
330 func sizeThatFits(proposal: ProposedViewSize, subviews: Subviews, cache: inout ()) -> CGSize {
331 guard let view = subviews.first else { return .zero }
332 let ideal = view.sizeThatFits(.unspecified)
333 return view.sizeThatFits(ProposedViewSize(width: min(ideal.width, width), height: proposal.height))
334 }
335
336 func placeSubviews(in bounds: CGRect, proposal: ProposedViewSize, subviews: Subviews, cache: inout ()) {
337 subviews.first?.place(at: bounds.origin, proposal: ProposedViewSize(bounds.size))
338 }
339}
340
341/// A suggestion: its text on a tile as tall as the keys, as wide as the text needs.
342private struct SuggestionStyle: ButtonStyle {
343 let size: CGFloat
344
345 func makeBody(configuration: Configuration) -> some View {
346 configuration.label
347 .padding(.horizontal, 12)
348 .frame(minHeight: size)
349 .background(.fill.tertiary, in: .rect(cornerRadius: 10))
350 .opacity(configuration.isPressed ? 0.5 : 1)
351 .contentShape(.rect)
352 }
353}
354
269355private struct KeyStyle: ButtonStyle {
270356 let size: CGFloat
271357 let slots: Int
Sources/OrgstarMobile/MobileEditor+Completion.swift +15 −1 · view
@@ -1,5 +1,6 @@
11#if os(iOS)
22import OrgApp
3import GameController
34import OrgCore
45import UIKit
56
@@ -100,6 +101,7 @@ extension MobileEditor {
100101
101102 func openCompletion(_ completion: Completion, select: Int? = nil) {
102103 completionFetched = nil
104 suggestions.dismissed = false
103105 if !completion.candidates.isEmpty { showCompletion(completion, select: select) }
104106 guard let query = completion.query, let source = completionSource else {
105107 if completion.candidates.isEmpty { closeCompletion() }
@@ -140,7 +142,10 @@ extension MobileEditor {
140142 completionList = view
141143 textView.addSubview(view)
142144 }
143 guard let position = textView.position(from: textView.beginningOfDocument, offset: completion.range.lowerBound) else { return }
145 let row = SuggestionRow.usesRow(hardwareKeyboard: GCKeyboard.coalesced != nil)
146 view.isHidden = row
147 suggestions.completion = row ? view.completion : nil
148 guard !row, let position = textView.position(from: textView.beginningOfDocument, offset: completion.range.lowerBound) else { return }
144149 let caret = textView.caretRect(for: position)
145150 let insets = textView.adjustedContentInset
146151 let visible = CGRect(x: textView.contentOffset.x, y: textView.contentOffset.y + insets.top,
@@ -154,6 +159,15 @@ extension MobileEditor {
154159 completionTask?.cancel()
155160 completionList?.removeFromSuperview()
156161 completionList = nil
162 suggestions.completion = nil
163 suggestions.dismissed = false
164 }
165
166 /// A candidate tapped in the suggestion row, inserted as one chosen from the list.
167 func chooseSuggestion(_ candidate: String) {
168 guard let completion = completionList?.completion else { return }
169 closeCompletion()
170 insertCompletion(completion, candidate)
157171 }
158172
159173 /// After typing: the open list follows the text; otherwise, as the settings say, a list
Sources/OrgstarMobile/MobileEditor.swift +10 −1 · view
@@ -130,6 +130,8 @@ final class MobileEditor: NSObject, DocumentBuffer {
130130 var completionTimer: Timer?
131131 var completionFetched: CompletionFlow.Fetched?
132132 var completionTask: Task<Void, Never>?
133 /// The candidates the key bar shows in its place while the on-screen keyboard is used.
134 let suggestions = Suggestions()
133135 /// `dabbrev-expand` being repeated, and the revision its last expansion left.
134136 var dabbrev: DabbrevExpansion?
135137 var dabbrevRevision: Int?
@@ -506,7 +508,7 @@ final class MobileEditor: NSObject, DocumentBuffer {
506508 case "app.word-count", "app.recovery", "app.sync-conflicts", "app.attach.photo", "app.attach.camera", "app.attach.scan": return onAppCommand != nil
507509 case _ where id.hasPrefix(NamedMacros.commandPrefix): return true
508510 case "app.refile", "app.refile.copy", "app.archive": return onAppCommand != nil && Presentation.heading(containing: context.caret, in: context.tree) != nil
509 case "app.copy-rich-text", "app.export.html-open", "app.export-body-only", "app.export.icalendar-agenda", "app.export.icalendar-combined": return onAppCommand != nil
511 case "app.export-dialog", "app.export-subtree-dialog", "app.copy-rich-text", "app.export.html-open", "app.export-body-only", "app.export.icalendar-agenda", "app.export.icalendar-combined": return onAppCommand != nil
510512 case _ where id.hasPrefix("app.publish"): return onAppCommand != nil
511513 case _ where Self.linkCommands.contains(id): return onAppCommand != nil
512514 case "org.link.open": return OpenLinkAtPoint().applies(in: context)
@@ -849,6 +851,13 @@ extension MobileEditor: NSTextLayoutManagerDelegate {
849851 }
850852}
851853
854/// The completion the suggestion row shows, and whether it was put away for it.
855@Observable
856final class Suggestions {
857 var completion: Completion?
858 var dismissed = false
859}
860
852861/// Whether a snippet's fields are being filled in.
853862@Observable
854863final class SnippetFields {
Tests/OrgAppTests/EditorCommandListTests.swift added +24 · view
@@ -0,0 +1,24 @@
1import Foundation
2import Testing
3@testable import OrgApp
4
5/// The iOS editor's Commands list, read from its source as CommandTitleTests does: the target
6/// isn't built by `swift test`.
7struct EditorCommandListTests {
8 static let root = URL(fileURLWithPath: #filePath).deletingLastPathComponent().deletingLastPathComponent().deletingLastPathComponent()
9
10 static func viewCommands() throws -> [(id: String, title: String)] {
11 let source = try String(contentsOf: root.appendingPathComponent("Sources/OrgstarMobile/EditorScreen.swift"), encoding: .utf8)
12 return source.matches(of: /\("((?:app|org|edit|editor|view)\.[^"]+)", "([^"\\]+)"\)/).map { (String($0.1), String($0.2)) }
13 }
14
15 /// #236: Export is in Commands, under Export, since the iPhone toolbar has no room for it.
16 @Test func exportIsInTheEditorsCommands() throws {
17 let commands = try Self.viewCommands()
18 #expect(commands.contains { $0 == ("app.export-dialog", "Export…") })
19 #expect(commands.contains { $0 == ("app.export-subtree-dialog", "Export Subtree…") })
20 let export = try #require(CommandGroups.commandList.firstIndex { $0.prefixes.contains("app.export") })
21 #expect(CommandGroups.group(of: "app.export-dialog", in: CommandGroups.commandList) == export)
22 #expect(CommandGroups.group(of: "app.export-subtree-dialog", in: CommandGroups.commandList) == export)
23 }
24}
Tests/OrgAppTests/SuggestionRowTests.swift added +62 · view
@@ -0,0 +1,62 @@
1import Foundation
2import Testing
3import OrgCore
4@testable import OrgApp
5
6/// The iOS suggestion row (#145).
7struct SuggestionRowTests {
8 func context(_ text: String, options: EditingOptions = .org) -> EditContext {
9 let caret = text.utf16.count
10 return EditContext(revision: 0, text: text, tree: OrgParser.parse(text), selection: [caret..<caret], options: options)
11 }
12
13 @Test func rowOnlyWithTheOnScreenKeyboard() {
14 #expect(SuggestionRow.usesRow(hardwareKeyboard: false))
15 #expect(!SuggestionRow.usesRow(hardwareKeyboard: true))
16 }
17
18 @Test func showsWhileThereAreCandidates() {
19 let completion = OrgCompletion.at(context("#+TIT"))
20 #expect(SuggestionRow.shows(completion, dismissed: false))
21 #expect(!SuggestionRow.shows(completion, dismissed: true))
22 #expect(!SuggestionRow.shows(nil, dismissed: false))
23 // Nothing matches: the key bar stays.
24 #expect(!SuggestionRow.shows(OrgCompletion.at(context("#+XYZQ")), dismissed: false))
25 }
26
27 @Test func showsWhenTheListWouldOpenByItself() {
28 let options = CompletionOptions(auto: true, prefix: 3)
29 for text in ["#+TI", "#+TIT"] {
30 let completion = OrgCompletion.at(context(text))
31 let opened = CompletionAuto.opens(completion, options) ? completion : nil
32 #expect(SuggestionRow.shows(opened, dismissed: false) == (text == "#+TIT"))
33 }
34 }
35
36 @Test func itemsFollowTheListsOrder() throws {
37 let completion = try #require(OrgCompletion.at(context("#+TIT")))
38 let items = SuggestionRow.items(completion)
39 #expect(items.map(\.candidate) == completion.candidates)
40 #expect(items.allSatisfy { !$0.snippet && $0.detail == nil })
41 #expect(SuggestionRow.items(completion, limit: 1).count == min(1, completion.candidates.count))
42 }
43
44 @Test func snippetsWithTheirNames() throws {
45 var options = EditingOptions.org
46 options.snippets = [Snippet(trigger: "meeting", name: "Meeting notes", body: "x"), Snippet(trigger: "mail", body: "y")]
47 let completion = try #require(OrgCompletion.at(context("m", options: options)))
48 #expect(completion.kind == .snippet)
49 let items = SuggestionRow.items(completion)
50 #expect(Set(items.map(\.candidate)) == ["meeting", "mail"])
51 #expect(items.allSatisfy { $0.snippet })
52 #expect(items.first { $0.candidate == "meeting" }?.detail == "Meeting notes")
53 #expect(items.first { $0.candidate == "mail" }?.detail == nil)
54 }
55
56 @Test func templatesWithTheirBlocks() throws {
57 let completion = try #require(OrgCompletion.at(context("<s")))
58 #expect(completion.kind == .template)
59 let item = try #require(SuggestionRow.items(completion).first { $0.candidate == "<s" })
60 #expect(item.detail == "src")
61 }
62}
docs/manual/guide/14-ios.org +15 −7 · view
@@ -57,11 +57,13 @@ The toolbar has:
5757- Conflict :: shown while the file and your edits conflict; opens the conflict sheet.
5858- Find :: the system find bar. The result shown is selected, and opened when it is in folded text.
5959- Resolve Sync Conflicts… :: shown while the file has Syncthing conflict copies; see Conflicts below.
60- Recovery Versions… :: shown while the recovery folder holds versions of the file; see Conflicts below.
60- Recovery Versions… :: on iPad, shown while the recovery folder holds versions of the file; see Conflicts below.
6161- Undo :: touch and hold it for Redo.
62- Export :: the export formats, as in the reader; see Export below.
62- Export :: on iPad, the export formats; see Export below.
6363- Commands :: every command; see Commands below.
6464
65On iPhone, Recovery Versions…, Export… and Export Subtree… are in Commands, so the file name has room at every text size.
66
6567The key bar holds what you repeat at the caret while typing, the toolbar what acts on the whole file, and Commands everything else.
6668
6769Messages from commands show at the top of the editor and the column view, and at the bottom of the reader, the agenda and the board, for a few seconds; tap one to dismiss it. VoiceOver reads each message as it appears. An error opening, saving or reading a file shows what failed on its first line, such as =Couldn't Save File=.
@@ -164,13 +166,19 @@ When the buttons don't fit the width, the bar shows as many as fit, in order, an
164166
165167While a snippet's fields are filled in, Previous Snippet Field and Next Snippet Field take the places of Promote and Demote, so the fields work without a hardware keyboard; Promote and Demote come back when the snippet ends. A bar without Promote or Demote shows the field buttons first.
166168
169*** Suggestions
170
171While completion has candidates at the caret, the bar shows them in place of its buttons, as the system's QuickType bar does: the candidates the completion list would show, in its order, each with what the list adds after it, such as a snippet's name (with a snippet symbol) or a template's block. Tap one to insert it as choosing it from the list does; a snippet expands. The suggestions scroll sideways when they don't fit; the × at the end stays in place and puts them away, bringing the buttons back until the word is finished or Complete at Point is run again. The row is as tall as the buttons and follows the text size the same way.
172
173Suggestions appear when the list would open by itself (Settings ▸ Completion, with its pause and minimum length) and on Complete at Point in Commands. They take the list's place while the on-screen keyboard is used, on iPhone and iPad; with a hardware keyboard the list opens at the caret instead, so its keys move through it, and the bar keeps its buttons.
174
167175** Commands
168176
169177Commands, 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.
170178
171179Named 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.
172180
173The 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.
181The editor's list has Export… and Export Subtree… under Export. The 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.
174182
175183When a command asks a question, a sheet opens:
176184
@@ -222,7 +230,7 @@ See [[file:03-keys.org][Keys and commands]] for the Emacs bindings.
222230
223231** Completion
224232
225With a hardware keyboard, Complete at Point (=C-M-i=, or =C-SPC= in Doom's insert state), Expand Word (=M-/=, or =F5= with the Mac keys) and Complete Word (=C-M-/=, or =C-n= and =C-p= in Doom's insert state) work as on the Mac; see [[file:02-the-editor.org][The editor]]. The list shows up to 8 rows under the caret; the keys move through it as on the Mac, and tapping a row inserts it. The settings in Settings ▸ Completion are the Mac's: whether the list opens by itself, after which pause and how many characters, prefix or fuzzy matching, and words in the list. With them on, the list also opens as you type on the on-screen keyboard, where tapping a row is the way to choose.
233With a hardware keyboard, Complete at Point (=C-M-i=, or =C-SPC= in Doom's insert state), Expand Word (=M-/=, or =F5= with the Mac keys) and Complete Word (=C-M-/=, or =C-n= and =C-p= in Doom's insert state) work as on the Mac; see [[file:02-the-editor.org][The editor]]. The list shows up to 8 rows under the caret; the keys move through it as on the Mac, and tapping a row inserts it. The settings in Settings ▸ Completion are the Mac's: whether the list opens by itself, after which pause and how many characters, prefix or fuzzy matching, and words in the list. With them on, candidates also show as you type on the on-screen keyboard, in the key bar's place; see Suggestions under The key bar.
226234
227235** Snippets
228236
@@ -391,11 +399,11 @@ The app icon's badge counts the entries in the agenda's Overdue section that are
391399
392400* Export
393401
394Export (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.
402Export (in the editor's toolbar on iPad, and Export… in the Commands of the editor and the reader) 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.
395403
396404PDF 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.
397405
398Body Only in the Export menu leaves out the title and the page around the text in HTML, Markdown, LaTeX and Plain Text (ASCII), and is kept for each file; the other formats say they have no body-only export while it is on. Export Subtree…, in the editor's Export menu, shares the subtree at the caret in any of the formats.
406Body Only in the Export menu leaves out the title and the page around the text in HTML, Markdown, LaTeX and Plain Text (ASCII), and is kept for each file; the other formats say they have no body-only export while it is on. Export Subtree…, in the editor's Commands and its Export menu on iPad, shares the subtree at the caret in any of the formats.
399407
400408The Export menu also has Export Agenda Files to iCalendar, which writes an =.ics= beside each agenda file, and Combine Agenda Files into iCalendar, which shares one calendar of them all. Commands has these, Copy as Rich Text, and Export to HTML and Open, which shows the HTML export in Quick Look. Without orgstar+, the Export menu's items that need it end in "(orgstar+)" and open the orgstar+ screen.
401409
@@ -432,7 +440,7 @@ The version you don't keep goes to the recovery folder.
432440
433441Resolve Sync Conflicts… (in the editor's toolbar while there are copies, and in Commands) lists Syncthing's conflict copies of the file (=name.sync-conflict-…=), each compared with the file, with Keep File, Merge and Use Copy. The copy goes to the recovery folder and is removed. When a file with conflict copies opens in the editor, a message says how many there are.
434442
435Recovery Versions… (in the editor's toolbar while there are versions, and in Commands) lists the versions of the file kept in the recovery folder, newest first, each compared with the editor's text. Restore puts a version's text in the editor as an edit you can undo.
443Recovery Versions… (in Commands, and in the editor's toolbar on iPad while there are versions) lists the versions of the file kept in the recovery folder, newest first, each compared with the editor's text. Restore puts a version's text in the editor as an edit you can undo.
436444
437445See [[file:15-alongside-emacs.org][Working alongside Emacs and other tools]] for how merging and recovery work.
438446
l10n/Localizable.xcstrings +35 · view
@@ -18970,6 +18970,41 @@
1897018970 }
1897118971 }
1897218972 },
18973 "Hide Suggestions": {
18974 "comment": "Key bar: puts the completion suggestions away and shows the keys again",
18975 "localizations": {
18976 "de": {
18977 "stringUnit": {
18978 "state": "translated",
18979 "value": "Vorschläge ausblenden"
18980 }
18981 },
18982 "es": {
18983 "stringUnit": {
18984 "state": "translated",
18985 "value": "Ocultar sugerencias"
18986 }
18987 },
18988 "fr": {
18989 "stringUnit": {
18990 "state": "translated",
18991 "value": "Masquer les suggestions"
18992 }
18993 },
18994 "ja": {
18995 "stringUnit": {
18996 "state": "translated",
18997 "value": "候補を隠す"
18998 }
18999 },
19000 "pt-BR": {
19001 "stringUnit": {
19002 "state": "translated",
19003 "value": "Ocultar Sugestões"
19004 }
19005 }
19006 }
19007 },
1897319008 "Hide entries from earlier days": {
1897419009 "localizations": {
1897519010 "de": {
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