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 {
350350 model.reloadConfig()
351351 Task { await workspace.refresh() }
352352 }
353 .onOpenURL { url in
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 }
353 .onOpenURL(perform: handle)
363354 // The Live Activity follows the clock, wherever it starts or stops.
364355 .task {
365356 LiveClock.publish(model.clock)
@@ -401,6 +392,20 @@ struct RootView: View {
401392 showWaiting()
402393 }
403394
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
404409 /// A widget's or the Live Activity's link.
405410 private func open(_ link: AppLink) {
406411 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
3131
3232If the file keeps changing through all three attempts, the save fails with an error and your edits stay unsaved.
3333
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
3436** Automatic and explicit saving
3537
3638With =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.