Commit 29b57626b6

29b57626b6e9757f773ad01c0bf814d1a32df160

parent: 7d77bed210

Verified · cmc

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

iOS: one Commands list on every screen, a fixed key bar, no More menu

Commands lists recent commands, then every command by subject in the Org
menu's groups; search is fuzzy as on the Mac. Commands that don't apply at
the caret are greyed with the reason. Keys show only with a hardware
keyboard. The editor, reader and agenda toolbars have a Commands button.

The key bar has eleven buttons sharing its width: Schedule, Deadline and
Tags are behind Plan on iPhone. Bold, Italic and Code are in the
selection's edit menu. More is gone: Recovery Versions and Resolve Sync
Conflicts are toolbar buttons while there is something to show, Export is
a share button, and the rest is in Commands. The iPad Org menu uses the
shared group table.

Closes #136
Closes #135

Layout: unified · split

Changed files (15)
Sources/OrgApp/CommandTitles.swift +5 · view
@@ -16,6 +16,7 @@ enum CommandTitles {
16 String(localized: "Attach File by Moving…", comment: "Command title"), 16 String(localized: "Attach File by Moving…", comment: "Command title"),
17 String(localized: "Attach File from URL…", comment: "Command title"), 17 String(localized: "Attach File from URL…", comment: "Command title"),
18 String(localized: "Attach File…", comment: "Command title"), 18 String(localized: "Attach File…", comment: "Command title"),
19 String(localized: "Attach Photo or Video…", comment: "Command title"),
19 String(localized: "Backward Character", comment: "Command title"), 20 String(localized: "Backward Character", comment: "Command title"),
20 String(localized: "Backward Word", comment: "Command title"), 21 String(localized: "Backward Word", comment: "Command title"),
21 String(localized: "Beginning of Buffer", comment: "Command title"), 22 String(localized: "Beginning of Buffer", comment: "Command title"),
@@ -86,6 +87,7 @@ enum CommandTitles {
86 String(localized: "Expand Snippet", comment: "Command title"), 87 String(localized: "Expand Snippet", comment: "Command title"),
87 String(localized: "Expand Table Columns", comment: "Command title"), 88 String(localized: "Expand Table Columns", comment: "Command title"),
88 String(localized: "Export Agenda Files to iCalendar", comment: "Command title"), 89 String(localized: "Export Agenda Files to iCalendar", comment: "Command title"),
90 String(localized: "Export Table as TSV…", comment: "Command title"),
89 String(localized: "Export Table to File…", comment: "Command title"), 91 String(localized: "Export Table to File…", comment: "Command title"),
90 String(localized: "Export to HTML", comment: "Command title"), 92 String(localized: "Export to HTML", comment: "Command title"),
91 String(localized: "Export to HTML and Open", comment: "Command title"), 93 String(localized: "Export to HTML and Open", comment: "Command title"),
@@ -262,6 +264,7 @@ enum CommandTitles {
262 String(localized: "Save", comment: "Command title"), 264 String(localized: "Save", comment: "Command title"),
263 String(localized: "Save All Buffers", comment: "Command title"), 265 String(localized: "Save All Buffers", comment: "Command title"),
264 String(localized: "Save Block", comment: "Command title"), 266 String(localized: "Save Block", comment: "Command title"),
267 String(localized: "Scan Document…", comment: "Command title"),
265 String(localized: "Schedule", comment: "Command title"), 268 String(localized: "Schedule", comment: "Command title"),
266 String(localized: "Scroll Down", comment: "Command title"), 269 String(localized: "Scroll Down", comment: "Command title"),
267 String(localized: "Scroll Up", comment: "Command title"), 270 String(localized: "Scroll Up", comment: "Command title"),
@@ -316,6 +319,7 @@ enum CommandTitles {
316 String(localized: "Strike-Through", comment: "Command title"), 319 String(localized: "Strike-Through", comment: "Command title"),
317 String(localized: "Switch to Buffer…", comment: "Command title"), 320 String(localized: "Switch to Buffer…", comment: "Command title"),
318 String(localized: "Sync Attachments", comment: "Command title"), 321 String(localized: "Sync Attachments", comment: "Command title"),
322 String(localized: "Take Photo…", comment: "Command title"),
319 String(localized: "Tangle Block", comment: "Command title"), 323 String(localized: "Tangle Block", comment: "Command title"),
320 String(localized: "Tangle Block's Target", comment: "Command title"), 324 String(localized: "Tangle Block's Target", comment: "Command title"),
321 String(localized: "Tangle File", comment: "Command title"), 325 String(localized: "Tangle File", comment: "Command title"),
@@ -343,6 +347,7 @@ enum CommandTitles {
343 String(localized: "Use Selection for Find", comment: "Command title"), 347 String(localized: "Use Selection for Find", comment: "Command title"),
344 String(localized: "Verbatim", comment: "Command title"), 348 String(localized: "Verbatim", comment: "Command title"),
345 String(localized: "Widen", comment: "Command title"), 349 String(localized: "Widen", comment: "Command title"),
350 String(localized: "Word Count", comment: "Command title"),
346 String(localized: "Yank", comment: "Command title"), 351 String(localized: "Yank", comment: "Command title"),
347 String(localized: "Yank Media", comment: "Command title"), 352 String(localized: "Yank Media", comment: "Command title"),
348 ] 353 ]
Sources/OrgstarMobile/AgendaScreen.swift +62 · view
@@ -51,6 +51,9 @@ struct AgendaScreen: View, Equatable {
51 @State private var bulkArchiving = false 51 @State private var bulkArchiving = false
52 @State private var bulkPlanning: BulkPlanning? 52 @State private var bulkPlanning: BulkPlanning?
53 @State private var showingBoard = false 53 @State private var showingBoard = false
54 @State private var showingCommands = false
55 /// The command chosen in Commands, run once the list is gone.
56 @State private var chosenCommand: String?
54 /// The entry open in its sheet. 57 /// The entry open in its sheet.
55 @State private var editing: AgendaItem? 58 @State private var editing: AgendaItem?
56 59
@@ -222,6 +225,18 @@ struct AgendaScreen: View, Equatable {
222 if workspace.rootPaths.count > 1 || shownFolders != nil { 225 if workspace.rootPaths.count > 1 || shownFolders != nil {
223 ToolbarItem(placement: .topBarTrailing) { foldersMenu } 226 ToolbarItem(placement: .topBarTrailing) { foldersMenu }
224 } 227 }
228 ToolbarItem(placement: .topBarTrailing) {
229 Button("Commands", systemImage: "command") { showingCommands = true }
230 }
231 }
232 .sheet(isPresented: $showingCommands, onDismiss: {
233 // After the list has gone, so the command's own sheet can show.
234 if let id = chosenCommand {
235 chosenCommand = nil
236 runCommand(id)
237 }
238 }) {
239 CommandList(rows: commandRows) { chosenCommand = $0 }
225 } 240 }
226 .fullScreenCover(isPresented: $showingBoard) { 241 .fullScreenCover(isPresented: $showingBoard) {
227 BoardScreen(workspace: workspace, session: session) { showingBoard = false } 242 BoardScreen(workspace: workspace, session: session) { showingBoard = false }
@@ -599,6 +614,53 @@ struct AgendaScreen: View, Equatable {
599 } 614 }
600 } 615 }
601 616
617 /// The agenda's commands: its views and toolbar actions, capture, and the clock's that need
618 /// no entry.
619 private var commandRows: [CommandRow] {
620 var rows = views.indices.map { CommandRow(id: "agenda.view.\($0)", title: views[$0].name) }
621 rows += [
622 CommandRow(id: "agenda.match", title: String(localized: "Tags and Properties…")),
623 CommandRow(id: "agenda.search", title: String(localized: "Search…")),
624 ]
625 if canSaveView { rows.append(CommandRow(id: "agenda.save", title: String(localized: "Save as View…"))) }
626 if case .agenda = agenda.mode {
627 rows += [
628 CommandRow(id: "agenda.today", title: String(localized: "Today")),
629 CommandRow(id: "agenda.earlier", title: String(localized: "Earlier")),
630 CommandRow(id: "agenda.later", title: String(localized: "agenda.later", defaultValue: "Later", comment: "Shows the next days in the agenda")),
631 CommandRow(id: "agenda.go-to-date", title: String(localized: "Go to Date…")),
632 CommandRow(id: "agenda.log-mode", title: String(localized: "Log Mode")),
633 ]
634 }
635 rows += [
636 CommandRow(id: "agenda.filter", title: String(localized: "Filter…")),
637 CommandRow(id: "agenda.select", title: String(localized: "Select")),
638 CommandRow(id: "agenda.board", title: CommandTitle.localized("Board")),
639 CommandRow(id: "app.capture", title: CommandTitle.localized("Capture…")),
640 ]
641 return rows + MobileClock.screenCommands.map { CommandRow(id: $0.id, title: CommandTitle.localized($0.title)) }
642 }
643
644 private func runCommand(_ id: String) {
645 switch id {
646 case let id where id.hasPrefix("agenda.view."):
647 if let index = Int(id.dropFirst("agenda.view.".count)), views.indices.contains(index) { show(views[index]) }
648 case "agenda.match": asking = .match
649 case "agenda.search": asking = .search
650 case "agenda.save": asking = .save
651 case "agenda.today": goToday()
652 case "agenda.earlier": step(forward: false)
653 case "agenda.later": step(forward: true)
654 case "agenda.go-to-date": jumping = true
655 case "agenda.log-mode": logMode.toggle()
656 case "agenda.filter": showingFilter = true
657 case "agenda.select": selecting = true
658 case "agenda.board": showingBoard = true
659 case "app.capture": model.captureRequest = CaptureRequest()
660 default: _ = MobileClock.run(id, model: model, workspace: workspace) { message = $0 }
661 }
662 }
663
602 private func jump(to day: Int) { 664 private func jump(to day: Int) {
603 show(range, around: day) 665 show(range, around: day)
604 } 666 }
Sources/OrgstarMobile/AppMenus.swift +5 −25 · view
@@ -99,32 +99,12 @@ struct AppMenus: SwiftUI.Commands {
99 } 99 }
100} 100}
101 101
102/// Org: the org commands and the app's commands for entries and notes, in the Mac's submenus, 102/// Org: the org commands and the app's commands for entries and notes, in the Org menu's
103/// with the keys that run them in the current keymap. 103/// submenus (`CommandGroups.orgMenu`), with the keys that run them in the current keymap.
104private struct OrgMenuItems: View { 104private struct OrgMenuItems: View {
105 let editor: MobileEditor? 105 let editor: MobileEditor?
106 106
107 /// The Mac's Org submenus (`Sources/Orgstar/OrgstarApp.swift`) and the command id prefixes 107 private static func group(of id: String) -> Int? { CommandGroups.group(of: id) }
108 /// they hold. A command goes in the first submenu with a prefix it starts with.
109 static let groups: [(title: LocalizedStringKey, prefixes: [String])] = [
110 ("Visibility", ["org.cycle", "org.fold.", "org.narrow.", "org.widen", "org.sparse-tree", "org.toggle-inline-images", "org.latex-preview"]),
111 ("Headings", ["org.heading.", "org.subtree.", "org.element.", "org.goto", "org.sort", "org.archive.", "app.refile", "app.archive"]),
112 ("TODO and Tags", ["org.todo.", "org.priority.", "org.tags.", "org.effort."]),
113 ("Properties and Columns", ["org.property.", "org.columns", "org.drawer."]),
114 ("Dates and Timers", ["org.schedule", "org.deadline", "org.timestamp.", "org.timer."]),
115 ("Lists", ["org.item.", "org.checkbox."]),
116 ("Tables", ["org.table", "app.table-", "app.plot"]),
117 ("Links and Footnotes", ["org.link.", "org.id.", "org.footnote."]),
118 ("Blocks", ["org.babel.", "org.structure-template", "org.edit-special", "org.dblock.", "org.clock.report", "org.denote."]),
119 ("Text", ["org.emphasize", "org.fill-"]),
120 ("Attachments", ["app.attach."]),
121 ("Notes", ["app.dailies.", "app.node."]),
122 ("Encryption", ["app.crypt."]),
123 ]
124
125 private static func group(of id: String) -> Int? {
126 groups.firstIndex { $0.prefixes.contains { id.hasPrefix($0) } }
127 }
128 108
129 /// The commands the iOS editor knows, less the ones the App Store build hides, once each. 109 /// The commands the iOS editor knows, less the ones the App Store build hides, once each.
130 private static let shown: [(id: String, title: String)] = { 110 private static let shown: [(id: String, title: String)] = {
@@ -137,8 +117,8 @@ private struct OrgMenuItems: View {
137 // Commands that fit no subject, such as Act at Point, come first. 117 // Commands that fit no subject, such as Act at Point, come first.
138 ForEach(Self.shown.filter { Self.group(of: $0.id) == nil }, id: \.id) { item($0) } 118 ForEach(Self.shown.filter { Self.group(of: $0.id) == nil }, id: \.id) { item($0) }
139 Divider() 119 Divider()
140 ForEach(Self.groups.indices, id: \.self) { index in 120 ForEach(CommandGroups.orgMenu.indices, id: \.self) { index in
141 Menu(Self.groups[index].title) { 121 Menu(CommandGroups.orgMenu[index].title) {
142 ForEach(Self.shown.filter { Self.group(of: $0.id) == index }, id: \.id) { item($0) } 122 ForEach(Self.shown.filter { Self.group(of: $0.id) == index }, id: \.id) { item($0) }
143 } 123 }
144 } 124 }
Sources/OrgstarMobile/ClockScreens.swift +5 · view
@@ -33,6 +33,11 @@ final class ClockPrompter {
33/// The clock commands both the editor and the clock accessory run. 33/// The clock commands both the editor and the clock accessory run.
34@MainActor 34@MainActor
35enum MobileClock { 35enum MobileClock {
36 /// The clock commands that need no caret, for the Commands list of a screen without one.
37 static let screenCommands: [(id: String, title: String)] = CommandPalette.viewCommands.filter {
38 $0.id.hasPrefix("app.clock.") && !["app.clock.in", "app.clock.default"].contains($0.id)
39 }
40
36 /// Runs a clock command; false for other ids. Messages go to `show`; entries to show open. 41 /// Runs a clock command; false for other ids. Messages go to `show`; entries to show open.
37 static func run(_ id: String, model: MobileModel, workspace: WorkspaceModel, show: @escaping (String) -> Void) -> Bool { 42 static func run(_ id: String, model: MobileModel, workspace: WorkspaceModel, show: @escaping (String) -> Void) -> Bool {
38 let clock = model.clock 43 let clock = model.clock
Sources/OrgstarMobile/CommandList.swift added +89 · view
@@ -0,0 +1,89 @@
1#if os(iOS)
2import GameController
3import OrgApp
4import SwiftUI
5
6/// A command in the Commands list.
7struct CommandRow: Identifiable {
8 let id: String
9 let title: String
10 /// Its keys in the current keymap, shown while a hardware keyboard is attached.
11 var keys: String? = nil
12 /// Why it doesn't apply here; nil when it runs. The row is listed greyed with this.
13 var reason: String? = nil
14}
15
16/// Commands, on every screen: with an empty query the recent ones, then every command by
17/// subject; a query matches as the Mac's palette does.
18struct CommandList: View {
19 let rows: [CommandRow]
20 /// Called with the chosen command before the list closes.
21 let choose: (String) -> Void
22 @State private var query = ""
23 @State private var keyboard = GCKeyboard.coalesced != nil
24 @Environment(\.dismiss) private var dismiss
25
26 var body: some View {
27 let ranked = CommandRanking.rank(rows, query: query, id: \.id, titles: { [$0.title] })
28 NavigationStack {
29 List {
30 if query.allSatisfy(\.isWhitespace) {
31 if !ranked.recent.isEmpty {
32 Section("Recent") { ForEach(ranked.recent) { row($0) } }
33 }
34 ForEach(sections(ranked.rest), id: \.group) { section in
35 Section {
36 ForEach(section.rows) { row($0) }
37 } header: {
38 if let group = section.group { Text(CommandGroups.commandList[group].title) }
39 }
40 }
41 } else {
42 // Those that run here first, each part in rank order.
43 ForEach(ranked.rest.filter { $0.reason == nil } + ranked.rest.filter { $0.reason != nil }) { row($0) }
44 }
45 }
46 .overlay {
47 if !query.allSatisfy(\.isWhitespace), ranked.rest.isEmpty { ContentUnavailableView.search(text: query) }
48 }
49 .searchable(text: $query, placement: .navigationBarDrawer(displayMode: .always))
50 .navigationTitle("Commands")
51 .navigationBarTitleDisplayMode(.inline)
52 .toolbar { ToolbarItem(placement: .cancellationAction) { Button("Cancel") { dismiss() } } }
53 }
54 .onReceive(NotificationCenter.default.publisher(for: .GCKeyboardDidConnect)) { _ in keyboard = true }
55 .onReceive(NotificationCenter.default.publisher(for: .GCKeyboardDidDisconnect)) { _ in keyboard = GCKeyboard.coalesced != nil }
56 }
57
58 /// The rows by `CommandGroups.commandList`, those in no group first, in the list's order.
59 private func sections(_ rows: [CommandRow]) -> [(group: Int?, rows: [CommandRow])] {
60 let grouped = Dictionary(grouping: rows) { CommandGroups.group(of: $0.id, in: CommandGroups.commandList) }
61 return ([nil] + CommandGroups.commandList.indices.map(Optional.some)).compactMap { group in
62 grouped[group].map { (group, $0) }
63 }
64 }
65
66 private func row(_ command: CommandRow) -> some View {
67 Button {
68 CommandUsage.shared.record(command.id)
69 choose(command.id)
70 dismiss()
71 } label: {
72 HStack {
73 VStack(alignment: .leading, spacing: 2) {
74 Text(command.title)
75 if let reason = command.reason {
76 Text(reason).font(.caption).foregroundStyle(.secondary)
77 }
78 }
79 Spacer()
80 if keyboard, let keys = command.keys {
81 Text(keys).font(.caption.monospaced()).foregroundStyle(.secondary)
82 }
83 }
84 }
85 .tint(.primary)
86 .disabled(command.reason != nil)
87 }
88}
89#endif
Sources/OrgstarMobile/EditorScreen.swift +209 −164 · view
@@ -36,7 +36,9 @@ struct EditorScreen: View {
36 @State private var trust = TrustStore() 36 @State private var trust = TrustStore()
37 /// The command chosen in the palette, run once the palette is gone. 37 /// The command chosen in the palette, run once the palette is gone.
38 @State private var chosen: String? 38 @State private var chosen: String?
39 @Environment(ClockModel.self) private var clock 39 /// The file's sync conflict copies and recovery versions, for their toolbar buttons.
40 @State private var syncCopies = 0
41 @State private var recoveries = 0
40 @Environment(MobileModel.self) private var model 42 @Environment(MobileModel.self) private var model
41 @Environment(\.openURL) private var openURL 43 @Environment(\.openURL) private var openURL
42 44
@@ -133,6 +135,12 @@ struct EditorScreen: View {
133 if pane?.conflict != nil { 135 if pane?.conflict != nil {
134 Button("Conflict", systemImage: "exclamationmark.triangle") { sheet = .conflict } 136 Button("Conflict", systemImage: "exclamationmark.triangle") { sheet = .conflict }
135 } 137 }
138 if syncCopies > 0 {
139 Button("Resolve Sync Conflicts…", systemImage: "doc.on.doc") { sheet = .syncCopies }
140 }
141 if recoveries > 0 {
142 Button("Recovery Versions…", systemImage: "clock.arrow.circlepath") { sheet = .recovery }
143 }
136 Button("Find", systemImage: "magnifyingglass") { 144 Button("Find", systemImage: "magnifyingglass") {
137 textView?.interactions.lazy.compactMap { $0 as? UIFindInteraction }.first?.presentFindNavigator(showingReplace: false) 145 textView?.interactions.lazy.compactMap { $0 as? UIFindInteraction }.first?.presentFindNavigator(showingReplace: false)
138 } 146 }
@@ -144,78 +152,10 @@ struct EditorScreen: View {
144 } primaryAction: { 152 } primaryAction: {
145 editor?.run("edit.undo") 153 editor?.run("edit.undo")
146 } 154 }
147 Menu("More", systemImage: "ellipsis.circle") { 155 if let tree = session.document(of: path)?.tree {
148 Button("Commands", systemImage: "command") { sheet = .palette } 156 ExportMenu(path: path, tree: tree, report: { message = $0 }, exportSubtree: exportSubtree)
149 Button("Word Count", systemImage: "textformat.123") { message = wordCount() }
150 Button("Clock In", systemImage: "stopwatch") { editor?.run("app.clock.in") }
151 Button("Column View", systemImage: "rectangle.split.3x3") { editor?.run("org.columns") }
152 Button("Column View of File", systemImage: "rectangle.split.3x3") { editor?.run("org.columns.global") }
153 Menu("Table", systemImage: "tablecells") {
154 Button("Import Table from File…", systemImage: "square.and.arrow.down") { importingTable = true }
155 Button("Export Table as CSV…", systemImage: "square.and.arrow.up") { exportTable(csv: true) }
156 Button("Export Table as TSV…", systemImage: "square.and.arrow.up") { exportTable(csv: false) }
157 Button("Plot Table", systemImage: "chart.xyaxis.line") { plotTable() }
158 }
159 Toggle(isOn: Binding(get: { model.showMarkup }, set: { model.showMarkup = $0 })) {
160 Label("Show Markup", systemImage: "eye")
161 }
162 RecentClockMenu(clock: clock) { editor?.run($0) }
163 Button("Backlinks", systemImage: "arrow.uturn.backward.circle") { if ProAccess.shared.allows(.roam) { sheet = .backlinks } }
164 Menu("Daily Notes", systemImage: "book.closed") {
165 Button("Today", systemImage: "smallcircle.filled.circle") { roam("app.dailies.today") }
166 Button("Yesterday", systemImage: "chevron.backward") { roam("app.dailies.yesterday") }
167 Button("Tomorrow", systemImage: "chevron.forward") { roam("app.dailies.tomorrow") }
168 Button("Date…", systemImage: "calendar.badge.clock") { roam("app.dailies.date") }
169 Button("Capture to Today", systemImage: "square.and.pencil") { roam("app.dailies.capture-today") }
170 Button("Previous Daily Note", systemImage: "arrow.left") { roam("app.dailies.previous") }
171 Button("Next Daily Note", systemImage: "arrow.right") { roam("app.dailies.next") }
172 }
173 Button("Find Node…", systemImage: "point.3.connected.trianglepath.dotted") { roam("app.node.find") }
174 Button("Insert Node Link…", systemImage: "link") { roam("app.node.insert") }
175 Button("Node Graph", systemImage: "circle.hexagongrid") { if ProAccess.shared.allows(.roam) { sheet = .graph } }
176 Menu("Attachments", systemImage: "paperclip") {
177 Button("Attach File…", systemImage: "doc.badge.plus") { attaching = .cp }
178 Button("Attach Photo or Video…", systemImage: "photo.badge.plus") { attachingPhotos = true }
179 if CameraPicker.isAvailable {
180 Button("Take Photo…", systemImage: "camera") { takingPhoto = true }
181 }
182 if DocumentScanner.isAvailable {
183 Button("Scan Document…", systemImage: "doc.viewfinder") { scanning = true }
184 }
185 Button("Attach File from URL…", systemImage: "link.badge.plus") { attachActions.run("app.attach.url") }
186 Button("New Attachment…", systemImage: "note.text.badge.plus") { attachActions.run("app.attach.new") }
187 Button("Open Attachment…", systemImage: "paperclip") { attachActions.run("app.attach.open") }
188 Button("Show Attachment Folder", systemImage: "folder") { attachActions.run("app.attach.reveal") }
189 Button("Delete Attachment…", systemImage: "trash") { attachActions.run("app.attach.delete") }
190 Button("Delete All Attachments…", systemImage: "trash.slash") { attachActions.run("app.attach.delete-all") }
191 Button("Sync Attachments", systemImage: "arrow.triangle.2.circlepath") { attachActions.run("app.attach.sync") }
192 Button("Set Attachment Folder…", systemImage: "folder.badge.gearshape") { attachActions.run("app.attach.set-directory") }
193 Button("Unset Attachment Folder", systemImage: "folder.badge.minus") { attachActions.run("app.attach.unset-directory") }
194 }
195 Menu("Encryption", systemImage: "lock") {
196 Button("Encrypt Entry…", systemImage: "lock") { crypt("app.crypt.encrypt-entry") }
197 Button("Decrypt Entry…", systemImage: "lock.open") { crypt("app.crypt.open-entry") }
198 Button("Decrypt Entry in File…", systemImage: "lock.open.trianglebadge.exclamationmark") { crypt("app.crypt.decrypt-entry") }
199 Button("Encrypt Tagged Entries…", systemImage: "lock.rectangle.stack") { crypt("app.crypt.encrypt-entries") }
200 Button("Forget Encryption Passphrase", systemImage: "key.slash") { crypt("app.crypt.forget-passphrase") }
201 }
202 if let tree = session.document(of: path)?.tree {
203 ExportMenu(path: path, tree: tree, report: { message = $0 }, exportSubtree: exportSubtree)
204 }
205 Button("Resolve Sync Conflicts…", systemImage: "doc.on.doc") { sheet = .syncCopies }
206 Button("Recovery Versions…", systemImage: "clock.arrow.circlepath") { sheet = .recovery }
207 if onPaneCommand != nil, sizeClass == .regular {
208 Menu("Panes", systemImage: "rectangle.split.2x1") {
209 Button("Split Pane Right", systemImage: "rectangle.split.2x1") { _ = onPaneCommand?("app.split-right") }
210 Button("Split Pane Below", systemImage: "rectangle.split.1x2") { _ = onPaneCommand?("app.split-below") }
211 if inSplit {
212 Button("Next Pane", systemImage: "arrow.right.square") { _ = onPaneCommand?("app.pane-next") }
213 Button("Close Pane", systemImage: "xmark.square") { _ = onPaneCommand?("app.pane-close") }
214 Button("Close Other Panes", systemImage: "square") { _ = onPaneCommand?("app.pane-only") }
215 }
216 }
217 }
218 } 157 }
158 Button("Commands", systemImage: "command") { sheet = .palette }
219 } 159 }
220 } 160 }
221 } 161 }
@@ -237,6 +177,7 @@ struct EditorScreen: View {
237 } 177 }
238 } 178 }
239 .sheet(item: $sheet, onDismiss: { 179 .sheet(item: $sheet, onDismiss: {
180 countVersions()
240 // After the sheet has gone, so a command's own prompt can show. 181 // After the sheet has gone, so a command's own prompt can show.
241 if let id = chosen { 182 if let id = chosen {
242 chosen = nil 183 chosen = nil
@@ -244,7 +185,8 @@ struct EditorScreen: View {
244 } 185 }
245 }) { sheet in 186 }) { sheet in
246 switch sheet { 187 switch sheet {
247 case .palette: if let editor { CommandPalette(editor: editor, panes: onPaneCommand != nil && sizeClass == .regular, split: inSplit) { chosen = $0 } } 188 case .palette: if let editor { CommandPalette(editor: editor, panes: onPaneCommand != nil && sizeClass == .regular, split: inSplit,
189 recoveries: recoveries, syncCopies: syncCopies) { chosen = $0 } }
248 case .conflict: ConflictSheet(session: session) 190 case .conflict: ConflictSheet(session: session)
249 case .syncCopies: SyncConflictSheet(session: session) { message = $0 } 191 case .syncCopies: SyncConflictSheet(session: session) { message = $0 }
250 case .recovery: RecoverySheet(session: session) { message = $0 } 192 case .recovery: RecoverySheet(session: session) { message = $0 }
@@ -343,6 +285,7 @@ struct EditorScreen: View {
343 if case .failure(let error) = result { message = error.localizedDescription } else { message = "Export done." } 285 if case .failure(let error) = result { message = error.localizedDescription } else { message = "Export done." }
344 } 286 }
345 .onChange(of: pane?.conflict) { _, conflict in 287 .onChange(of: pane?.conflict) { _, conflict in
288 countVersions()
346 if conflict != nil, isFocused { sheet = .conflict } 289 if conflict != nil, isFocused { sheet = .conflict }
347 } 290 }
348 .onChange(of: session.lastError) { _, error in 291 .onChange(of: session.lastError) { _, error in
@@ -355,6 +298,7 @@ struct EditorScreen: View {
355 .onAppear(perform: start) 298 .onAppear(perform: start)
356 // A pane command moved focus here. 299 // A pane command moved focus here.
357 .onChange(of: isFocused) { 300 .onChange(of: isFocused) {
301 countVersions()
358 guard isFocused, let textView, !textView.isFirstResponder else { return } 302 guard isFocused, let textView, !textView.isFirstResponder else { return }
359 editor?.focus(textView) 303 editor?.focus(textView)
360 textView.becomeFirstResponder() 304 textView.becomeFirstResponder()
@@ -445,13 +389,21 @@ struct EditorScreen: View {
445 textView = view 389 textView = view
446 if let offset { editor.reveal(offset) } 390 if let offset { editor.reveal(offset) }
447 if let template = SnippetLibrary.shared.takeTemplate(for: path) { DispatchQueue.main.async { _ = editor.perform(ExpandNamedSnippet(snippet: template)) } } 391 if let template = SnippetLibrary.shared.takeTemplate(for: path) { DispatchQueue.main.async { _ = editor.perform(ExpandNamedSnippet(snippet: template)) } }
392 countVersions()
448 if pane.conflict != nil { 393 if pane.conflict != nil {
449 sheet = .conflict 394 sheet = .conflict
450 } else if case let copies = session.syncConflictCopies().count, copies > 0 { 395 } else if syncCopies > 0 {
451 message = String(localized: "\(copies) sync conflict copies of this file; More › Resolve Sync Conflicts… compares them.") 396 message = String(localized: "\(syncCopies) sync conflict copies of this file; Resolve Sync Conflicts… in the toolbar compares them.")
452 } 397 }
453 } 398 }
454 399
400 /// Counts the focused file's sync conflict copies and recovery versions.
401 private func countVersions() {
402 guard isFocused else { return }
403 syncCopies = session.syncConflictCopies().count
404 recoveries = session.recoveryVersions().count
405 }
406
455 private func makeEditor() -> MobileEditor? { 407 private func makeEditor() -> MobileEditor? {
456 guard let document = session.document(of: path) else { return nil } 408 guard let document = session.document(of: path) else { return nil }
457 let editor = MobileEditor( 409 let editor = MobileEditor(
@@ -508,8 +460,20 @@ struct EditorScreen: View {
508 sheet = .refile(id) 460 sheet = .refile(id)
509 } else if id == "app.table-import" { 461 } else if id == "app.table-import" {
510 importingTable = true 462 importingTable = true
511 } else if id == "app.table-export" { 463 } else if id == "app.table-export" || id == "app.table-export.tsv" {
512 exportTable(csv: true) 464 exportTable(csv: id == "app.table-export")
465 } else if id == "app.word-count" {
466 message = wordCount()
467 } else if id == "app.recovery" {
468 sheet = .recovery
469 } else if id == "app.sync-conflicts" {
470 sheet = .syncCopies
471 } else if id == "app.attach.photo" {
472 attachingPhotos = true
473 } else if id == "app.attach.camera" {
474 takingPhoto = true
475 } else if id == "app.attach.scan" {
476 scanning = true
513 } else if id == "app.plot" { 477 } else if id == "app.plot" {
514 plotTable() 478 plotTable()
515 } else if id.hasPrefix("app.crypt.") { 479 } else if id.hasPrefix("app.crypt.") {
@@ -729,11 +693,6 @@ extension EditorScreen {
729 } 693 }
730 } 694 }
731 695
732 /// Org-roam's commands, with Pro.
733 private func roam(_ id: String) {
734 if ProAccess.shared.allows(.roam) { roamActions.run(id) }
735 }
736
737 /// org-crypt's commands at the caret, through the passphrase sheet. 696 /// org-crypt's commands at the caret, through the passphrase sheet.
738 private func crypt(_ id: String) { 697 private func crypt(_ id: String) {
739 if let feature = ProFeature.required(byCommand: id), !ProAccess.shared.allows(feature) { return } 698 if let feature = ProFeature.required(byCommand: id), !ProAccess.shared.allows(feature) { return }
@@ -847,78 +806,155 @@ struct EditorTextView: UIViewRepresentable {
847} 806}
848 807
849/// Org's keys for a touch keyboard: each button does what its key does at the caret, as the 808/// Org's keys for a touch keyboard: each button does what its key does at the caret, as the
850/// Emacs keymap binds it (M-→ demotes a heading, indents an item, moves a table column). 809/// Emacs keymap binds it (M-→ demotes a heading, indents an item, moves a table column). It holds
810/// what is repeated at the caret while typing; the rest is in Commands. Its buttons share the
811/// width, without scrolling.
851struct KeyBar: View { 812struct KeyBar: View {
852 let editor: MobileEditor 813 let editor: MobileEditor
853 let palette: () -> Void 814 let palette: () -> Void
815 @Environment(\.horizontalSizeClass) private var sizeClass
854 816
855 private static let keys: [(label: String, symbol: String?, keys: String)] = [ 817 /// A button the bar can hold.
856 (String(localized: "Fold", comment: "Key bar button"), "arrow.right.to.line", "TAB"), 818 struct Item {
857 (String(localized: "Overview", comment: "Key bar button"), "arrow.left.to.line", "S-TAB"), 819 enum Action {
858 (String(localized: "Promote", comment: "Key bar button"), "decrease.indent", "M-<left>"), 820 /// What the keys are bound to at the caret.
859 (String(localized: "Demote", comment: "Key bar button"), "increase.indent", "M-<right>"), 821 case keys(String)
860 (String(localized: "Move Up", comment: "Key bar button"), "arrow.up.square", "M-<up>"), 822 case command(String)
861 (String(localized: "Move Down", comment: "Key bar button"), "arrow.down.square", "M-<down>"), 823 case palette
862 (String(localized: "New Heading or Item", comment: "Key bar button"), "plus", "M-RET"), 824 /// Schedule, Deadline and Tags in a menu.
863 ("TODO", nil, "C-c C-t"), 825 case plan
864 (String(localized: "Act at Point", comment: "Key bar button"), "checkmark.square", "C-c C-c"), 826 case hideKeyboard
865 (String(localized: "Schedule", comment: "Key bar button"), "calendar", "C-c C-s"), 827 }
866 (String(localized: "Deadline", comment: "Key bar button"), "calendar.badge.exclamationmark", "C-c C-d"),
867 (String(localized: "Tags", comment: "Key bar button"), "tag", "C-c C-q"),
868 (String(localized: "Open Link", comment: "Key bar button"), "link", "C-c C-o"),
869 ]
870 828
871 /// Emphasis for the selection, or a pair of markers with the caret between. 829 let label: String
872 private static let emphasis: [(label: String, symbol: String, command: String)] = [ 830 /// Nil shows the label as text.
873 (String(localized: "Bold", comment: "Key bar button"), "bold", "org.emphasize.bold"), 831 let symbol: String?
874 (String(localized: "Italic", comment: "Key bar button"), "italic", "org.emphasize.italic"), 832 let action: Action
875 (String(localized: "Code", comment: "Key bar button"), "chevron.left.forwardslash.chevron.right", "org.emphasize.code"), 833 }
834
835 /// Every button the bar can hold, by id.
836 static let items: [String: Item] = [
837 "commands": Item(label: String(localized: "Commands"), symbol: "command", action: .palette),
838 "fold": Item(label: String(localized: "Fold", comment: "Key bar button"), symbol: "arrow.right.to.line", action: .keys("TAB")),
839 "overview": Item(label: String(localized: "Overview", comment: "Key bar button"), symbol: "arrow.left.to.line", action: .keys("S-TAB")),
840 "promote": Item(label: String(localized: "Promote", comment: "Key bar button"), symbol: "decrease.indent", action: .keys("M-<left>")),
841 "demote": Item(label: String(localized: "Demote", comment: "Key bar button"), symbol: "increase.indent", action: .keys("M-<right>")),
842 "move-up": Item(label: String(localized: "Move Up", comment: "Key bar button"), symbol: "arrow.up.square", action: .keys("M-<up>")),
843 "move-down": Item(label: String(localized: "Move Down", comment: "Key bar button"), symbol: "arrow.down.square", action: .keys("M-<down>")),
844 "new-heading": Item(label: String(localized: "New Heading or Item", comment: "Key bar button"), symbol: "plus", action: .keys("M-RET")),
845 "todo": Item(label: "TODO", symbol: nil, action: .keys("C-c C-t")),
846 "act": Item(label: String(localized: "Act at Point", comment: "Key bar button"), symbol: "checkmark.square", action: .keys("C-c C-c")),
847 "plan": Item(label: String(localized: "Plan", comment: "Key bar button: a menu of Schedule, Deadline and Tags"), symbol: "calendar.badge.clock", action: .plan),
848 "schedule": Item(label: String(localized: "Schedule", comment: "Key bar button"), symbol: "calendar", action: .keys("C-c C-s")),
849 "deadline": Item(label: String(localized: "Deadline", comment: "Key bar button"), symbol: "calendar.badge.exclamationmark", action: .keys("C-c C-d")),
850 "tags": Item(label: String(localized: "Tags", comment: "Key bar button"), symbol: "tag", action: .keys("C-c C-q")),
851 "open-link": Item(label: String(localized: "Open Link", comment: "Key bar button"), symbol: "link", action: .keys("C-c C-o")),
852 "bold": Item(label: String(localized: "Bold", comment: "Key bar button"), symbol: "bold", action: .command("org.emphasize.bold")),
853 "italic": Item(label: String(localized: "Italic", comment: "Key bar button"), symbol: "italic", action: .command("org.emphasize.italic")),
854 "code": Item(label: String(localized: "Code", comment: "Key bar button"), symbol: "chevron.left.forwardslash.chevron.right", action: .command("org.emphasize.code")),
855 "hide-keyboard": Item(label: String(localized: "Hide Keyboard"), symbol: "keyboard.chevron.compact.down", action: .hideKeyboard),
876 ] 856 ]
877 857
878 /// The bar's buttons are at least 44 points square, scaled with the text size up to here. 858 /// The bar's buttons in order. On iPad, where it is wider, Plan's three are buttons.
859 static func layout(regular: Bool) -> [String] {
860 ["commands", "fold", "promote", "demote", "move-up", "move-down", "new-heading", "todo", "act"]
861 + (regular ? ["schedule", "deadline", "tags"] : ["plan"]) + ["hide-keyboard"]
862 }
863
864 /// The bar's buttons are at least 44 points tall, scaled with the text size up to here.
879 static let largestSize = DynamicTypeSize.accessibility2 865 static let largestSize = DynamicTypeSize.accessibility2
880 static let target: CGFloat = 44 866 static let target: CGFloat = 44
881 static let padding: CGFloat = 4 867 static let padding: CGFloat = 4
868 /// The widest a button gets where the bar has room.
869 static let widest: CGFloat = 64
882 @ScaledMetric(relativeTo: .body) private var size = KeyBar.target 870 @ScaledMetric(relativeTo: .body) private var size = KeyBar.target
883 871
884 var body: some View { 872 var body: some View {
885 ScrollView(.horizontal, showsIndicators: false) { 873 HStack(spacing: 0) {
886 HStack(spacing: 4) { 874 ForEach(Self.layout(regular: sizeClass == .regular), id: \.self) { id in
887 Button("Commands", systemImage: "command", action: palette) 875 if let item = Self.items[id] { button(item) }
888 ForEach(Self.keys, id: \.keys) { key in 876 }
889 Button { 877 }
890 editor.run(keys: key.keys) 878 .labelStyle(.iconOnly)
891 } label: { 879 .padding(.horizontal, 6)
892 if let symbol = key.symbol { Label(key.label, systemImage: symbol) } else { Text(key.label).font(.callout.weight(.semibold)) } 880 .padding(.vertical, Self.padding)
881 .frame(maxWidth: .infinity)
882 .background(.bar)
883 }
884
885 @ViewBuilder
886 private func button(_ item: Item) -> some View {
887 switch item.action {
888 case .plan:
889 Menu {
890 ForEach(["schedule", "deadline", "tags"], id: \.self) { id in
891 if let entry = Self.items[id], case .keys(let keys) = entry.action {
892 Button(entry.label, systemImage: entry.symbol ?? "") { editor.run(keys: keys) }
893 } 893 }
894 .accessibilityLabel(key.label)
895 } 894 }
896 ForEach(Self.emphasis, id: \.command) { item in 895 } label: {
897 Button(item.label, systemImage: item.symbol) { editor.run(item.command) } 896 label(item).modifier(KeyShape(size: size))
897 }
898 .accessibilityLabel(item.label)
899 default:
900 Button {
901 switch item.action {
902 case .keys(let keys): editor.run(keys: keys)
903 case .command(let id): editor.run(id)
904 case .palette: palette()
905 case .hideKeyboard: editor.textView.resignFirstResponder()
906 case .plan: break
898 } 907 }
899 Button("Hide Keyboard", systemImage: "keyboard.chevron.compact.down") { editor.textView.resignFirstResponder() } 908 } label: {
909 label(item)
900 } 910 }
901 .labelStyle(.iconOnly)
902 .buttonStyle(KeyStyle(size: size)) 911 .buttonStyle(KeyStyle(size: size))
903 .padding(.horizontal, 8) 912 .accessibilityLabel(item.label)
904 .padding(.vertical, Self.padding)
905 } 913 }
906 .background(.bar) 914 }
915
916 /// The buttons grow taller with the text size, but their symbols stop growing here, so
917 /// that they fit the button's share of the width.
918 static let largestSymbolSize = DynamicTypeSize.xxxLarge
919
920 @ViewBuilder
921 private func label(_ item: Item) -> some View {
922 Group {
923 if let symbol = item.symbol {
924 Label(item.label, systemImage: symbol)
925 } else {
926 // A word is wider than a symbol, so it stays at the default size.
927 Text(item.label).font(.callout.weight(.semibold)).lineLimit(1).minimumScaleFactor(0.5)
928 .dynamicTypeSize(...DynamicTypeSize.large)
929 }
930 }
931 .dynamicTypeSize(...Self.largestSymbolSize)
932 }
933}
934
935/// A key bar button's look: a tinted label on a rounded tile, `size` tall, sharing the bar's
936/// width with the others. The whole share is the touch target.
937private struct KeyShape: ViewModifier {
938 let size: CGFloat
939 var pressed = false
940
941 func body(content: Content) -> some View {
942 content
943 .foregroundStyle(.tint)
944 .frame(maxWidth: KeyBar.widest, minHeight: size)
945 .background(.fill.tertiary, in: .rect(cornerRadius: 10))
946 .opacity(pressed ? 0.5 : 1)
947 .padding(.horizontal, 2)
948 .frame(maxWidth: .infinity)
949 .contentShape(.rect)
907 } 950 }
908} 951}
909 952
910/// A key bar button: a tinted symbol on a capsule, at least `size` square.
911private struct KeyStyle: ButtonStyle { 953private struct KeyStyle: ButtonStyle {
912 let size: CGFloat 954 let size: CGFloat
913 955
914 func makeBody(configuration: Configuration) -> some View { 956 func makeBody(configuration: Configuration) -> some View {
915 configuration.label 957 configuration.label.modifier(KeyShape(size: size, pressed: configuration.isPressed))
916 .foregroundStyle(.tint)
917 .padding(.horizontal, 10)
918 .frame(minWidth: size, minHeight: size)
919 .background(.fill.tertiary, in: .capsule)
920 .opacity(configuration.isPressed ? 0.5 : 1)
921 .contentShape(.capsule)
922 } 958 }
923} 959}
924 960
@@ -1112,16 +1148,17 @@ struct CodeTextView: UIViewRepresentable {
1112 } 1148 }
1113} 1149}
1114 1150
1115/// Every command that applies at the caret, by name. 1151/// The editor's commands, those that don't apply at the caret greyed with the reason.
1116struct CommandPalette: View { 1152struct CommandPalette: View {
1117 let editor: MobileEditor 1153 let editor: MobileEditor
1118 /// The pane commands are offered (on iPad), and those for more than one pane. 1154 /// The pane commands are offered (on iPad), and those for more than one pane.
1119 var panes = false 1155 var panes = false
1120 var split = false 1156 var split = false
1157 /// Recovery versions and sync conflict copies of the file, which their commands show.
1158 var recoveries = 0
1159 var syncCopies = 0
1121 /// Called with the chosen command before the palette closes. 1160 /// Called with the chosen command before the palette closes.
1122 let choose: (String) -> Void 1161 let choose: (String) -> Void
1123 @State private var query = ""
1124 @Environment(\.dismiss) private var dismiss
1125 1162
1126 static let viewCommands: [(id: String, title: String)] = [ 1163 static let viewCommands: [(id: String, title: String)] = [
1127 ("org.cycle", "Cycle Visibility"), ("org.cycle-global", "Cycle Global Visibility"), 1164 ("org.cycle", "Cycle Visibility"), ("org.cycle-global", "Cycle Global Visibility"),
@@ -1136,12 +1173,14 @@ struct CommandPalette: View {
1136 ("app.export.icalendar-agenda", "Export Agenda Files to iCalendar"), ("app.export.icalendar-combined", "Combine Agenda Files into iCalendar"), 1173 ("app.export.icalendar-agenda", "Export Agenda Files to iCalendar"), ("app.export.icalendar-combined", "Combine Agenda Files into iCalendar"),
1137 ("app.publish", "Publish Project…"), ("app.publish.all", "Publish All Projects"), ("app.publish.current-file", "Publish Current File"), 1174 ("app.publish", "Publish Project…"), ("app.publish.all", "Publish All Projects"), ("app.publish.current-file", "Publish Current File"),
1138 ("app.publish.current-project", "Publish Current Project"), 1175 ("app.publish.current-project", "Publish Current Project"),
1139 ("app.toggle-markup", "Show or Hide Markup"), 1176 ("app.toggle-markup", "Show or Hide Markup"), ("app.word-count", "Word Count"),
1177 ("app.recovery", "Recovery Versions…"), ("app.sync-conflicts", "Resolve Sync Conflicts…"),
1140 ("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"), 1178 ("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"),
1141 ("edit.isearch-forward", "Incremental Search"), ("edit.isearch-backward", "Incremental Search Backward"), 1179 ("edit.isearch-forward", "Incremental Search"), ("edit.isearch-backward", "Incremental Search Backward"),
1142 ("org.table.toggle-column-width", "Shrink or Expand Table Column"), ("org.table.shrink", "Shrink Table Columns with Widths"), 1180 ("org.table.toggle-column-width", "Shrink or Expand Table Column"), ("org.table.shrink", "Shrink Table Columns with Widths"),
1143 ("org.table.expand", "Expand Table Columns"), 1181 ("org.table.expand", "Expand Table Columns"),
1144 ("app.table-import", "Import Table from File…"), ("app.table-export", "Export Table to File…"), ("app.plot", "Plot Table"), 1182 ("app.table-import", "Import Table from File…"), ("app.table-export", "Export Table to File…"),
1183 ("app.table-export.tsv", "Export Table as TSV…"), ("app.plot", "Plot Table"),
1145 ("app.crypt.encrypt-entry", "Encrypt Entry…"), ("app.crypt.open-entry", "Decrypt Entry…"), ("app.crypt.decrypt-entry", "Decrypt Entry in File…"), 1184 ("app.crypt.encrypt-entry", "Encrypt Entry…"), ("app.crypt.open-entry", "Decrypt Entry…"), ("app.crypt.decrypt-entry", "Decrypt Entry in File…"),
1146 ("app.crypt.encrypt-entries", "Encrypt Tagged Entries…"), ("app.crypt.forget-passphrase", "Forget Encryption Passphrase"), 1185 ("app.crypt.encrypt-entries", "Encrypt Tagged Entries…"), ("app.crypt.forget-passphrase", "Forget Encryption Passphrase"),
1147 ("app.backlinks", "Show Backlinks"), ("app.node.find", "Find Node…"), ("app.node.insert", "Insert Node Link…"), ("app.node.graph", "Show Node Graph"), 1186 ("app.backlinks", "Show Backlinks"), ("app.node.find", "Find Node…"), ("app.node.insert", "Insert Node Link…"), ("app.node.graph", "Show Node Graph"),
@@ -1169,46 +1208,52 @@ struct CommandPalette: View {
1169 ("app.dailies.capture-today", "Capture to Today's Daily Note"), ("app.dailies.capture-yesterday", "Capture to Yesterday's Daily Note"), 1208 ("app.dailies.capture-today", "Capture to Today's Daily Note"), ("app.dailies.capture-yesterday", "Capture to Yesterday's Daily Note"),
1170 ("app.dailies.capture-tomorrow", "Capture to Tomorrow's Daily Note"), ("app.dailies.capture-date", "Capture to Daily Note for Date…"), 1209 ("app.dailies.capture-tomorrow", "Capture to Tomorrow's Daily Note"), ("app.dailies.capture-date", "Capture to Daily Note for Date…"),
1171 ("app.dailies.next", "Next Daily Note"), ("app.dailies.previous", "Previous Daily Note"), 1210 ("app.dailies.next", "Next Daily Note"), ("app.dailies.previous", "Previous Daily Note"),
1172 ("app.attach.attach", "Attach File…"), ("app.attach.url", "Attach File from URL…"), ("app.attach.new", "New Attachment…"), 1211 ("app.attach.attach", "Attach File…"), ("app.attach.photo", "Attach Photo or Video…"), ("app.attach.camera", "Take Photo…"),
1212 ("app.attach.scan", "Scan Document…"), ("app.attach.url", "Attach File from URL…"), ("app.attach.new", "New Attachment…"),
1173 ("app.attach.open", "Open Attachment…"), ("app.attach.reveal", "Show Attachment Folder"), ("app.attach.delete", "Delete Attachment…"), 1213 ("app.attach.open", "Open Attachment…"), ("app.attach.reveal", "Show Attachment Folder"), ("app.attach.delete", "Delete Attachment…"),
1174 ("app.attach.delete-all", "Delete All Attachments…"), ("app.attach.sync", "Sync Attachments"), 1214 ("app.attach.delete-all", "Delete All Attachments…"), ("app.attach.sync", "Sync Attachments"),
1175 ("app.attach.set-directory", "Set Attachment Folder…"), ("app.attach.unset-directory", "Unset Attachment Folder"), 1215 ("app.attach.set-directory", "Set Attachment Folder…"), ("app.attach.unset-directory", "Unset Attachment Folder"),
1176 ] 1216 ]
1177 1217
1178 /// The commands that apply at the caret and their keys, worked out once when the palette 1218 /// The commands and their keys, and why those that don't apply at the caret don't, worked
1179 /// opens rather than on every keystroke in the search field. 1219 /// out once when the palette opens rather than on every keystroke in the search field.
1180 @State private var applicable: [(id: String, title: String, keys: String?)]? 1220 @State private var rows: [CommandRow]?
1181 1221
1182 var body: some View { 1222 var body: some View {
1183 let shown = (applicable ?? []).filter { query.isEmpty || $0.title.localizedCaseInsensitiveContains(query) } 1223 CommandList(rows: rows ?? [], choose: choose)
1184 NavigationStack { 1224 .onAppear {
1185 List(shown, id: \.id) { command in 1225 guard rows == nil else { return }
1186 Button { 1226 rows = commandRows()
1187 choose(command.id)
1188 dismiss()
1189 } label: {
1190 HStack {
1191 Text(command.title).foregroundStyle(.primary)
1192 Spacer()
1193 if let keys = command.keys {
1194 Text(keys).font(.caption.monospaced()).foregroundStyle(.secondary)
1195 }
1196 }
1197 }
1198 } 1227 }
1199 .searchable(text: $query, placement: .navigationBarDrawer(displayMode: .always)) 1228 }
1200 .navigationTitle("Commands") 1229
1201 .navigationBarTitleDisplayMode(.inline) 1230 private func commandRows() -> [CommandRow] {
1202 .toolbar { ToolbarItem(placement: .cancellationAction) { Button("Cancel") { dismiss() } } } 1231 let context = editor.editContext()
1232 let paneCommands: [(id: String, title: String)] = !panes ? [] : [("app.split-right", "Split Pane Right"), ("app.split-below", "Split Pane Below")]
1233 + (split ? [("app.pane-next", "Next Pane"), ("app.pane-close", "Close Pane"), ("app.pane-only", "Close Other Panes")] : [])
1234 var seen = Set<String>()
1235 return (paneCommands + Self.viewCommands + Commands.everything.map { ($0.id, $0.title) })
1236 .filter { !AppStoreCommands.hidden.contains($0.id) && Self.offered($0.id) && seen.insert($0.id).inserted }
1237 .map { command in
1238 CommandRow(id: command.id, title: CommandTitle.localized(command.title), keys: editor.keymap.keyLabels(for: command.id).first,
1239 reason: reason(command.id, context))
1240 }
1241 }
1242
1243 /// Commands for a camera or scanner this device lacks aren't listed.
1244 private static func offered(_ id: String) -> Bool {
1245 switch id {
1246 case "app.attach.camera": CameraPicker.isAvailable
1247 case "app.attach.scan": DocumentScanner.isAvailable
1248 default: true
1203 } 1249 }
1204 .onAppear { 1250 }
1205 guard applicable == nil else { return } 1251
1206 let context = editor.editContext() 1252 private func reason(_ id: String, _ context: EditContext) -> String? {
1207 let paneCommands: [(id: String, title: String)] = !panes ? [] : [("app.split-right", "Split Pane Right"), ("app.split-below", "Split Pane Below")] 1253 switch id {
1208 + (split ? [("app.pane-next", "Next Pane"), ("app.pane-close", "Close Pane"), ("app.pane-only", "Close Other Panes")] : []) 1254 case "app.recovery": return recoveries > 0 ? nil : String(localized: "No Recovery Versions")
1209 applicable = paneCommands.map { ($0.id, CommandTitle.localized($0.title), editor.keymap.keyLabels(for: $0.id).first) } + (Self.viewCommands + Commands.everything.map { ($0.id, $0.title) }) 1255 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")
1210 .filter { editor.applies($0.id, in: context) } 1256 default: return editor.applies(id, in: context) ? nil : CommandReason.reason(for: id, in: context)
1211 .map { ($0.id, CommandTitle.localized($0.title), editor.keymap.keyLabels(for: $0.id).first) }
1212 } 1257 }
1213 } 1258 }
1214} 1259}
Sources/OrgstarMobile/MobileEditor.swift +17 −2 · view
@@ -477,7 +477,8 @@ final class MobileEditor: NSObject, DocumentBuffer {
477 case _ where id.hasPrefix("app.dailies."): return onAppCommand != nil 477 case _ where id.hasPrefix("app.dailies."): return onAppCommand != nil
478 case "app.crypt.encrypt-entry": return onAppCommand != nil && OrgCrypt.heading(context.text, at: context.caret) != nil && OrgCrypt.encryptedRange(context.text, at: context.caret) == nil 478 case "app.crypt.encrypt-entry": return onAppCommand != nil && OrgCrypt.heading(context.text, at: context.caret) != nil && OrgCrypt.encryptedRange(context.text, at: context.caret) == nil
479 case "app.crypt.open-entry", "app.crypt.decrypt-entry": return onAppCommand != nil && OrgCrypt.encryptedRange(context.text, at: context.caret) != nil 479 case "app.crypt.open-entry", "app.crypt.decrypt-entry": return onAppCommand != nil && OrgCrypt.encryptedRange(context.text, at: context.caret) != nil
480 case "app.table-export", "app.plot": return onAppCommand != nil && ImportTable.exportText(context.text, at: context.caret, path: "") != nil 480 case "app.table-export", "app.table-export.tsv", "app.plot": return onAppCommand != nil && ImportTable.exportText(context.text, at: context.caret, path: "") != nil
481 case "app.word-count", "app.recovery", "app.sync-conflicts", "app.attach.photo", "app.attach.camera", "app.attach.scan": return onAppCommand != nil
481 case "app.refile", "app.refile.copy", "app.archive": return onAppCommand != nil && Presentation.heading(containing: context.caret, in: context.tree) != nil 482 case "app.refile", "app.refile.copy", "app.archive": return onAppCommand != nil && Presentation.heading(containing: context.caret, in: context.tree) != nil
482 case "app.copy-rich-text", "app.export.html-open", "app.export-body-only", "app.export.icalendar-agenda", "app.export.icalendar-combined": return onAppCommand != nil 483 case "app.copy-rich-text", "app.export.html-open", "app.export-body-only", "app.export.icalendar-agenda", "app.export.icalendar-combined": return onAppCommand != nil
483 case _ where id.hasPrefix("app.publish"): return onAppCommand != nil 484 case _ where id.hasPrefix("app.publish"): return onAppCommand != nil
@@ -682,7 +683,21 @@ extension MobileEditor: UITextViewDelegate {
682 /// Another view's caret moves with edits made in this one; only the focused view's 683 /// Another view's caret moves with edits made in this one; only the focused view's
683 /// selection drives the display. 684 /// selection drives the display.
684 func textView(_ textView: UITextView, editMenuForTextIn range: NSRange, suggestedActions: [UIMenuElement]) -> UIMenu? { 685 func textView(_ textView: UITextView, editMenuForTextIn range: NSRange, suggestedActions: [UIMenuElement]) -> UIMenu? {
685 options.spellCheck ? spellingMenu(for: range, in: textView, suggested: suggestedActions) : nil 686 let suggested = range.length > 0 && textView.isEditable ? suggestedActions + [formatMenu] : suggestedActions
687 if options.spellCheck, let menu = spellingMenu(for: range, in: textView, suggested: suggested) { return menu }
688 return suggested.count == suggestedActions.count ? nil : UIMenu(children: suggested)
689 }
690
691 /// Org's emphasis for the selection, in its edit menu.
692 private var formatMenu: UIMenu {
693 let styles: [(title: String, symbol: String, command: String)] = [
694 (String(localized: "Bold"), "bold", "org.emphasize.bold"),
695 (String(localized: "Italic"), "italic", "org.emphasize.italic"),
696 (String(localized: "Code"), "chevron.left.forwardslash.chevron.right", "org.emphasize.code"),
697 ]
698 return UIMenu(title: String(localized: "Format"), image: UIImage(systemName: "bold.italic.underline"), children: styles.map { style in
699 UIAction(title: style.title, image: UIImage(systemName: style.symbol)) { [weak self] _ in self?.run(style.command) }
700 })
686 } 701 }
687 702
688 func textViewDidChangeSelection(_ textView: UITextView) { 703 func textViewDidChangeSelection(_ textView: UITextView) {
Sources/OrgstarMobile/ReaderScreen.swift +37 · view
@@ -40,6 +40,9 @@ struct ReaderScreen: View {
40 /// The view's width, which images in a line's text are no wider than. 40 /// The view's width, which images in a line's text are no wider than.
41 @State private var width: CGFloat = 0 41 @State private var width: CGFloat = 0
42 @State private var showingOutline = false 42 @State private var showingOutline = false
43 @State private var showingCommands = false
44 /// The command chosen in Commands, run once the list is gone.
45 @State private var chosenCommand: String?
43 @State private var message: String? 46 @State private var message: String?
44 /// A file a link opened, shown in Quick Look. 47 /// A file a link opened, shown in Quick Look.
45 @State private var previewed: URL? 48 @State private var previewed: URL?
@@ -131,8 +134,18 @@ struct ReaderScreen: View {
131 if let tree = document?.tree { ExportMenu(path: path, tree: tree) { message = $0 } } 134 if let tree = document?.tree { ExportMenu(path: path, tree: tree) { message = $0 } }
132 NavigationLink(value: EditorRoute(path: path, offset: nil)) { Label("Edit", systemImage: "pencil") } 135 NavigationLink(value: EditorRoute(path: path, offset: nil)) { Label("Edit", systemImage: "pencil") }
133 } 136 }
137 Button("Commands", systemImage: "command") { showingCommands = true }
134 } 138 }
135 } 139 }
140 .sheet(isPresented: $showingCommands, onDismiss: {
141 // After the list has gone, so the command's own sheet can show.
142 if let id = chosenCommand {
143 chosenCommand = nil
144 runCommand(id)
145 }
146 }) {
147 CommandList(rows: commandRows) { chosenCommand = $0 }
148 }
136 .quickLookPreview($previewed) 149 .quickLookPreview($previewed)
137 .sheet(isPresented: $showingOutline) { outlineSheet } 150 .sheet(isPresented: $showingOutline) { outlineSheet }
138 .message($message) 151 .message($message)
@@ -145,6 +158,30 @@ struct ReaderScreen: View {
145 .onReceive(NotificationCenter.default.publisher(for: OrgExport.refused)) { message = $0.object as? String } 158 .onReceive(NotificationCenter.default.publisher(for: OrgExport.refused)) { message = $0.object as? String }
146 } 159 }
147 160
161 // MARK: - Commands
162
163 /// The reader's commands: its own, capture, and the clock's that need no caret.
164 private var commandRows: [CommandRow] {
165 [
166 CommandRow(id: "reader.find", title: String(localized: "Find"), reason: document == nil ? String(localized: "Nothing to do here") : nil),
167 CommandRow(id: "reader.outline", title: String(localized: "Outline"), reason: outline.isEmpty ? String(localized: "Nothing to do here") : nil),
168 CommandRow(id: "app.toggle-markup", title: CommandTitle.localized("Show or Hide Markup")),
169 CommandRow(id: "app.capture", title: CommandTitle.localized("Capture…")),
170 ] + MobileClock.screenCommands.map { CommandRow(id: $0.id, title: CommandTitle.localized($0.title)) }
171 }
172
173 private func runCommand(_ id: String) {
174 switch id {
175 case "reader.find":
176 find.text = (document?.tree.text ?? "") as NSString
177 findRequest += 1
178 case "reader.outline": showingOutline = true
179 case "app.toggle-markup": model.showMarkup.toggle()
180 case "app.capture": model.captureRequest = CaptureRequest()
181 default: _ = MobileClock.run(id, model: model, workspace: workspace) { message = $0 }
182 }
183 }
184
148 // MARK: - Content 185 // MARK: - Content
149 186
150 private func indent(_ entry: OutlineEntry) -> CGFloat { CGFloat(entry.level - 1) * 14 } 187 private func indent(_ entry: OutlineEntry) -> CGFloat { CGFloat(entry.level - 1) * 14 }
docs/manual/guide/02-the-editor.org +1 −1 · view
@@ -36,7 +36,7 @@ Colours come from the theme and follow the system's light or dark appearance. Th
36 36
37Emphasize… (=C-c C-x C-f= in the Emacs and Doom presets, =org-emphasize=) asks for a marker: =*= bold, =/= italic, =_= underline, === verbatim, =~= code, =+= strike-through, or =SPC= to remove emphasis. With a selection it wraps the selection in the marker, replacing one the selection already has. Without one it inserts a pair of markers with the caret between them. A space goes before or after the markers where the text next to them couldn't border emphasis, as Org adds it. 37Emphasize… (=C-c C-x C-f= in the Emacs and Doom presets, =org-emphasize=) asks for a marker: =*= bold, =/= italic, =_= underline, === verbatim, =~= code, =+= strike-through, or =SPC= to remove emphasis. With a selection it wraps the selection in the marker, replacing one the selection already has. Without one it inserts a pair of markers with the caret between them. A space goes before or after the markers where the text next to them couldn't border emphasis, as Org adds it.
38 38
39The Mac preset binds =⌘B=, =⌘I= and =⌘U= to bold, italic and underline. Each marker is also a command of its own in the palette (Bold, Italic, Underline, Verbatim, Code, Strike-Through), for binding in =keymap.toml=; see [[file:03-keys.org][Keys and commands]]. On iOS the key bar has Bold, Italic and Code. 39The Mac preset binds =⌘B=, =⌘I= and =⌘U= to bold, italic and underline. Each marker is also a command of its own in the palette (Bold, Italic, Underline, Verbatim, Code, Strike-Through), for binding in =keymap.toml=; see [[file:03-keys.org][Keys and commands]]. On iOS, Bold, Italic and Code are in the edit menu of a selection, under Format, and in Commands.
40 40
41** Indentation and stars 41** Indentation and stars
42 42
docs/manual/guide/04-outlines.org +3 −3 · view
@@ -696,7 +696,7 @@ The allowed values are the property's =_ALL= values from the entry, an ancestor
696earlier; Org 9.8.7 signals an error there instead. After each change the sheet captures 696earlier; Org 9.8.7 signals an error there instead. After each change the sheet captures
697the view again, so summaries follow. Parent summaries are not written into the file. 697the view again, so summaries follow. Parent summaries are not written into the file.
698 698
699On iOS, choose Column View or Column View of File from the editor's More menu. The view 699On iOS, choose Column View or Column View of File in the editor's Commands. The view
700scrolls both ways; tap a cell to select it. The bar at the bottom has Edit, which asks 700scrolls both ways; tap a cell to select it. The bar at the bottom has Edit, which asks
701for the value with the allowed values listed, Previous Value and Next Value (=p= and 701for the value with the allowed values listed, Previous Value and Next Value (=p= and
702=n=), and Go to Entry. Done closes it. 702=n=), and Go to Entry. Done closes it.
@@ -922,7 +922,7 @@ An entry's attachments are files in a folder that belongs to it, as with org-att
922 922
923The Doom keys are under =SPC m a=; see [[file:03-keys.org][Keys]]. Attaching a file stores an =attachment:= link to it, for Insert Link (=C-c C-l=). Deleting removes files for good, without the Trash. 923The Doom keys are under =SPC m a=; see [[file:03-keys.org][Keys]]. Attaching a file stores an =attachment:= link to it, for Insert Link (=C-c C-l=). Deleting removes files for good, without the Trash.
924 924
925On iOS the commands are under More ▸ Attachments, with Attach Photo or Video… for the photo library. Moving and linking aren't offered there. Files, photos and videos shared to orgstar from another app are attached too: the share sheet offers Attach, and orgstar asks for the entry when it next opens. 925On iOS the commands are in the editor's Commands, with Attach Photo or Video… for the photo library. Moving and linking aren't offered there. Files, photos and videos shared to orgstar from another app are attached too: the share sheet offers Attach, and orgstar asks for the entry when it next opens.
926 926
927| Setting | Default | What it does | 927| Setting | Default | What it does |
928|-+-+-| 928|-+-+-|
@@ -949,7 +949,7 @@ ww0ECQMI…
949| Encrypt Tagged Entries… (=app.crypt.encrypt-entries=) | Encrypts every entry with the =crypt= tag, its own or inherited, that isn't encrypted yet (=org-encrypt-entries=). A tagged entry's tagged children go inside its message. | 949| Encrypt Tagged Entries… (=app.crypt.encrypt-entries=) | Encrypts every entry with the =crypt= tag, its own or inherited, that isn't encrypted yet (=org-encrypt-entries=). A tagged entry's tagged children go inside its message. |
950| Forget Encryption Passphrase (=app.crypt.forget-passphrase=) | Removes the current file's passphrase from the Keychain. | 950| Forget Encryption Passphrase (=app.crypt.forget-passphrase=) | Removes the current file's passphrase from the Keychain. |
951 951
952The commands have no keys, as in Org; run them from the command palette, or bind them in =keymap.toml=. On iOS they are under More ▸ Encryption. 952The commands have no keys, as in Org; run them from the command palette, or bind them in =keymap.toml=. On iOS they are in the editor's Commands.
953 953
954Remember in the Keychain stores the passphrase for the file. The next command on that file uses it after Touch ID, Face ID or the device password, without asking. =org-crypt-tag-matcher= in =config.toml= sets the tag; it must be a single tag, not a match expression. 954Remember in the Keychain stores the passphrase for the file. The next command on that file uses it after Touch ID, Face ID or the device password, without asking. =org-crypt-tag-matcher= in =config.toml= sets the tag; it must be a single tag, not a match expression.
955 955
docs/manual/guide/09-links.org +2 −2 · view
@@ -339,7 +339,7 @@ repeat show their file's name. A file node's title is its =#+TITLE=, or its name
339 339
340A title that no node has makes a new node, as org-roam's default capture template does: a file named =%<%Y%m%d%H%M%S>-${slug}.org= in =org-roam-directory= (the first folder unless it is set), starting with an =ID= property drawer and =#+title:= and the title. Find Node… opens it; Insert Node Link… links to it. The slug is the title in lower case, accents dropped, with everything but letters and digits as one =_=, as =org-roam-node-slugify= makes it. 340A title that no node has makes a new node, as org-roam's default capture template does: a file named =%<%Y%m%d%H%M%S>-${slug}.org= in =org-roam-directory= (the first folder unless it is set), starting with an =ID= property drawer and =#+title:= and the title. Find Node… opens it; Insert Node Link… links to it. The slug is the title in lower case, accents dropped, with everything but letters and digits as one =_=, as =org-roam-node-slugify= makes it.
341 341
342*The graph.* Show Node Graph, or Window ▸ Node Graph on the Mac and More ▸ Node Graph on iOS, draws every node as a dot and every =id:= link between two nodes as a line. It is part of orgstar+. 342*The graph.* Show Node Graph, or Window ▸ Node Graph on the Mac and Commands on iOS, draws every node as a dot and every =id:= link between two nodes as a line. It is part of orgstar+.
343 343
344- A link belongs to the innermost heading with an ID around it, else to its file's node; a link written where there is no node, or to an ID no node has, isn't drawn. Several links between the same two nodes are one line. 344- A link belongs to the innermost heading with an ID around it, else to its file's node; a link written where there is no node, or to an ID no node has, isn't drawn. Several links between the same two nodes are one line.
345- A dot is larger the more links its node has. The node the caret is in is orange. Titles are drawn where they have room, the most-linked nodes first; zooming in shows more. 345- A dot is larger the more links its node has. The node the caret is in is orange. Titles are drawn where they have room, the most-linked nodes first; zooming in shows more.
@@ -637,7 +637,7 @@ web, mail and other files go to the system. The iOS editor shows inline images a
637Mac does, and so does the reader, except in headings. In the editor, Store Link, Store ID Link and Insert Link… 637Mac does, and so does the reader, except in headings. In the editor, Store Link, Store ID Link and Insert Link…
638are in Commands, and on a hardware keyboard the Emacs keys run them; they work as 638are in Commands, and on a hardware keyboard the Emacs keys run them; they work as
639described above, and stored links last until the app quits. =org-protocol://store-link= 639described above, and stored links last until the app quits. =org-protocol://store-link=
640links opened on the device are stored and copied too. More ▸ Backlinks lists the same 640links opened on the device are stored and copied too. Show Backlinks in Commands lists the same
641links as the Mac's backlinks pane, for the heading at the caret and the file. See 641links as the Mac's backlinks pane, for the heading at the caret and the file. See
642[[file:14-ios.org][iOS]]. 642[[file:14-ios.org][iOS]].
643 643
docs/manual/guide/10-tables.org +4 −5 · view
@@ -159,9 +159,8 @@ tables at full width.
159| Export Table to File… (command palette) | =org-table-export= | 159| Export Table to File… (command palette) | =org-table-export= |
160 160
161Open the command palette with =⇧⌘P= (=M-x= in the Emacs preset, =SPC := in Doom). On 161Open the command palette with =⇧⌘P= (=M-x= in the Emacs preset, =SPC := in Doom). On
162iOS, both are under More › Table in the editor, as Import Table from File…, Export Table 162iOS, both are in the editor's Commands, as Import Table from File…, Export Table to
163as CSV… and Export Table as TSV…, and in Commands; the file comes from, and goes to, the 163File… (CSV) and Export Table as TSV…; the file comes from, and goes to, the Files app.
164Files app.
165 164
166Import asks for a CSV, TSV or plain text file, inserts its contents at the caret on a 165Import asks for a CSV, TSV or plain text file, inserts its contents at the caret on a
167line of its own, and converts them to a table with the separator guessed as for a 166line of its own, and converts them to a table with the separator guessed as for a
@@ -774,7 +773,7 @@ export writes them as a code block. See [[file:12-export.org][Export]].
774* Plotting 773* Plotting
775 774
776Plot Table (=org-plot/gnuplot=, =C-c " g= in the Emacs and Doom presets, and in the 775Plot Table (=org-plot/gnuplot=, =C-c " g= in the Emacs and Doom presets, and in the
777command palette; More › Table on iOS) draws the table at the caret, or the first table 776command palette; Commands on iOS) draws the table at the caret, or the first table
778after it, as the =#+PLOT:= lines above it say: 777after it, as the =#+PLOT:= lines above it say:
779 778
780#+BEGIN_SRC org 779#+BEGIN_SRC org
@@ -850,6 +849,6 @@ the plot itself in the same way.
850 849
851The iOS app evaluates formulas natively with the same engine. Tables that need Emacs 850The iOS app evaluates formulas natively with the same engine. Tables that need Emacs
852are not recalculated there; the app reports =This table needs Emacs, which runs on the 851are not recalculated there; the app reports =This table needs Emacs, which runs on the
853Mac= with the reason. Import and export are under More › Table, with Plot Table. 852Mac= with the reason. Import, export and Plot Table are in Commands.
854Narrow columns work in the editor, as described under /Narrow columns/. See 853Narrow columns work in the editor, as described under /Narrow columns/. See
855[[file:14-ios.org][iOS]]. 854[[file:14-ios.org][iOS]].
docs/manual/guide/14-ios.org +48 −39 · view
@@ -42,7 +42,7 @@ Tap a file in Folders or Search, or Open in File in an agenda entry's sheet, to
42- 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. 42- 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.
43- 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. 43- 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.
44- 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. 44- 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, and Edit (the pencil). 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.
46- 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). 46- 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).
47- Find opens the system find bar over the file's text. Results are marked, and the one shown is unfolded and scrolled to. 47- Find opens the system find bar over the file's text. Results are marked, and the one shown is unfolded and scrolled to.
48 48
@@ -50,14 +50,19 @@ Tap a file in Folders or Search, or Open in File in an agenda entry's sheet, to
50 50
51Tap Edit in the reader. The title shows the buffer name, with =•= while there are unsaved changes. The tab bar is hidden while you edit. 51Tap Edit in the reader. The title shows the buffer name, with =•= while there are unsaved changes. The tab bar is hidden while you edit.
52 52
53The editor folds headings, drawers and blocks (tap a fold's =…= to open it, and an open drawer's first line to fold it), styles text with the theme from the configuration folder (see Themes and display below), and runs the same Org commands as the Mac. Autocorrection, smart quotes and smart dashes are off; spell checking follows =spell-check= in =config.toml= and is off by default; it leaves out code, links, dates, tags and keywords, as on the Mac. More ▸ Word Count shows the words, characters and reading time of the selection, or of the file. 53The editor folds headings, drawers and blocks (tap a fold's =…= to open it, and an open drawer's first line to fold it), styles text with the theme from the configuration folder (see Themes and display below), and runs the same Org commands as the Mac. Autocorrection, smart quotes and smart dashes are off; spell checking follows =spell-check= in =config.toml= and is off by default; it leaves out code, links, dates, tags and keywords, as on the Mac. Word Count in Commands shows the words, characters and reading time of the selection, or of the file.
54 54
55The toolbar has: 55The toolbar has:
56 56
57- Conflict :: shown while the file and your edits conflict; opens the conflict sheet. 57- Conflict :: shown while the file and your edits conflict; opens the conflict sheet.
58- Find :: the system find bar. The result shown is selected, and opened when it is in folded text. 58- Find :: the system find bar. The result shown is selected, and opened when it is in folded text.
59- 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.
59- Undo :: touch and hold it for Redo. 61- Undo :: touch and hold it for Redo.
60- More :: Commands, Clock In, Show Markup, Recent Entries, Export, Resolve Sync Conflicts…, and Recovery Versions…. 62- Export :: the export formats, as in the reader; see Export below.
63- Commands :: every command; see Commands below.
64
65The key bar holds what you repeat at the caret while typing, the toolbar what acts on the whole file, and Commands everything else.
61 66
62Messages 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=. 67Messages 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=.
63 68
@@ -65,13 +70,13 @@ Messages from commands show at the top of the editor and the column view, and at
65 70
66On iPad, the editor can show a file in several panes, as a Mac window does (see [[file:01-files-and-folders.org][Files and folders]]): 71On iPad, the editor can show a file in several panes, as a Mac window does (see [[file:01-files-and-folders.org][Files and folders]]):
67 72
68| Command | Where | Emacs keys | Does | 73| Command | Where | Emacs keys | Does |
69|-------------------+----------------------------------------------+------------+-------------------------------------------------------------| 74|-------------------+-------------------------------------------+------------+------------------------------------------------------------------------|
70| Split Pane Right | More ▸ Panes, Commands, a hardware keyboard | =C-x 3= | Halves the focused pane side by side; the new pane shows the same file | 75| Split Pane Right | Commands, View menu, a hardware keyboard | =C-x 3= | Halves the focused pane side by side; the new pane shows the same file |
71| Split Pane Below | More ▸ Panes, Commands, a hardware keyboard | =C-x 2= | Halves the focused pane one above the other | 76| Split Pane Below | Commands, View menu, a hardware keyboard | =C-x 2= | Halves the focused pane one above the other |
72| Next Pane | More ▸ Panes, Commands, a hardware keyboard | =C-x o= | Moves focus to the next pane | 77| Next Pane | Commands, View menu, a hardware keyboard | =C-x o= | Moves focus to the next pane |
73| Close Pane | More ▸ Panes, Commands, a hardware keyboard | =C-x 0= | Closes the focused pane | 78| Close Pane | Commands, View menu, a hardware keyboard | =C-x 0= | Closes the focused pane |
74| Close Other Panes | More ▸ Panes, Commands, a hardware keyboard | =C-x 1= | Closes every pane but the focused one | 79| Close Other Panes | Commands, View menu, a hardware keyboard | =C-x 1= | Closes every pane but the focused one |
75 80
76The focused pane has a line along its top and the toolbar acts on it; tap in a pane to focus it. Drag the line between two panes to resize them; with VoiceOver, swipe up or down on it. Every pane shows the same buffer: text typed in one shows in the others at once, and folds, narrowing and styles are the buffer's. The caret and scroll position are each pane's own, and so is undo: Undo in a pane undoes what was typed or changed in that pane. A link to another file opens it on its own screen, leaving the panes as they are. 81The focused pane has a line along its top and the toolbar acts on it; tap in a pane to focus it. Drag the line between two panes to resize them; with VoiceOver, swipe up or down on it. Every pane shows the same buffer: text typed in one shows in the others at once, and folds, narrowing and styles are the buffer's. The caret and scroll position are each pane's own, and so is undo: Undo in a pane undoes what was typed or changed in that pane. A link to another file opens it on its own screen, leaving the panes as they are.
77 82
@@ -111,7 +116,7 @@ The editor and the reader apply these display settings; only the editor aligns t
111| =org-startup-align-all-tables= | Every table is aligned | =align=, =noalign= | 116| =org-startup-align-all-tables= | Every table is aligned | =align=, =noalign= |
112| =org-startup-truncated= | Long lines run off the right edge, and the editor scrolls sideways | | 117| =org-startup-truncated= | Long lines run off the right edge, and the editor scrolls sideways | |
113 118
114While markup is hidden, the line with the caret shows its markup, so you can edit it. More ▸ Show Markup, or Show or Hide Markup in Commands, switches markup in every editor and in the reader. The switch lasts until =show-markup= in =config.toml= changes; then the file's value applies. 119While markup is hidden, the line with the caret shows its markup, so you can edit it. Show or Hide Markup in Commands switches markup in every editor and in the reader. The switch lasts until =show-markup= in =config.toml= changes; then the file's value applies.
115 120
116The visibility from =#+STARTUP= applies first, then each heading's =VISIBILITY= property. As on the Mac, =VISIBILITY= properties apply only when =#+STARTUP= sets a visibility (=overview=, =content=, =showall= and the like). 121The visibility from =#+STARTUP= applies first, then each heading's =VISIBILITY= property. As on the Mac, =VISIBILITY= properties apply only when =#+STARTUP= sets a visibility (=overview=, =content=, =showall= and the like).
117 122
@@ -123,34 +128,37 @@ Table columns with width cookies narrow as on the Mac: =#+STARTUP: shrink= narro
123 128
124** The key bar 129** The key bar
125 130
126A bar above the on-screen keyboard has buttons for Org's keys. Each does what its Emacs key does at the caret, so the arrows promote and demote headings, indent list items, or move table columns, depending on where the caret is. Scroll the bar sideways for more. Its buttons are at least 44 points high and grow with the text size up to the second accessibility size. 131A bar above the on-screen keyboard has buttons for Org's keys. Each does what its Emacs key does at the caret, so the arrows promote and demote headings, indent list items, or move table columns, depending on where the caret is. The buttons share the bar's width, so all of them show without scrolling. They are at least 44 points high and grow with the text size up to the second accessibility size.
127 132
128#+CAPTION: The iPhone editor with the key bar above the keyboard. 133#+CAPTION: The iPhone editor with the key bar above the keyboard.
129#+ATTR_HTML: :width 368 134#+ATTR_HTML: :width 368
130[[file:../images/ios-editor.png]] 135[[file:../images/ios-editor.png]]
131 136
132| Button | Key | 137| Button | Key |
133|----------------------+-------------| 138|----------------------+------------------------------------------------------------|
134| Commands | the command list | 139| Commands | the command list |
135| Fold | =TAB= | 140| Fold | =TAB= |
136| Overview | =S-TAB= | 141| Promote | =M-<left>= |
137| Promote | =M-<left>= | 142| Demote | =M-<right>= |
138| Demote | =M-<right>= | 143| Move Up | =M-<up>= |
139| Move Up | =M-<up>= | 144| Move Down | =M-<down>= |
140| Move Down | =M-<down>= | 145| New Heading or Item | =M-RET= |
141| New Heading or Item | =M-RET= | 146| TODO | =C-c C-t= |
142| TODO | =C-c C-t= | 147| Act at Point | =C-c C-c= |
143| Act at Point | =C-c C-c= | 148| Plan | a menu of Schedule (=C-c C-s=), Deadline (=C-c C-d=) and Tags (=C-c C-q=) |
144| Schedule | =C-c C-s= | 149| Hide Keyboard | |
145| Deadline | =C-c C-d= | 150
146| Tags | =C-c C-q= | 151On iPad, where the bar is wider, Schedule, Deadline and Tags are buttons of their own in place of Plan.
147| Open Link | =C-c C-o= | 152
148| Bold, Italic, Code | Emphasize with =*=, =/= or =~=: the selection, or a pair of markers with the caret between | 153Bold, Italic and Code are in the edit menu of a selection, under Format: each puts =*=, =/= or =~= around the selection. With no selection, the commands of the same names in Commands insert a pair of markers with the caret between. Overview (=S-TAB=, Cycle Global Visibility) and Open Link (=C-c C-o=, or a tap on the link) are in Commands.
149| Hide Keyboard | |
150 154
151** Commands 155** Commands
152 156
153Commands (in the key bar or More) lists every command that applies at the caret, with its Emacs key. Type to narrow the list. The command runs once the list closes. 157Commands, 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.
158
159In 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.
160
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.
154 162
155When a command asks a question, a sheet opens: 163When a command asks a question, a sheet opens:
156 164
@@ -162,17 +170,17 @@ Cancel answers nothing, as =C-g= does.
162 170
163=C-c '= on a block, and =C-c `= on a table field, open the text in a sheet of its own; Save puts it back. A src block's code is colored as its language, as in the editor. 171=C-c '= on a block, and =C-c `= on a table field, open the text in a sheet of its own; Save puts it back. A src block's code is colored as its language, as in the editor.
164 172
165More ▸ Backlinks lists the links to the heading at the caret and to the file; More ▸ Daily Notes, Find Node…, Insert Node Link… and Node Graph work with org-roam-style notes, and the Folders tab's calendar menu opens today's, yesterday's and tomorrow's note. See [[file:09-links.org][Links]]. 173Show Backlinks in Commands lists the links to the heading at the caret and to the file; the daily note commands, Find Node…, Insert Node Link… and Show Node Graph, all in Commands, work with org-roam-style notes, and the Folders tab's calendar menu opens today's, yesterday's and tomorrow's note. See [[file:09-links.org][Links]].
166 174
167Incremental Search is in Commands, and on =C-s= and =C-r= with a hardware keyboard; see [[file:02-the-editor.org][The editor]]. =auto-fill-mode= works as on the Mac. 175Incremental Search is in Commands, and on =C-s= and =C-r= with a hardware keyboard; see [[file:02-the-editor.org][The editor]]. =auto-fill-mode= works as on the Mac.
168 176
169The org-timer commands are in Commands; a running timer shows above the text. See [[file:06-dates-and-clocking.org][Dates and clocking]]. 177The org-timer commands are in Commands; a running timer shows above the text. See [[file:06-dates-and-clocking.org][Dates and clocking]].
170 178
171More ▸ Attachments has the org-attach commands, Attach Photo or Video…, Take Photo… and Scan Document…, which insert the link to the photo, or to the scanned pages as one PDF, at the caret; files shared to orgstar can be attached to an entry. Pasting an image and dropping files on the editor attach them and link them at the caret. Attachments are copied or moved: iOS doesn't let orgstar link a file from another app's storage, so the keys for attaching by hard link or symbolic link say "Attachments can't be linked on iPhone and iPad; Attach File… copies the file." See [[file:04-outlines.org][Outlines]] and [[file:09-links.org][Links]]. 179Commands has the org-attach commands, and Attach Photo or Video…, Take Photo… and Scan Document…, which insert the link to the photo, or to the scanned pages as one PDF, at the caret; files shared to orgstar can be attached to an entry. Pasting an image and dropping files on the editor attach them and link them at the caret. Attachments are copied or moved: iOS doesn't let orgstar link a file from another app's storage, so the keys for attaching by hard link or symbolic link say "Attachments can't be linked on iPhone and iPad; Attach File… copies the file." See [[file:04-outlines.org][Outlines]] and [[file:09-links.org][Links]].
172 180
173Archive Subtree in Commands (or =C-c C-x C-s= with a hardware keyboard) archives the entry at the caret where =org-archive-location= says, as on the Mac. 181Archive Subtree in Commands (or =C-c C-x C-s= with a hardware keyboard) archives the entry at the caret where =org-archive-location= says, as on the Mac.
174 182
175More ▸ Encryption has the org-crypt commands; see [[file:04-outlines.org][Outlines]]. A remembered passphrase is used after Face ID, Touch ID or the device passcode. 183Commands has the org-crypt commands; see [[file:04-outlines.org][Outlines]]. A remembered passphrase is used after Face ID, Touch ID or the device passcode.
176 184
177** The menu bar on iPad 185** The menu bar on iPad
178 186
@@ -224,6 +232,7 @@ Tap a result to open it in the reader. A heading result opens at that heading.
224The Agenda tab shows the agenda over all your folders, with the span and start day from the settings (10 days from 3 days ago by default). Each day lists its entries in rows: the time or a status such as =Due today= or =3d late= on the left, the category, tags and keyword above the title, as on the Mac (see Rows in [[file:07-agenda.org][The agenda]]). Days without entries are hidden, except today. Under today's header, today's overdue entries come first under Overdue, and a line marks the current time between timed entries. Pull down to refresh. 232The Agenda tab shows the agenda over all your folders, with the span and start day from the settings (10 days from 3 days ago by default). Each day lists its entries in rows: the time or a status such as =Due today= or =3d late= on the left, the category, tags and keyword above the title, as on the Mac (see Rows in [[file:07-agenda.org][The agenda]]). Days without entries are hidden, except today. Under today's header, today's overdue entries come first under Overdue, and a line marks the current time between timed entries. Pull down to refresh.
225 233
226- Views (top left) :: the built-in views and those in =views.toml=, Tags and Properties… (a match such as =+work-home= or ~TODO="WAIT"~), and Search… (a phrase, or snippets such as =+invoice -paid=); Save as View… keeps the match or search showing as a view in =views.toml=. Below them are Go to Date…, Filter… and Select, which picks entries for an action on all of them. 234- Views (top left) :: the built-in views and those in =views.toml=, Tags and Properties… (a match such as =+work-home= or ~TODO="WAIT"~), and Search… (a phrase, or snippets such as =+invoice -paid=); Save as View… keeps the match or search showing as a view in =views.toml=. Below them are Go to Date…, Filter… and Select, which picks entries for an action on all of them.
235- Commands (top right) :: the agenda's views and actions, Capture… and the clock commands, in one searchable list; see Commands under The editor.
227- Folders (top right, with more than one folder) :: shows or hides each folder's files in the agenda, the widgets, the watch and the badge; the shown folders' names appear under the title. A Focus can hide folders too, and mute their reminders (see Hiding folders in [[file:07-agenda.org][The agenda]]). 236- Folders (top right, with more than one folder) :: shows or hides each folder's files in the agenda, the widgets, the watch and the badge; the shown folders' names appear under the title. A Focus can hide folders too, and mute their reminders (see Hiding folders in [[file:07-agenda.org][The agenda]]).
228- The bar at the bottom :: Earlier, Today, the span (Day, Week, Month or the configured span, and Log Mode, which adds closed entries and clocked time) and Later. At accessibility text sizes Today is in the span's menu, and each entry's time or status is on a line of its own above it. 237- The bar at the bottom :: Earlier, Today, the span (Day, Week, Month or the configured span, and Log Mode, which adds closed entries and clocked time) and Later. At accessibility text sizes Today is in the span's menu, and each entry's time or status is on a line of its own above it.
229- Filter :: keep or leave out tags and categories of the entries shown, or type a filter as Org's =/= takes it: =+keep= and =-drop= tags or categories, =<0:30= for effort, =/regexp/=. The filter in use shows above the bar. 238- Filter :: keep or leave out tags and categories of the entries shown, or type a filter as Org's =/= takes it: =+keep= and =-drop= tags or categories, =<0:30= for effort, =/regexp/=. The filter in use shows above the bar.
@@ -338,7 +347,7 @@ See [[file:08-capture.org][Capture]] for the template format.
338 347
339* Clocking 348* Clocking
340 349
341Clock in from the editor (More ▸ Clock In, or Clock In in Commands) or from an agenda entry's menu. While a clock runs, a bar above the tab bar shows the entry and the time so far as =H:MM=, updated every 30 seconds, and a Live Activity shows it on the Lock Screen and in the Dynamic Island (see [[*Widgets and the Live Activity][Widgets and the Live Activity]]). Tap the bar for: 350Clock in from the editor (Clock In in Commands) or from an agenda entry's menu. While a clock runs, a bar above the tab bar shows the entry and the time so far as =H:MM=, updated every 30 seconds, and a Live Activity shows it on the Lock Screen and in the Dynamic Island (see [[*Widgets and the Live Activity][Widgets and the Live Activity]]). Tap the bar for:
342 351
343- Clock Out 352- Clock Out
344- Cancel Clock 353- Cancel Clock
@@ -346,7 +355,7 @@ Clock in from the editor (More ▸ Clock In, or Clock In in Commands) or from an
346- Recent Entries 355- Recent Entries
347- Clock Report 356- Clock Report
348 357
349Recent Entries, in the bar and in the editor's More menu, lists the recently clocked entries; tap one to clock in to it. It also has Clock In to Recent Entry… and Go to Recent Clocked Entry…, and is disabled until you have clocked in once. Commands has Clock In to Recent Entry…, Clock In to Last Entry, Go to Recent Clocked Entry…, Mark as Default Clock Task and Resolve Open Clocks…. 358Recent Entries, in the bar, lists the recently clocked entries; tap one to clock in to it. It also has Clock In to Recent Entry… and Go to Recent Clocked Entry…, and is disabled until you have clocked in once. Commands has Clock In to Recent Entry…, Clock In to Last Entry, Go to Recent Clocked Entry…, Mark as Default Clock Task and Resolve Open Clocks….
350 359
351Clock questions open in a sheet: the task selection and the resolution keys as lists to tap, and minutes or a date and time as a field. Cancel answers nothing, as =q= does. Clocking in with no clock running first asks about open clocks in your folders, from the editor, an agenda entry's Clock In or a capture template with =clock-in=; Resolve Open Clocks… asks about every open clock. Both work as on the Mac. 360Clock questions open in a sheet: the task selection and the resolution keys as lists to tap, and minutes or a date and time as a field. Cancel answers nothing, as =q= does. Clocking in with no clock running first asks about open clocks in your folders, from the editor, an agenda entry's Clock In or a capture template with =clock-in=; Resolve Open Clocks… asks about every open clock. Both work as on the Mac.
352 361
@@ -366,7 +375,7 @@ The app icon's badge counts the entries in the agenda's Overdue section that are
366 375
367* Export 376* Export
368 377
369Export (in the reader's toolbar and the editor's More menu) 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 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.
370 379
371PDF 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. 380PDF 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.
372 381
@@ -405,9 +414,9 @@ When a file changes on disk while you have unsaved edits, orgstar merges the cha
405 414
406The version you don't keep goes to the recovery folder. 415The version you don't keep goes to the recovery folder.
407 416
408More ▸ Resolve Sync Conflicts… 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. 417Resolve 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.
409 418
410More ▸ Recovery 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. 419Recovery 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.
411 420
412See [[file:15-alongside-emacs.org][Working alongside Emacs and other tools]] for how merging and recovery work. 421See [[file:15-alongside-emacs.org][Working alongside Emacs and other tools]] for how merging and recovery work.
413 422
docs/manual/guide/15-alongside-emacs.org +2 −2 · view
@@ -76,7 +76,7 @@ Syncthing writes files without file coordination. orgstar sees its changes throu
76- Its folders =.stfolder= and =.stversions= are in the default =ignored-folders=. 76- Its folders =.stfolder= and =.stversions= are in the default =ignored-folders=.
77- Conflict copies (=name.sync-conflict-YYYYMMDD-HHMMSS-ID.org=) are listed in the sidebar but never indexed, so they don't appear in the agenda, search or ID links. 77- Conflict copies (=name.sync-conflict-YYYYMMDD-HHMMSS-ID.org=) are listed in the sidebar but never indexed, so they don't appear in the agenda, search or ID links.
78 78
79When a file with conflict copies opens, a message says how many there are. File ▸ Resolve Sync Conflicts… (More ▸ Resolve Sync Conflicts… on iOS) lists each copy against the file, with lines marked - in the file and + in the copy: 79When a file with conflict copies opens, a message says how many there are. File ▸ Resolve Sync Conflicts… (on iOS, a toolbar button while there are copies, and in Commands) lists each copy against the file, with lines marked - in the file and + in the copy:
80 80
81| Button | Effect | 81| Button | Effect |
82|--------------------+--------------------------------------------------------------------------------------------| 82|--------------------+--------------------------------------------------------------------------------------------|
@@ -111,7 +111,7 @@ Each file has a subfolder named from a hash of its path, holding its last 20 rep
111| =sync-conflict= | A Syncthing conflict copy was resolved | 111| =sync-conflict= | A Syncthing conflict copy was resolved |
112| =snapshot= | A save changed the file and the last snapshot was more than an hour before | 112| =snapshot= | A save changed the file and the last snapshot was more than an hour before |
113 113
114File ▸ Recovery Versions… (More ▸ Recovery Versions… on iOS) lists the open file's kept versions, newest first, each compared with the buffer (lines marked - in the buffer, + in the kept version). Restore puts a version's text in the buffer as an edit you can undo; the buffer as it was goes to the recovery folder first. On the Mac, Show in Finder selects the version's file. 114File ▸ Recovery Versions… (on iOS, a toolbar button while there are versions, and in Commands) lists the open file's kept versions, newest first, each compared with the buffer (lines marked - in the buffer, + in the kept version). Restore puts a version's text in the buffer as an edit you can undo; the buffer as it was goes to the recovery folder first. On the Mac, Show in Finder selects the version's file.
115 115
116* Features that use Emacs on the Mac 116* Features that use Emacs on the Mac
117 117
l10n/Localizable.xcstrings +338 −25 · view
@@ -2332,7 +2332,8 @@
2332 } 2332 }
2333 } 2333 }
2334 }, 2334 },
2335 "%lld sync conflict copies of this file; More › Resolve Sync Conflicts… compares them.": { 2335 "%lld sync conflict copies of this file; Resolve Sync Conflicts compares them.": {
2336 "comment": "Echo area when a file with Syncthing conflict copies opens",
2336 "localizations": { 2337 "localizations": {
2337 "de": { 2338 "de": {
2338 "variations": { 2339 "variations": {
@@ -2340,13 +2341,13 @@
2340 "one": { 2341 "one": {
2341 "stringUnit": { 2342 "stringUnit": {
2342 "state": "translated", 2343 "state": "translated",
2343 "value": "%lld Synchronisierungskonflikt-Kopie dieser Datei; Mehr › Synchronisierungskonflikte auflösen … vergleicht sie." 2344 "value": "%lld Synchronisierungskonflikt-Kopie dieser Datei; Synchronisierungskonflikte auflösen vergleicht sie."
2344 } 2345 }
2345 }, 2346 },
2346 "other": { 2347 "other": {
2347 "stringUnit": { 2348 "stringUnit": {
2348 "state": "translated", 2349 "state": "translated",
2349 "value": "%lld Synchronisierungskonflikt-Kopien dieser Datei; Mehr › Synchronisierungskonflikte auflösen … vergleicht sie." 2350 "value": "%lld Synchronisierungskonflikt-Kopien dieser Datei; Synchronisierungskonflikte auflösen vergleicht sie."
2350 } 2351 }
2351 } 2352 }
2352 } 2353 }
@@ -2358,13 +2359,13 @@
2358 "one": { 2359 "one": {
2359 "stringUnit": { 2360 "stringUnit": {
2360 "state": "translated", 2361 "state": "translated",
2361 "value": "%lld sync conflict copy of this file; More › Resolve Sync Conflicts… compares them." 2362 "value": "%lld sync conflict copy of this file; Resolve Sync Conflicts compares them."
2362 } 2363 }
2363 }, 2364 },
2364 "other": { 2365 "other": {
2365 "stringUnit": { 2366 "stringUnit": {
2366 "state": "translated", 2367 "state": "translated",
2367 "value": "%lld sync conflict copies of this file; More › Resolve Sync Conflicts… compares them." 2368 "value": "%lld sync conflict copies of this file; Resolve Sync Conflicts compares them."
2368 } 2369 }
2369 } 2370 }
2370 } 2371 }
@@ -2376,13 +2377,13 @@
2376 "one": { 2377 "one": {
2377 "stringUnit": { 2378 "stringUnit": {
2378 "state": "translated", 2379 "state": "translated",
2379 "value": "%lld copia de conflicto de sincronización de este archivo; Más › Resolver conflictos de sincronización… las compara." 2380 "value": "%lld copia de conflicto de sincronización de este archivo; Resolver conflictos de sincronización las compara."
2380 } 2381 }
2381 }, 2382 },
2382 "other": { 2383 "other": {
2383 "stringUnit": { 2384 "stringUnit": {
2384 "state": "translated", 2385 "state": "translated",
2385 "value": "%lld copias de conflicto de sincronización de este archivo; Más › Resolver conflictos de sincronización… las compara." 2386 "value": "%lld copias de conflicto de sincronización de este archivo; Resolver conflictos de sincronización las compara."
2386 } 2387 }
2387 } 2388 }
2388 } 2389 }
@@ -2394,13 +2395,13 @@
2394 "one": { 2395 "one": {
2395 "stringUnit": { 2396 "stringUnit": {
2396 "state": "translated", 2397 "state": "translated",
2397 "value": "%lld copie de conflit de synchronisation de ce fichier ; Plus › Résoudre les conflits de synchronisation… les compare." 2398 "value": "%lld copie de conflit de synchronisation de ce fichier ; Résoudre les conflits de synchronisation les compare."
2398 } 2399 }
2399 }, 2400 },
2400 "other": { 2401 "other": {
2401 "stringUnit": { 2402 "stringUnit": {
2402 "state": "translated", 2403 "state": "translated",
2403 "value": "%lld copies de conflit de synchronisation de ce fichier ; Plus › Résoudre les conflits de synchronisation… les compare." 2404 "value": "%lld copies de conflit de synchronisation de ce fichier ; Résoudre les conflits de synchronisation les compare."
2404 } 2405 }
2405 } 2406 }
2406 } 2407 }
@@ -2409,7 +2410,7 @@
2409 "ja": { 2410 "ja": {
2410 "stringUnit": { 2411 "stringUnit": {
2411 "state": "translated", 2412 "state": "translated",
2412 "value": "このファイルの同期競合コピーが%lld個あります。「その他」›「同期の競合を解決…」で比較できます。" 2413 "value": "このファイルの同期競合コピーが%lld個あります。「同期の競合を解決」で比較できます。"
2413 } 2414 }
2414 }, 2415 },
2415 "pt-BR": { 2416 "pt-BR": {
@@ -2418,13 +2419,13 @@
2418 "one": { 2419 "one": {
2419 "stringUnit": { 2420 "stringUnit": {
2420 "state": "translated", 2421 "state": "translated",
2421 "value": "%lld cópia de conflito de sincronização deste arquivo; Mais › Resolver Conflitos de Sincronização… as compara." 2422 "value": "%lld cópia de conflito de sincronização deste arquivo; Resolver Conflitos de Sincronização as compara."
2422 } 2423 }
2423 }, 2424 },
2424 "other": { 2425 "other": {
2425 "stringUnit": { 2426 "stringUnit": {
2426 "state": "translated", 2427 "state": "translated",
2427 "value": "%lld cópias de conflito de sincronização deste arquivo; Mais › Resolver Conflitos de Sincronização… as compara." 2428 "value": "%lld cópias de conflito de sincronização deste arquivo; Resolver Conflitos de Sincronização as compara."
2428 } 2429 }
2429 } 2430 }
2430 } 2431 }
@@ -2432,8 +2433,7 @@
2432 } 2433 }
2433 } 2434 }
2434 }, 2435 },
2435 "%lld sync conflict copies of this file; Resolve Sync Conflicts compares them.": { 2436 "%lld sync conflict copies of this file; Resolve Sync Conflicts… in the toolbar compares them.": {
2436 "comment": "Echo area when a file with Syncthing conflict copies opens",
2437 "localizations": { 2437 "localizations": {
2438 "de": { 2438 "de": {
2439 "variations": { 2439 "variations": {
@@ -2441,13 +2441,13 @@
2441 "one": { 2441 "one": {
2442 "stringUnit": { 2442 "stringUnit": {
2443 "state": "translated", 2443 "state": "translated",
2444 "value": "%lld Synchronisierungskonflikt-Kopie dieser Datei; Synchronisierungskonflikte auflösen vergleicht sie." 2444 "value": "%lld Synchronisierungskonflikt-Kopie dieser Datei; Synchronisierungskonflikte auflösen … in der Symbolleiste vergleicht sie."
2445 } 2445 }
2446 }, 2446 },
2447 "other": { 2447 "other": {
2448 "stringUnit": { 2448 "stringUnit": {
2449 "state": "translated", 2449 "state": "translated",
2450 "value": "%lld Synchronisierungskonflikt-Kopien dieser Datei; Synchronisierungskonflikte auflösen vergleicht sie." 2450 "value": "%lld Synchronisierungskonflikt-Kopien dieser Datei; Synchronisierungskonflikte auflösen … in der Symbolleiste vergleicht sie."
2451 } 2451 }
2452 } 2452 }
2453 } 2453 }
@@ -2459,13 +2459,13 @@
2459 "one": { 2459 "one": {
2460 "stringUnit": { 2460 "stringUnit": {
2461 "state": "translated", 2461 "state": "translated",
2462 "value": "%lld sync conflict copy of this file; Resolve Sync Conflicts compares them." 2462 "value": "%lld sync conflict copy of this file; Resolve Sync Conflicts… in the toolbar compares them."
2463 } 2463 }
2464 }, 2464 },
2465 "other": { 2465 "other": {
2466 "stringUnit": { 2466 "stringUnit": {
2467 "state": "translated", 2467 "state": "translated",
2468 "value": "%lld sync conflict copies of this file; Resolve Sync Conflicts compares them." 2468 "value": "%lld sync conflict copies of this file; Resolve Sync Conflicts… in the toolbar compares them."
2469 } 2469 }
2470 } 2470 }
2471 } 2471 }
@@ -2477,13 +2477,13 @@
2477 "one": { 2477 "one": {
2478 "stringUnit": { 2478 "stringUnit": {
2479 "state": "translated", 2479 "state": "translated",
2480 "value": "%lld copia de conflicto de sincronización de este archivo; Resolver conflictos de sincronización las compara." 2480 "value": "%lld copia de conflicto de sincronización de este archivo; Resolver conflictos de sincronización… en la barra de herramientas las compara."
2481 } 2481 }
2482 }, 2482 },
2483 "other": { 2483 "other": {
2484 "stringUnit": { 2484 "stringUnit": {
2485 "state": "translated", 2485 "state": "translated",
2486 "value": "%lld copias de conflicto de sincronización de este archivo; Resolver conflictos de sincronización las compara." 2486 "value": "%lld copias de conflicto de sincronización de este archivo; Resolver conflictos de sincronización… en la barra de herramientas las compara."
2487 } 2487 }
2488 } 2488 }
2489 } 2489 }
@@ -2495,13 +2495,13 @@
2495 "one": { 2495 "one": {
2496 "stringUnit": { 2496 "stringUnit": {
2497 "state": "translated", 2497 "state": "translated",
2498 "value": "%lld copie de conflit de synchronisation de ce fichier ; Résoudre les conflits de synchronisation les compare." 2498 "value": "%lld copie de conflit de synchronisation de ce fichier ; Résoudre les conflits de synchronisation… dans la barre d’outils les compare."
2499 } 2499 }
2500 }, 2500 },
2501 "other": { 2501 "other": {
2502 "stringUnit": { 2502 "stringUnit": {
2503 "state": "translated", 2503 "state": "translated",
2504 "value": "%lld copies de conflit de synchronisation de ce fichier ; Résoudre les conflits de synchronisation les compare." 2504 "value": "%lld copies de conflit de synchronisation de ce fichier ; Résoudre les conflits de synchronisation… dans la barre d’outils les compare."
2505 } 2505 }
2506 } 2506 }
2507 } 2507 }
@@ -2510,7 +2510,7 @@
2510 "ja": { 2510 "ja": {
2511 "stringUnit": { 2511 "stringUnit": {
2512 "state": "translated", 2512 "state": "translated",
2513 "value": "このファイルの同期競合コピーが%lld個あります。「同期の競合を解決」で比較できます。" 2513 "value": "このファイルの同期競合コピーが%lld個あります。ツールバーの「同期の競合を解決…」で比較できます。"
2514 } 2514 }
2515 }, 2515 },
2516 "pt-BR": { 2516 "pt-BR": {
@@ -2519,13 +2519,13 @@
2519 "one": { 2519 "one": {
2520 "stringUnit": { 2520 "stringUnit": {
2521 "state": "translated", 2521 "state": "translated",
2522 "value": "%lld cópia de conflito de sincronização deste arquivo; Resolver Conflitos de Sincronização as compara." 2522 "value": "%lld cópia de conflito de sincronização deste arquivo; Resolver Conflitos de Sincronização… na barra de ferramentas as compara."
2523 } 2523 }
2524 }, 2524 },
2525 "other": { 2525 "other": {
2526 "stringUnit": { 2526 "stringUnit": {
2527 "state": "translated", 2527 "state": "translated",
2528 "value": "%lld cópias de conflito de sincronização deste arquivo; Resolver Conflitos de Sincronização as compara." 2528 "value": "%lld cópias de conflito de sincronização deste arquivo; Resolver Conflitos de Sincronização… na barra de ferramentas as compara."
2529 } 2529 }
2530 } 2530 }
2531 } 2531 }
@@ -4293,6 +4293,40 @@
4293 } 4293 }
4294 } 4294 }
4295 }, 4295 },
4296 "All Commands": {
4297 "localizations": {
4298 "de": {
4299 "stringUnit": {
4300 "state": "translated",
4301 "value": "Alle Befehle"
4302 }
4303 },
4304 "es": {
4305 "stringUnit": {
4306 "state": "translated",
4307 "value": "Todos los comandos"
4308 }
4309 },
4310 "fr": {
4311 "stringUnit": {
4312 "state": "translated",
4313 "value": "Toutes les commandes"
4314 }
4315 },
4316 "ja": {
4317 "stringUnit": {
4318 "state": "translated",
4319 "value": "すべてのコマンド"
4320 }
4321 },
4322 "pt-BR": {
4323 "stringUnit": {
4324 "state": "translated",
4325 "value": "Todos os comandos"
4326 }
4327 }
4328 }
4329 },
4296 "All Folders": { 4330 "All Folders": {
4297 "localizations": { 4331 "localizations": {
4298 "de": { 4332 "de": {
@@ -25803,6 +25837,41 @@
25803 } 25837 }
25804 } 25838 }
25805 }, 25839 },
25840 "No sync conflict copies": {
25841 "comment": "Why Resolve Sync Conflicts… is greyed in the Commands list",
25842 "localizations": {
25843 "de": {
25844 "stringUnit": {
25845 "state": "translated",
25846 "value": "Keine Konfliktkopien"
25847 }
25848 },
25849 "es": {
25850 "stringUnit": {
25851 "state": "translated",
25852 "value": "No hay copias de conflicto"
25853 }
25854 },
25855 "fr": {
25856 "stringUnit": {
25857 "state": "translated",
25858 "value": "Aucune copie de conflit"
25859 }
25860 },
25861 "ja": {
25862 "stringUnit": {
25863 "state": "translated",
25864 "value": "競合コピーはありません"
25865 }
25866 },
25867 "pt-BR": {
25868 "stringUnit": {
25869 "state": "translated",
25870 "value": "Nenhuma cópia de conflito"
25871 }
25872 }
25873 }
25874 },
25806 "No table at point": { 25875 "No table at point": {
25807 "localizations": { 25876 "localizations": {
25808 "de": { 25877 "de": {
@@ -26281,6 +26350,76 @@
26281 } 26350 }
26282 } 26351 }
26283 }, 26352 },
26353 "Not in a code block": {
26354 "comment": "Why a command is greyed in the Commands list",
26355 "localizations": {
26356 "de": {
26357 "stringUnit": {
26358 "state": "translated",
26359 "value": "Nicht in einem Codeblock"
26360 }
26361 },
26362 "es": {
26363 "stringUnit": {
26364 "state": "translated",
26365 "value": "No está en un bloque de código"
26366 }
26367 },
26368 "fr": {
26369 "stringUnit": {
26370 "state": "translated",
26371 "value": "Pas dans un bloc de code"
26372 }
26373 },
26374 "ja": {
26375 "stringUnit": {
26376 "state": "translated",
26377 "value": "コードブロックの中ではありません"
26378 }
26379 },
26380 "pt-BR": {
26381 "stringUnit": {
26382 "state": "translated",
26383 "value": "Não está em um bloco de código"
26384 }
26385 }
26386 }
26387 },
26388 "Not in a list": {
26389 "comment": "Why a command is greyed in the Commands list",
26390 "localizations": {
26391 "de": {
26392 "stringUnit": {
26393 "state": "translated",
26394 "value": "Nicht in einer Liste"
26395 }
26396 },
26397 "es": {
26398 "stringUnit": {
26399 "state": "translated",
26400 "value": "No está en una lista"
26401 }
26402 },
26403 "fr": {
26404 "stringUnit": {
26405 "state": "translated",
26406 "value": "Pas dans une liste"
26407 }
26408 },
26409 "ja": {
26410 "stringUnit": {
26411 "state": "translated",
26412 "value": "リストの中ではありません"
26413 }
26414 },
26415 "pt-BR": {
26416 "stringUnit": {
26417 "state": "translated",
26418 "value": "Não está em uma lista"
26419 }
26420 }
26421 }
26422 },
26284 "Not in a subtree": { 26423 "Not in a subtree": {
26285 "localizations": { 26424 "localizations": {
26286 "de": { 26425 "de": {
@@ -26315,6 +26454,76 @@
26315 } 26454 }
26316 } 26455 }
26317 }, 26456 },
26457 "Not on a link": {
26458 "comment": "Why a command is greyed in the Commands list",
26459 "localizations": {
26460 "de": {
26461 "stringUnit": {
26462 "state": "translated",
26463 "value": "Nicht auf einem Link"
26464 }
26465 },
26466 "es": {
26467 "stringUnit": {
26468 "state": "translated",
26469 "value": "No está en un enlace"
26470 }
26471 },
26472 "fr": {
26473 "stringUnit": {
26474 "state": "translated",
26475 "value": "Pas sur un lien"
26476 }
26477 },
26478 "ja": {
26479 "stringUnit": {
26480 "state": "translated",
26481 "value": "リンクの上ではありません"
26482 }
26483 },
26484 "pt-BR": {
26485 "stringUnit": {
26486 "state": "translated",
26487 "value": "Não está em um link"
26488 }
26489 }
26490 }
26491 },
26492 "Not on a timestamp": {
26493 "comment": "Why a command is greyed in the Commands list",
26494 "localizations": {
26495 "de": {
26496 "stringUnit": {
26497 "state": "translated",
26498 "value": "Nicht auf einem Zeitstempel"
26499 }
26500 },
26501 "es": {
26502 "stringUnit": {
26503 "state": "translated",
26504 "value": "No está en una marca de tiempo"
26505 }
26506 },
26507 "fr": {
26508 "stringUnit": {
26509 "state": "translated",
26510 "value": "Pas sur un horodatage"
26511 }
26512 },
26513 "ja": {
26514 "stringUnit": {
26515 "state": "translated",
26516 "value": "タイムスタンプの上ではありません"
26517 }
26518 },
26519 "pt-BR": {
26520 "stringUnit": {
26521 "state": "translated",
26522 "value": "Não está em um carimbo de data"
26523 }
26524 }
26525 }
26526 },
26318 "Not recalculated": { 26527 "Not recalculated": {
26319 "localizations": { 26528 "localizations": {
26320 "de": { 26529 "de": {
@@ -26621,6 +26830,41 @@
26621 } 26830 }
26622 } 26831 }
26623 }, 26832 },
26833 "Nothing to do here": {
26834 "comment": "Why a command is greyed in the Commands list",
26835 "localizations": {
26836 "de": {
26837 "stringUnit": {
26838 "state": "translated",
26839 "value": "Hier gibt es nichts zu tun"
26840 }
26841 },
26842 "es": {
26843 "stringUnit": {
26844 "state": "translated",
26845 "value": "Nada que hacer aquí"
26846 }
26847 },
26848 "fr": {
26849 "stringUnit": {
26850 "state": "translated",
26851 "value": "Rien à faire ici"
26852 }
26853 },
26854 "ja": {
26855 "stringUnit": {
26856 "state": "translated",
26857 "value": "ここでは何もできません"
26858 }
26859 },
26860 "pt-BR": {
26861 "stringUnit": {
26862 "state": "translated",
26863 "value": "Nada a fazer aqui"
26864 }
26865 }
26866 }
26867 },
26624 "Notifications": { 26868 "Notifications": {
26625 "localizations": { 26869 "localizations": {
26626 "de": { 26870 "de": {
@@ -28712,6 +28956,41 @@
28712 } 28956 }
28713 } 28957 }
28714 }, 28958 },
28959 "Plan": {
28960 "comment": "Key bar button: a menu of Schedule, Deadline and Tags",
28961 "localizations": {
28962 "de": {
28963 "stringUnit": {
28964 "state": "translated",
28965 "value": "Planen"
28966 }
28967 },
28968 "es": {
28969 "stringUnit": {
28970 "state": "translated",
28971 "value": "Planificar"
28972 }
28973 },
28974 "fr": {
28975 "stringUnit": {
28976 "state": "translated",
28977 "value": "Planifier"
28978 }
28979 },
28980 "ja": {
28981 "stringUnit": {
28982 "state": "translated",
28983 "value": "予定"
28984 }
28985 },
28986 "pt-BR": {
28987 "stringUnit": {
28988 "state": "translated",
28989 "value": "Planejar"
28990 }
28991 }
28992 }
28993 },
28715 "Plot": { 28994 "Plot": {
28716 "localizations": { 28995 "localizations": {
28717 "de": { 28996 "de": {
@@ -30611,6 +30890,40 @@
30611 } 30890 }
30612 } 30891 }
30613 }, 30892 },
30893 "Recent": {
30894 "localizations": {
30895 "de": {
30896 "stringUnit": {
30897 "state": "translated",
30898 "value": "Zuletzt verwendet"
30899 }
30900 },
30901 "es": {
30902 "stringUnit": {
30903 "state": "translated",
30904 "value": "Recientes"
30905 }
30906 },
30907 "fr": {
30908 "stringUnit": {
30909 "state": "translated",
30910 "value": "Récentes"
30911 }
30912 },
30913 "ja": {
30914 "stringUnit": {
30915 "state": "translated",
30916 "value": "最近使った項目"
30917 }
30918 },
30919 "pt-BR": {
30920 "stringUnit": {
30921 "state": "translated",
30922 "value": "Recentes"
30923 }
30924 }
30925 }
30926 },
30614 "Recent Entries": { 30927 "Recent Entries": {
30615 "localizations": { 30928 "localizations": {
30616 "de": { 30929 "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