feat(post-form): live photo editor on entry edit (media API + SortableJS)
Replace the FilePond photo path in edit mode with our own thumbnail grid that talks straight to the media API (the gpx-manager pattern). Add/delete/reorder each persist immediately, decoupled from the form's text-field Save: - Add: HEIC->JPEG client-side, stock POST .../media per file, then ONE reorder after the batch (renumber photo-01..NN). On a failed reorder: auto-retry (idempotent), else roll the just-uploaded files back so no orphan stock-named image breaks cover=first. Upload progress shown per file. - Delete: inline 'Delete? [Confirm] [Cancel]' (Confirm disabled in flight), stock DELETE, then renumber the survivors. - Reorder: SortableJS drag -> POST /entry/<slug>/photos/order. On failure the move reverts to last-known-good; the shown grid never disagrees with disk without an inline error. - Loading + empty states; first cell badged Cover; photo-NN URLs cache-busted since reorder reuses them for different bytes. FilePond is fully decommissioned in edit mode (initPhotoConversion early-returns under EDIT_MODE): no stale photo_order manifest is posted on text Save, so cache-on-save can't delete a live-added photo. Create-mode FilePond is untouched. Adds sortablejs (bundled into js/post via the post-form entry). SVG excluded in the file-input accept; the server-side SVG block is a documented fast-follow. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user