Commit 15d73b1f0d

15d73b1f0d2ee9cac84fe463bbeaf4b409d8f9fb

parent: a171b8898f

Verified · cmc

cmc <hello@cleberg.net> · 2026-11-25 23:52 UTC

iOS Folders: Remove from orgstar with a confirmation; download iCloud files on tap

The red Remove Folder row is gone. Each folder's header has a menu, and a
context menu, with Remove from orgstar…, which asks first and says the
files stay where they are. Tapping a file iCloud hasn't downloaded asks for
it at once and shows a spinner until it arrives.

Ref #222

Layout: unified · split

Changed files (3)
Sources/OrgstarMobile/FoldersScreen.swift +46 −3 · view
@@ -15,17 +15,31 @@ struct FoldersScreen: View {
1515 @State private var creating: NewItem?
1616 /// The added folder whose deletion from disk is being confirmed.
1717 @State private var deletingRoot: String?
18 /// The added folder whose removal from orgstar is being confirmed.
19 @State private var removingRoot: String?
1820 @Environment(MobileModel.self) private var model
1921
2022 var body: some View {
2123 List {
2224 ForEach(workspace.rootPaths, id: \.self) { root in
23 Section((root as NSString).lastPathComponent) {
25 Section {
2426 FolderContents(workspace: workspace, root: root, folder: "", deleting: $deleting, changes: changes)
25 Button("Remove Folder", role: .destructive) { try? workspace.removeRoot(path: root) }
2627 if isEmptyFolder(root) {
2728 Button("Delete Folder…", role: .destructive) { deletingRoot = root }
2829 }
30 } header: {
31 // A header takes no swipe, so its menu holds the folder's own actions.
32 HStack {
33 Text((root as NSString).lastPathComponent)
34 Spacer()
35 Menu {
36 removeButton(root)
37 } label: {
38 Label("Folder Actions", systemImage: "ellipsis.circle").labelStyle(.iconOnly)
39 }
40 .textCase(nil)
41 }
42 .contextMenu { removeButton(root) }
2943 }
3044 }
3145 if let error = workspace.lastError {
@@ -50,6 +64,16 @@ struct FoldersScreen: View {
5064 } message: {
5165 Text("The empty folder is removed from disk and from orgstar.")
5266 }
67 .confirmationDialog("Remove “\(removingRoot.map { ($0 as NSString).lastPathComponent } ?? "")” from orgstar?",
68 isPresented: Binding { removingRoot != nil } set: { if !$0 { removingRoot = nil } }, titleVisibility: .visible) {
69 Button("Remove from orgstar", role: .destructive) {
70 guard let root = removingRoot else { return }
71 removingRoot = nil
72 try? workspace.removeRoot(path: root)
73 }
74 } message: {
75 Text("The folder and its files stay where they are. orgstar stops reading them, and the agenda leaves them out.")
76 }
5377 .navigationDestination(for: FolderRoute.self) { route in
5478 FolderPage(workspace: workspace, session: session, route: route)
5579 }
@@ -107,6 +131,10 @@ struct FoldersScreen: View {
107131 }
108132}
109133extension FoldersScreen {
134 private func removeButton(_ root: String) -> some View {
135 Button("Remove from orgstar…", systemImage: "folder.badge.minus", role: .destructive) { removingRoot = root }
136 }
137
110138 /// A daily note, opened in the reader.
111139 private func dailies(_ id: String) {
112140 guard ProAccess.shared.allows(.roam) else { return }
@@ -247,6 +275,8 @@ private struct FolderContents: View {
247275 @Binding var deleting: String?
248276 /// Changes after each deletion, which the index may not show, so empty folders are read again.
249277 let changes: Int
278 /// Files not yet downloaded that were tapped, shown with a spinner until they arrive.
279 @State private var requested: Set<String> = []
250280
251281 private var prefix: String { folder.isEmpty ? "" : folder + "/" }
252282
@@ -303,7 +333,20 @@ private struct FolderContents: View {
303333 }
304334 }
305335 ForEach(pending.filter { !$0.contains("/") }, id: \.self) { name in
306 Label(name, systemImage: "icloud.and.arrow.down").foregroundStyle(.secondary)
336 let path = root + "/" + prefix + name
337 Button {
338 // iCloud downloads these by itself in time; a tap asks for this one now.
339 try? FileManager.default.startDownloadingUbiquitousItem(at: URL(fileURLWithPath: path))
340 requested.insert(path)
341 } label: {
342 HStack {
343 Label(name, systemImage: "icloud.and.arrow.down")
344 Spacer()
345 if requested.contains(path) { ProgressView() }
346 }
347 .foregroundStyle(.secondary)
348 }
349 .accessibilityHint(requested.contains(path) ? Text("Downloading") : Text("Downloads the file from iCloud"))
307350 }
308351 }
309352}
docs/manual/guide/14-ios.org +2 −2 · view
@@ -21,11 +21,11 @@ orgstar on iOS works on folders you choose, in iCloud Drive or in another app's
21211. Open the Folders tab and tap Add Folder (the folder icon with a plus).
22222. Choose a folder in the picker.
2323
24orgstar keeps access to the folder across launches. Each folder appears as a section listing its =.org= files by their path inside the folder. Remove Folder at the end of a section removes it from orgstar; the files stay where they are. An added folder that is empty also has Delete Folder…, which deletes it from disk too.
24orgstar keeps access to the folder across launches. Each folder appears as a section listing its =.org= files by their path inside the folder. To stop using a folder, tap the ⋯ button beside its name, or touch and hold the name, and choose Remove from orgstar…; orgstar asks first. The folder and its files stay where they are. An added folder that is empty also has Delete Folder…, which deletes it from disk too.
2525
2626Swipe left on a file, or touch and hold it, to delete it. orgstar asks first. A file in iCloud Drive goes to Recently Deleted in the Files app; elsewhere it is removed. New File… and New Folder… under + at the top right make one in the folder shown, or with several added folders, in the one you pick; a file name without an extension gets =.org=. Empty folders are listed too and delete the same way; a folder with anything in it other than hidden files can't be deleted from orgstar.
2727
28Files that iCloud hasn't downloaded to the device yet appear in grey with a cloud icon. orgstar asks iCloud to download them and lists them as files once they arrive.
28Files that iCloud hasn't downloaded to the device yet appear in grey with a cloud icon. orgstar asks iCloud to download them and lists them as files once they arrive; tap one to ask for it at once, and a spinner shows until it arrives.
2929
3030orgstar sees changes made by iCloud and by apps that use the system's file coordination, and reads every folder again each time you return to the app, since not every sync app reports its changes. An open file takes in changes from disk as described in [[file:15-alongside-emacs.org][Working alongside Emacs and other tools]].
3131
l10n/Localizable.xcstrings +238 · view
@@ -12076,6 +12076,40 @@
1207612076 }
1207712077 }
1207812078 },
12079 "Downloading": {
12080 "localizations": {
12081 "de": {
12082 "stringUnit": {
12083 "state": "translated",
12084 "value": "Wird geladen"
12085 }
12086 },
12087 "es": {
12088 "stringUnit": {
12089 "state": "translated",
12090 "value": "Descargando"
12091 }
12092 },
12093 "fr": {
12094 "stringUnit": {
12095 "state": "translated",
12096 "value": "Téléchargement"
12097 }
12098 },
12099 "ja": {
12100 "stringUnit": {
12101 "state": "translated",
12102 "value": "ダウンロード中"
12103 }
12104 },
12105 "pt-BR": {
12106 "stringUnit": {
12107 "state": "translated",
12108 "value": "Baixando"
12109 }
12110 }
12111 }
12112 },
1207912113 "Downloading from iCloud": {
1208012114 "localizations": {
1208112115 "de": {
@@ -12110,6 +12144,40 @@
1211012144 }
1211112145 }
1211212146 },
12147 "Downloads the file from iCloud": {
12148 "localizations": {
12149 "de": {
12150 "stringUnit": {
12151 "state": "translated",
12152 "value": "Lädt die Datei aus iCloud"
12153 }
12154 },
12155 "es": {
12156 "stringUnit": {
12157 "state": "translated",
12158 "value": "Descarga el archivo de iCloud"
12159 }
12160 },
12161 "fr": {
12162 "stringUnit": {
12163 "state": "translated",
12164 "value": "Télécharge le fichier depuis iCloud"
12165 }
12166 },
12167 "ja": {
12168 "stringUnit": {
12169 "state": "translated",
12170 "value": "iCloudからファイルをダウンロードします"
12171 }
12172 },
12173 "pt-BR": {
12174 "stringUnit": {
12175 "state": "translated",
12176 "value": "Baixa o arquivo do iCloud"
12177 }
12178 }
12179 }
12180 },
1211312181 "Drag Element Backward": {
1211412182 "comment": "Command title",
1211512183 "localizations": {
@@ -15587,6 +15655,40 @@
1558715655 }
1558815656 }
1558915657 },
15658 "Folder Actions": {
15659 "localizations": {
15660 "de": {
15661 "stringUnit": {
15662 "state": "translated",
15663 "value": "Ordneraktionen"
15664 }
15665 },
15666 "es": {
15667 "stringUnit": {
15668 "state": "translated",
15669 "value": "Acciones de la carpeta"
15670 }
15671 },
15672 "fr": {
15673 "stringUnit": {
15674 "state": "translated",
15675 "value": "Actions du dossier"
15676 }
15677 },
15678 "ja": {
15679 "stringUnit": {
15680 "state": "translated",
15681 "value": "フォルダの操作"
15682 }
15683 },
15684 "pt-BR": {
15685 "stringUnit": {
15686 "state": "translated",
15687 "value": "Ações da Pasta"
15688 }
15689 }
15690 }
15691 },
1559015692 "Folders": {
1559115693 "localizations": {
1559215694 "de": {
@@ -29635,6 +29737,108 @@
2963529737 }
2963629738 }
2963729739 },
29740 "Remove from orgstar": {
29741 "localizations": {
29742 "de": {
29743 "stringUnit": {
29744 "state": "translated",
29745 "value": "Aus orgstar entfernen"
29746 }
29747 },
29748 "es": {
29749 "stringUnit": {
29750 "state": "translated",
29751 "value": "Quitar de orgstar"
29752 }
29753 },
29754 "fr": {
29755 "stringUnit": {
29756 "state": "translated",
29757 "value": "Retirer d'orgstar"
29758 }
29759 },
29760 "ja": {
29761 "stringUnit": {
29762 "state": "translated",
29763 "value": "orgstarから取り除く"
29764 }
29765 },
29766 "pt-BR": {
29767 "stringUnit": {
29768 "state": "translated",
29769 "value": "Remover do orgstar"
29770 }
29771 }
29772 }
29773 },
29774 "Remove from orgstar…": {
29775 "localizations": {
29776 "de": {
29777 "stringUnit": {
29778 "state": "translated",
29779 "value": "Aus orgstar entfernen …"
29780 }
29781 },
29782 "es": {
29783 "stringUnit": {
29784 "state": "translated",
29785 "value": "Quitar de orgstar…"
29786 }
29787 },
29788 "fr": {
29789 "stringUnit": {
29790 "state": "translated",
29791 "value": "Retirer d'orgstar…"
29792 }
29793 },
29794 "ja": {
29795 "stringUnit": {
29796 "state": "translated",
29797 "value": "orgstarから取り除く…"
29798 }
29799 },
29800 "pt-BR": {
29801 "stringUnit": {
29802 "state": "translated",
29803 "value": "Remover do orgstar…"
29804 }
29805 }
29806 }
29807 },
29808 "Remove “%@” from orgstar?": {
29809 "localizations": {
29810 "de": {
29811 "stringUnit": {
29812 "state": "translated",
29813 "value": "„%@“ aus orgstar entfernen?"
29814 }
29815 },
29816 "es": {
29817 "stringUnit": {
29818 "state": "translated",
29819 "value": "¿Quitar “%@” de orgstar?"
29820 }
29821 },
29822 "fr": {
29823 "stringUnit": {
29824 "state": "translated",
29825 "value": "Retirer « %@ » d’orgstar ?"
29826 }
29827 },
29828 "ja": {
29829 "stringUnit": {
29830 "state": "translated",
29831 "value": "「%@」をorgstarから取り除きますか?"
29832 }
29833 },
29834 "pt-BR": {
29835 "stringUnit": {
29836 "state": "translated",
29837 "value": "Remover “%@” do orgstar?"
29838 }
29839 }
29840 }
29841 },
2963829842 "Remove “%@” from the sidebar?": {
2963929843 "localizations": {
2964029844 "de": {
@@ -36857,6 +37061,40 @@
3685737061 }
3685837062 }
3685937063 },
37064 "The folder and its files stay where they are. orgstar stops reading them, and the agenda leaves them out.": {
37065 "localizations": {
37066 "de": {
37067 "stringUnit": {
37068 "state": "translated",
37069 "value": "Der Ordner und seine Dateien bleiben, wo sie sind. orgstar liest sie nicht mehr, und die Agenda lässt sie aus."
37070 }
37071 },
37072 "es": {
37073 "stringUnit": {
37074 "state": "translated",
37075 "value": "La carpeta y sus archivos se quedan donde están. orgstar deja de leerlos y la agenda los omite."
37076 }
37077 },
37078 "fr": {
37079 "stringUnit": {
37080 "state": "translated",
37081 "value": "Le dossier et ses fichiers restent où ils sont. orgstar cesse de les lire et l'agenda les laisse de côté."
37082 }
37083 },
37084 "ja": {
37085 "stringUnit": {
37086 "state": "translated",
37087 "value": "フォルダとそのファイルは今の場所に残ります。orgstarはそれらを読まなくなり、アジェンダにも表示されません。"
37088 }
37089 },
37090 "pt-BR": {
37091 "stringUnit": {
37092 "state": "translated",
37093 "value": "A pasta e seus arquivos ficam onde estão. O orgstar deixa de lê-los e a agenda os deixa de fora."
37094 }
37095 }
37096 }
37097 },
3686037098 "The folders the agenda shows": {
3686137099 "localizations": {
3686237100 "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