Commit 7119821e13

7119821e1398fbe6bc6b8362f2b2f6df5d8001ab

parent: 3bbfa4afd1

Verified · cmc

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

iOS Folders: errors say what failed

Adding, creating and deleting files and folders set an error title
(Couldn't Add Folder, Couldn't Create File, Couldn't Delete Folder and the
like), which the folder list shows as the error's first line.

Ref #222

Layout: unified · split

Changed files (2)
Sources/OrgstarMobile/FoldersScreen.swift +10 −5 · view
@@ -43,7 +43,8 @@ struct FoldersScreen: View {
4343 }
4444 }
4545 if let error = workspace.lastError {
46 Text(error).foregroundStyle(.red)
46 // The title says what failed.
47 Text(workspace.lastErrorTitle.map { "\($0)\n\(error)" } ?? error).foregroundStyle(.red)
4748 }
4849 }
4950 .navigationTitle("Folders")
@@ -57,7 +58,7 @@ struct FoldersScreen: View {
5758 try await workspace.trash(root)
5859 try workspace.removeRoot(path: root)
5960 } catch {
60 workspace.lastError = "Can't delete \((root as NSString).lastPathComponent): \(error.localizedDescription)"
61 workspace.showError(String(localized: "Couldn't Delete Folder", comment: "Error alert title"), error.localizedDescription)
6162 }
6263 }
6364 }
@@ -124,7 +125,7 @@ struct FoldersScreen: View {
124125 do {
125126 try await workspace.addRoot(url)
126127 } catch {
127 workspace.lastError = "Can't add \(url.lastPathComponent): \(error.localizedDescription)"
128 workspace.showError(String(localized: "Couldn't Add Folder", comment: "Error alert title"), error.localizedDescription)
128129 }
129130 }
130131 }
@@ -198,7 +199,8 @@ private struct NewItemAlert: ViewModifier {
198199 if item.isFolder { try Self.makeFolder(typed, in: item.folder) } else { _ = try await workspace.createFile(named: typed, in: item.folder) }
199200 created()
200201 } catch {
201 workspace.lastError = error.localizedDescription
202 workspace.showError(item.isFolder ? String(localized: "Couldn't Create Folder", comment: "Error alert title")
203 : String(localized: "Couldn't Create File", comment: "Error alert title"), error.localizedDescription)
202204 }
203205 }
204206 }
@@ -236,7 +238,10 @@ private extension View {
236238 deleting.wrappedValue = nil
237239 session.kill(path)
238240 Task {
239 do { try await workspace.trash(path) } catch { workspace.lastError = "Can't delete \(name): \(error.localizedDescription)" }
241 do { try await workspace.trash(path) } catch {
242 workspace.showError(folder ? String(localized: "Couldn't Delete Folder", comment: "Error alert title")
243 : String(localized: "Couldn't Delete File", comment: "Error alert title"), error.localizedDescription)
244 }
240245 deleted()
241246 }
242247 }
l10n/Localizable.xcstrings +140 · view
@@ -9792,6 +9792,146 @@
97929792 }
97939793 }
97949794 },
9795 "Couldn't Create File": {
9796 "comment": "Error alert title",
9797 "localizations": {
9798 "de": {
9799 "stringUnit": {
9800 "state": "translated",
9801 "value": "Datei konnte nicht erstellt werden"
9802 }
9803 },
9804 "es": {
9805 "stringUnit": {
9806 "state": "translated",
9807 "value": "No se ha podido crear el archivo"
9808 }
9809 },
9810 "fr": {
9811 "stringUnit": {
9812 "state": "translated",
9813 "value": "Impossible de créer le fichier"
9814 }
9815 },
9816 "ja": {
9817 "stringUnit": {
9818 "state": "translated",
9819 "value": "ファイルを作成できませんでした"
9820 }
9821 },
9822 "pt-BR": {
9823 "stringUnit": {
9824 "state": "translated",
9825 "value": "Não Foi Possível Criar o Arquivo"
9826 }
9827 }
9828 }
9829 },
9830 "Couldn't Create Folder": {
9831 "comment": "Error alert title",
9832 "localizations": {
9833 "de": {
9834 "stringUnit": {
9835 "state": "translated",
9836 "value": "Ordner konnte nicht erstellt werden"
9837 }
9838 },
9839 "es": {
9840 "stringUnit": {
9841 "state": "translated",
9842 "value": "No se ha podido crear la carpeta"
9843 }
9844 },
9845 "fr": {
9846 "stringUnit": {
9847 "state": "translated",
9848 "value": "Impossible de créer le dossier"
9849 }
9850 },
9851 "ja": {
9852 "stringUnit": {
9853 "state": "translated",
9854 "value": "フォルダを作成できませんでした"
9855 }
9856 },
9857 "pt-BR": {
9858 "stringUnit": {
9859 "state": "translated",
9860 "value": "Não Foi Possível Criar a Pasta"
9861 }
9862 }
9863 }
9864 },
9865 "Couldn't Delete File": {
9866 "comment": "Error alert title",
9867 "localizations": {
9868 "de": {
9869 "stringUnit": {
9870 "state": "translated",
9871 "value": "Datei konnte nicht gelöscht werden"
9872 }
9873 },
9874 "es": {
9875 "stringUnit": {
9876 "state": "translated",
9877 "value": "No se ha podido eliminar el archivo"
9878 }
9879 },
9880 "fr": {
9881 "stringUnit": {
9882 "state": "translated",
9883 "value": "Impossible de supprimer le fichier"
9884 }
9885 },
9886 "ja": {
9887 "stringUnit": {
9888 "state": "translated",
9889 "value": "ファイルを削除できませんでした"
9890 }
9891 },
9892 "pt-BR": {
9893 "stringUnit": {
9894 "state": "translated",
9895 "value": "Não Foi Possível Apagar o Arquivo"
9896 }
9897 }
9898 }
9899 },
9900 "Couldn't Delete Folder": {
9901 "comment": "Error alert title",
9902 "localizations": {
9903 "de": {
9904 "stringUnit": {
9905 "state": "translated",
9906 "value": "Ordner konnte nicht gelöscht werden"
9907 }
9908 },
9909 "es": {
9910 "stringUnit": {
9911 "state": "translated",
9912 "value": "No se ha podido eliminar la carpeta"
9913 }
9914 },
9915 "fr": {
9916 "stringUnit": {
9917 "state": "translated",
9918 "value": "Impossible de supprimer le dossier"
9919 }
9920 },
9921 "ja": {
9922 "stringUnit": {
9923 "state": "translated",
9924 "value": "フォルダを削除できませんでした"
9925 }
9926 },
9927 "pt-BR": {
9928 "stringUnit": {
9929 "state": "translated",
9930 "value": "Não Foi Possível Apagar a Pasta"
9931 }
9932 }
9933 }
9934 },
97959935 "Couldn't Find Folder": {
97969936 "comment": "Error alert title",
97979937 "localizations": {
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