Commit 5d32071ad7

5d32071ad7e3ef6be752181afa0e2281bf0a2be5

parent: 0616dfef30

Verified · cmc

cmc <hello@cleberg.net> · 2026-11-22 19:40 UTC

Show the unsupported org-protocol message on iOS

An org-protocol URL other than capture or store-link shows "orgstar
handles org-protocol capture and store-link", as on the Mac. The manual
says the Mac App Store version writes in place when the folder refuses
the temporary file.

Closes #220

Layout: unified · split

Sources/OrgstarMobile/OrgstarMobileApp.swift +15 −10
@@ -350,16 +350,7 @@ struct RootView: View {
350 model.reloadConfig() 350 model.reloadConfig()
351 Task { await workspace.refresh() } 351 Task { await workspace.refresh() }
352 } 352 }
353 .onOpenURL { url in 353 .onOpenURL(perform: handle)
354 if let link = AppLink(url: url) {
355 open(link)
356 } else if let request = CaptureRequest(link: url.absoluteString) {
357 capture = request
358 } else if case .storeLink(let link, let title)? = OrgProtocol.parse(url.absoluteString) {
359 message = StoredLink.add(StoredLink(link: link, description: title), to: &model.storedLinks)
360 UIPasteboard.general.string = link
361 }
362 }
363 // The Live Activity follows the clock, wherever it starts or stops. 354 // The Live Activity follows the clock, wherever it starts or stops.
364 .task { 355 .task {
365 LiveClock.publish(model.clock) 356 LiveClock.publish(model.clock)
@@ -401,6 +392,20 @@ struct RootView: View {
401 showWaiting() 392 showWaiting()
402 } 393 }
403 394
395 /// A widget's or the Live Activity's link, or an org-protocol URL.
396 private func handle(_ url: URL) {
397 if let link = AppLink(url: url) {
398 open(link)
399 } else if let request = CaptureRequest(link: url.absoluteString) {
400 capture = request
401 } else if case .storeLink(let link, let title)? = OrgProtocol.parse(url.absoluteString) {
402 message = StoredLink.add(StoredLink(link: link, description: title), to: &model.storedLinks)
403 UIPasteboard.general.string = link
404 } else if url.scheme == "org-protocol" {
405 message = "orgstar handles org-protocol capture and store-link"
406 }
407 }
408
404 /// A widget's or the Live Activity's link. 409 /// A widget's or the Live Activity's link.
405 private func open(_ link: AppLink) { 410 private func open(_ link: AppLink) {
406 switch link { 411 switch link {
docs/manual/guide/15-alongside-emacs.org +2
@@ -31,6 +31,8 @@ Emacs and Syncthing don't use file coordination, so these checks can't lock them
31 31
32If the file keeps changing through all three attempts, the save fails with an error and your edits stay unsaved. 32If the file keeps changing through all three attempts, the save fails with an error and your edits stay unsaved.
33 33
34In the Mac App Store version, when the folder doesn't let orgstar create the temporary file, orgstar writes the file in place instead.
35
34** Automatic and explicit saving 36** Automatic and explicit saving
35 37
36With =save = "automatic"= (the default), orgstar saves a file one second after you stop typing. With ="explicit"=, only =⌘S= (Save) and =⌥⌘S= (Save All) save. See [[file:13-configuration.org][Configuration]]. The iOS app always saves automatically. 38With =save = "automatic"= (the default), orgstar saves a file one second after you stop typing. With ="explicit"=, only =⌘S= (Save) and =⌥⌘S= (Save All) save. See [[file:13-configuration.org][Configuration]]. The iOS app always saves automatically.