Commit 15d73b1f0d
Verified · cmc
Changed files (3)
Sources/OrgstarMobile/FoldersScreen.swift +46 −3 · view
| @@ -15,17 +15,31 @@ struct FoldersScreen: View { | ||
| 15 | 15 | @State private var creating: NewItem? |
| 16 | 16 | /// The added folder whose deletion from disk is being confirmed. |
| 17 | 17 | @State private var deletingRoot: String? |
| 18 | /// The added folder whose removal from orgstar is being confirmed. | |
| 19 | @State private var removingRoot: String? | |
| 18 | 20 | @Environment(MobileModel.self) private var model |
| 19 | 21 | |
| 20 | 22 | var body: some View { |
| 21 | 23 | List { |
| 22 | 24 | ForEach(workspace.rootPaths, id: \.self) { root in |
| 23 | Section((root as NSString).lastPathComponent) { | |
| 25 | Section { | |
| 24 | 26 | FolderContents(workspace: workspace, root: root, folder: "", deleting: $deleting, changes: changes) |
| 25 | Button("Remove Folder", role: .destructive) { try? workspace.removeRoot(path: root) } | |
| 26 | 27 | if isEmptyFolder(root) { |
| 27 | 28 | Button("Delete Folder…", role: .destructive) { deletingRoot = root } |
| 28 | 29 | } |
| 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) } | |
| 29 | 43 | } |
| 30 | 44 | } |
| 31 | 45 | if let error = workspace.lastError { |
| @@ -50,6 +64,16 @@ struct FoldersScreen: View { | ||
| 50 | 64 | } message: { |
| 51 | 65 | Text("The empty folder is removed from disk and from orgstar.") |
| 52 | 66 | } |
| 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 | } | |
| 53 | 77 | .navigationDestination(for: FolderRoute.self) { route in |
| 54 | 78 | FolderPage(workspace: workspace, session: session, route: route) |
| 55 | 79 | } |
| @@ -107,6 +131,10 @@ struct FoldersScreen: View { | ||
| 107 | 131 | } |
| 108 | 132 | } |
| 109 | 133 | extension FoldersScreen { |
| 134 | private func removeButton(_ root: String) -> some View { | |
| 135 | Button("Remove from orgstar…", systemImage: "folder.badge.minus", role: .destructive) { removingRoot = root } | |
| 136 | } | |
| 137 | ||
| 110 | 138 | /// A daily note, opened in the reader. |
| 111 | 139 | private func dailies(_ id: String) { |
| 112 | 140 | guard ProAccess.shared.allows(.roam) else { return } |
| @@ -247,6 +275,8 @@ private struct FolderContents: View { | ||
| 247 | 275 | @Binding var deleting: String? |
| 248 | 276 | /// Changes after each deletion, which the index may not show, so empty folders are read again. |
| 249 | 277 | 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> = [] | |
| 250 | 280 | |
| 251 | 281 | private var prefix: String { folder.isEmpty ? "" : folder + "/" } |
| 252 | 282 | |
| @@ -303,7 +333,20 @@ private struct FolderContents: View { | ||
| 303 | 333 | } |
| 304 | 334 | } |
| 305 | 335 | 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")) | |
| 307 | 350 | } |
| 308 | 351 | } |
| 309 | 352 | } |
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 | ||
| 21 | 21 | 1. Open the Folders tab and tap Add Folder (the folder icon with a plus). |
| 22 | 22 | 2. Choose a folder in the picker. |
| 23 | 23 | |
| 24 | orgstar 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. | |
| 24 | orgstar 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. | |
| 25 | 25 | |
| 26 | 26 | Swipe 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. |
| 27 | 27 | |
| 28 | Files 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. | |
| 28 | Files 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. | |
| 29 | 29 | |
| 30 | 30 | orgstar 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]]. |
| 31 | 31 | |
l10n/Localizable.xcstrings +238 · view
| @@ -12076,6 +12076,40 @@ | ||
| 12076 | 12076 | } |
| 12077 | 12077 | } |
| 12078 | 12078 | }, |
| 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 | }, | |
| 12079 | 12113 | "Downloading from iCloud": { |
| 12080 | 12114 | "localizations": { |
| 12081 | 12115 | "de": { |
| @@ -12110,6 +12144,40 @@ | ||
| 12110 | 12144 | } |
| 12111 | 12145 | } |
| 12112 | 12146 | }, |
| 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 | }, | |
| 12113 | 12181 | "Drag Element Backward": { |
| 12114 | 12182 | "comment": "Command title", |
| 12115 | 12183 | "localizations": { |
| @@ -15587,6 +15655,40 @@ | ||
| 15587 | 15655 | } |
| 15588 | 15656 | } |
| 15589 | 15657 | }, |
| 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 | }, | |
| 15590 | 15692 | "Folders": { |
| 15591 | 15693 | "localizations": { |
| 15592 | 15694 | "de": { |
| @@ -29635,6 +29737,108 @@ | ||
| 29635 | 29737 | } |
| 29636 | 29738 | } |
| 29637 | 29739 | }, |
| 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 | }, | |
| 29638 | 29842 | "Remove “%@” from the sidebar?": { |
| 29639 | 29843 | "localizations": { |
| 29640 | 29844 | "de": { |
| @@ -36857,6 +37061,40 @@ | ||
| 36857 | 37061 | } |
| 36858 | 37062 | } |
| 36859 | 37063 | }, |
| 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 | }, | |
| 36860 | 37098 | "The folders the agenda shows": { |
| 36861 | 37099 | "localizations": { |
| 36862 | 37100 | "de": { |