Handoff, Working Copy sync, Share Subtree !490

merged merged by cmc on 2026-11-26 09:35 UTC · krz/orgstar:m5-batch2 into main

Discussion

cmc 2026-11-26 09:34 UTC

Three commits, one per issue.

#93 Handoff

  • The editor advertises sh.krz.orgstar.editing (NSUserActivityTypes in the iOS, Mac App Store and Developer ID Info.plists) with the folder's name, the file's iCloud path when it is in iCloud, its path in the folder, and the caret's heading ID, outline path and line. No file text; nothing for .org.gpg.
  • Folder matching: iCloud path first (same on every device, so it also works for a root higher up in iCloud Drive and for two folders with the same name), else the folder's name (Dropbox, Syncthing, Working Copy and local folders are at device-specific paths).
  • The receiver opens the file in the editor at the heading (ID, then outline path, same line within it) or the line, or says it has no such folder or file.
  • Encryption (#153) isn't on main: the hook is DocumentSession.handoffPlace, which should also return nil when crypt.isPrivate is true once that merges.

#148 Working Copy (iOS)

  • Sync with Working Copy (folder menu, Commands) saves all files, then opens working-copy://x-callback-url/chain (commit with limit 999, pull, push) and handles orgstar://working-copy/success|error with Working Copy's errorMessage.
  • Settings ▸ Working Copy: URL key in the Keychain (this device only), per folder on/off, repository name, sync when orgstar opens (off by default). A folder with .git at its top also gets Working Copy… in its menu; Working Copy's File Provider may hide .git, so any folder can be set up from Settings.
  • Sync on leaving the app is not implemented: iOS refuses to open another app from the background. The manual documents a Shortcuts automation (orgstar Is Closed) instead.

#158 Share Subtree…

  • ExportScope.entry: the file's keyword lines (without TITLE, SUBTITLE, EXPORT_FILE_NAME) plus the subtree as in the file, promoted to level 1. Shared as <heading>.org, or as text; Include attachments adds the files of the attachment folders of the entry and its children as separate items.
  • Mac: File ▸ Share Subtree… sheet with NSSharingServicePicker. iOS: Commands ▸ Share Subtree… with ShareLinks.
  • Encrypted entries are shared as the buffer holds them, which on main is the file. Hook for #153: DocumentSession.subtreeShare should seal decrypted tagged entries.

Tests: HandoffTests, WorkingCopyTests, SubtreeShareTests. swift test and both Xcode builds pass.

Needs a device: Handoff between real devices (Mac to iPhone, iPhone to Mac, iPad to Mac); Working Copy installed with a real repository (key, chain, callbacks, commit with nothing changed, push feature); Share Subtree through AirDrop/Mail.

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