Skip to content

Commit 1b2a311

Browse files
authored
Disk-mounted folders on desktop and improved folder management (#7502)
Description of Changes Adds folder kinds so the file manager can work with real directories on disk. Desktop - New folder is now a menu with two options: "Add local folder" and "New folder on the server". - Add local folder opens the native picker and mounts a directory. Files are listed straight from disk, nothing is copied in. - Subfolders show inside a mount and open like any folder. New folder inside a mount creates a real directory on disk. - Moving, dropping or uploading files into a mount writes them to the directory. The app copy is only removed after the write succeeds. Name clashes get a " (2)" suffix. - Mounted files get thumbnails. - Adding the same directory twice just returns the existing mount. - Removing a mount never touches the disk. - The server option is disabled in local mode with a sign in message. Web + desktop - Uploading or dropping files while inside a folder puts them in that folder instead of Local. - Files can be dragged onto folders in the grid and the tree to move them. - Folders show an origin badge (cloud or local). - The Local view now means files that are not in any folder. Follow ups for a future pr - Mount listing cap: large directories currently show the 500 most recent files with no notice. Will be removed as part of the virtualisation/performance PR. - Folders within folders need to be supported - Symlinks in mounts: currently not listed. Behaviour to be decided alongside the wider folder work.
1 parent 3056e5f commit 1b2a311

37 files changed

Lines changed: 2596 additions & 170 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,3 +312,4 @@ docs/type3/signatures/
312312

313313
# Local screenshot artifacts from *-screenshots.spec.ts
314314
frontend/editor/screenshots/
315+
frontend/editor/src-tauri/libs/.variant

frontend/editor/public/locales/en-US/translation.toml

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4321,7 +4321,8 @@ download = "Download"
43214321
downloadAll = "Download all"
43224322
downloadVersion = "Download this version"
43234323
dropOverlay = "Drop files to upload"
4324-
dropOverlaySub = "Files start in Local. Use 'Move to' or 'Save to cloud' to organize them into a folder."
4324+
dropOverlaySub = "Files land in Local. Organize them into folders any time."
4325+
dropOverlaySubFolder = "They'll be added to this folder."
43254326
duplicate = "Duplicate"
43264327
file = "File"
43274328
fileInfo = "File info"
@@ -4334,19 +4335,27 @@ inPath = "in {{path}}"
43344335
inWorkspace = "Open"
43354336
inWorkspaceAria = "Already in workspace"
43364337
loading = "Loading…"
4337-
localFoldersUnavailable = "Folders are cloud-only - save a file to the cloud to organize it."
4338+
localFolderManagedByDisk = "This folder is managed by its directory on disk."
4339+
moveAcrossKindsBlocked = "These folders live in different places, so one can't go inside the other."
4340+
moveIntoMountCloudSkipped_one = "{{count}} server file stayed in your files. It lives on the server, not on this disk."
4341+
moveIntoMountCloudSkipped_other = "{{count}} server files stayed in your files. They live on the server, not on this disk."
4342+
moveIntoMountFailed_one = "{{count}} file could not be written into the folder."
4343+
moveIntoMountFailed_other = "{{count}} files could not be written into the folder."
4344+
moveIntoVirtualCloudSkipped_one = "{{count}} server file was left in place. Server files can't live in browser-only folders."
4345+
moveIntoVirtualCloudSkipped_other = "{{count}} server files were left in place. Server files can't live in browser-only folders."
43384346
moveSkippedRemote_one = "{{count}} file couldn't be moved on the server (no permission or already deleted)."
43394347
moveSkippedRemote_other = "{{count}} files couldn't be moved on the server (no permission or already deleted)."
43404348
moveTo = "Move to…"
43414349
newFolder = "New folder"
4342-
newFolderStorageDisabled = "Server folder storage isn't enabled. Ask your admin to turn it on."
4350+
newFolderStorageDisabled = "Server folder storage isn't enabled."
43434351
newFolderTabUnavailable = "Switch to All or Cloud to create folders."
43444352
offlineNoFolderEdits = "Server folder sync unavailable - folder changes are disabled. Check sign-in and storage configuration."
43454353
open = "Open"
43464354
openVersionInWorkspace = "Open in workspace"
43474355
originFilter = "Filter by source"
43484356
refresh = "Refresh from server"
43494357
remove = "Delete"
4358+
removeLocalFolder = "Remove (files stay on disk)"
43504359
removeVersion = "Remove this version"
43514360
rename = "Rename"
43524361
renamed = "Renamed"
@@ -4359,6 +4368,7 @@ selectAll = "Select all"
43594368
selectAllHint = "Click to select all. Tip: hold Ctrl (or Cmd) to add files one at a time, Shift to select a range."
43604369
selectedCount = "{{count}} selected"
43614370
selectFile = "Select file {{name}}"
4371+
serverFolderNeedsConnection = "Sign in to Stirling Cloud or connect a self-hosted server to use server folders."
43624372
shareDisabledHint = "File sharing isn't enabled on this server. Ask your admin to enable it."
43634373
shareManage = "Manage sharing"
43644374
showDetails = "Show details"
@@ -4367,7 +4377,6 @@ summary_one = "{{count}} item"
43674377
summary_other = "{{count}} items"
43684378
tree = "Folders"
43694379
upload = "Upload"
4370-
uploadedToLocal = "Uploaded files start in Local. Use 'Save to cloud' to put them in a folder."
43714380
uploadFromMobile = "Upload from Mobile"
43724381
versionActions = "Version actions"
43734382
versionCollapse = "Collapse middle versions"
@@ -4433,6 +4442,8 @@ title = "You haven't shared any files yet"
44334442
[filesPage.error]
44344443
actionFailed = "Could not {{action}}."
44354444
actionFailedDetail = "Could not {{action}}: {{message}}"
4445+
addFolderFailed = "Could not add the folder."
4446+
addFolderFailedDetail = "Could not add the folder: {{message}}"
44364447
cloudDeleteFailed_one = "Couldn't delete 1 file from the cloud."
44374448
cloudDeleteFailed_other = "Couldn't delete {{count}} files from the cloud."
44384449
deleteFolderFailed = "Could not delete folder."
@@ -4445,8 +4456,14 @@ moveFilesFailed = "Could not move files."
44454456
moveFilesFailedDetail = "Could not move files: {{message}}"
44464457
moveFolderFailed = "Could not move folder."
44474458
moveFolderFailedDetail = "Could not move folder: {{message}}"
4459+
openDiskFileFailed = "Could not open {{name}}."
4460+
openDiskFileFailedDetail = "Could not open {{name}}: {{message}}"
4461+
readFolderFailed = "Could not read the folder."
4462+
readFolderFailedDetail = "Could not read the folder: {{message}}"
44484463
removeFilesFailed = "Could not remove files."
44494464
removeFilesFailedDetail = "Could not remove files: {{message}}"
4465+
removeFolderFailed = "Could not remove folder."
4466+
removeFolderFailedDetail = "Could not remove folder: {{message}}"
44504467
uploadFilesFailed = "Could not upload files."
44514468
uploadFilesFailedDetail = "Could not upload files: {{message}}"
44524469

@@ -4466,12 +4483,21 @@ activeCount = "{{count}} filters active"
44664483
clearAll = "Clear filters"
44674484
label = "Filters"
44684485

4486+
[filesPage.folderKind]
4487+
local = "Local folder"
4488+
virtual = "Browser folder"
4489+
44694490
[filesPage.folderName]
44704491
cancel = "Cancel"
44714492
error = "Could not save folder. Try again."
44724493
label = "Folder name"
44734494
placeholder = "Folder name"
44744495

4496+
[filesPage.folderOrigin]
4497+
diskHint = "A folder mounted from a directory on your disk"
4498+
serverHint = "A folder stored on the Stirling server"
4499+
virtualHint = "A folder that lives only in this browser"
4500+
44754501
[filesPage.moveDialog]
44764502
cancel = "Cancel"
44774503
confirm = "Move here"
@@ -4485,10 +4511,16 @@ newFolderPlaceholder = "Folder name"
44854511
newFolderToggle = "Create new folder…"
44864512
title = "Move to folder"
44874513

4514+
[filesPage.newFolderMenu]
4515+
addExisting = "Add local folder"
4516+
server = "New folder on the server"
4517+
serverHint = "Synced to your account, available wherever you sign in."
4518+
44884519
[filesPage.origin]
44894520
all = "All sources"
44904521
cloud = "Cloud"
44914522
cloudHint = "Stored on the Stirling server"
4523+
diskHint = "A file in the mounted folder on your disk"
44924524
local = "Local"
44934525
localHint = "Only stored in this browser"
44944526
shared = "Shared"

frontend/editor/src-tauri/capabilities/default.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@
3939
"identifier": "fs:allow-read-file",
4040
"allow": [{ "path": "**" }]
4141
},
42+
{
43+
"identifier": "fs:allow-read-dir",
44+
"allow": [{ "path": "**" }]
45+
},
46+
{
47+
"identifier": "fs:allow-stat",
48+
"allow": [{ "path": "**" }]
49+
},
50+
{
51+
"identifier": "fs:allow-mkdir",
52+
"allow": [{ "path": "**" }]
53+
},
4254
{
4355
"identifier": "fs:allow-write-file",
4456
"allow": [{ "path": "**" }]

0 commit comments

Comments
 (0)