Skip to content

Folder-upload desktop refresh + inline upload previews - #400

Merged
epeicher merged 3 commits into
trunkfrom
deskmod-45-real-file-storage
Jul 24, 2026
Merged

Folder-upload desktop refresh + inline upload previews#400
epeicher merged 3 commits into
trunkfrom
deskmod-45-real-file-storage

Conversation

@epeicher

@epeicher epeicher commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

What it does

Two follow-up fixes on the real-file-storage feature that landed in #381:

  • Folder-tree uploads repaint the desktop immediately. Tree uploads create folder rows + placements server-side, but each per-file response only carries that file's own placement, so the new folder tile stayed invisible until the next heartbeat tick. After a tree batch the dialog now re-pulls the canonical folder list and target container into the shared store (the share-accept resync pattern). Flat uploads keep the direct ingest and skip the extra round-trips.
  • Inline previews in the folder preview pane. Selecting an upload renders images/video/audio inline via the authenticated download URL (subresource loads ignore the attachment disposition, so no direct file URL is exposed), with a mime · size meta line and a Download action. Undecodable formats (HEIC on Chromium) degrade to a no-preview note. Other types show the note; plugins preview additional types (PDF via PDF.js, …) through the pre-existing desktop-mode.files.preview filter — documented with a worked example in docs/examples/desktop-file-storage.md.

Uploading folders refresh automatically now

CleanShot.2026-07-23.at.16.52.45.mp4

New preview functionality for valid Media files

CleanShot 2026-07-23 at 16 58 59@2x

Testing instructions

npm run test:js                          # 2173 tests; new: os-file-drop-tree-refresh, desktop-files-upload-preview
npm run lint && npm run typecheck && npm run build

No PHP changes. Manual pass: drag a nested folder onto the desk and confirm the folder tile appears the moment the batch finishes (no F5, no heartbeat wait); select an image/video/audio upload in a folder window and confirm it renders in the preview pane with a working Download button; select a PDF and confirm the no-preview note.

Open WordPress Playground Preview

epeicher added 2 commits July 23, 2026 17:03
Tree uploads create folder rows and placements server-side (mkdir-p
from relativePath / emptyDirs), but each per-file response only
carries that file's own placement — the new folder tile stayed
invisible until the next heartbeat tick. After a tree batch the
dialog now re-pulls the canonical folder list and the target
container's placements into the shared store (the same pattern the
share-accept flow uses). Flat uploads keep the direct
returned-placement ingest and skip the extra round-trips.
Selecting a stored upload now previews it on the right: images,
video, and audio render inline via the authenticated download URL
(subresource loads ignore the attachment disposition, so no direct
file URL is ever exposed). Undecodable formats (HEIC on Chromium)
degrade to a friendly no-preview note, as do non-media kinds, and
every upload preview carries a Download action plus a mime + size
meta line.

Extensibility rides the pre-existing desktop-mode.files.preview
filter: a plugin that recognizes a type (PDF via PDF.js, say)
returns its own element and fully replaces the built-in. Documented
with a PDF example and covered by tests including the filter seam.
@epeicher
epeicher force-pushed the deskmod-45-real-file-storage branch from 7833533 to a5ebe64 Compare July 23, 2026 15:04
@epeicher epeicher changed the title Re-land real file/folder storage on the desktop (DESKMOD-45), with follow-ups Folder-upload desktop refresh + inline upload previews (DESKMOD-45 follow-ups) Jul 23, 2026
@epeicher epeicher changed the title Folder-upload desktop refresh + inline upload previews (DESKMOD-45 follow-ups) Folder-upload desktop refresh + inline upload previews Jul 23, 2026
@epeicher epeicher self-assigned this Jul 23, 2026

@AllTerrainDeveloper AllTerrainDeveloper left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing!

@epeicher
epeicher merged commit bdfb9b0 into trunk Jul 24, 2026
5 checks passed
@epeicher
epeicher deleted the deskmod-45-real-file-storage branch July 24, 2026 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants