Keep uploaded images in folders by what they're for
logos/ for logo and icon fields, thumbnails/ for previews the site saves (link previews, Drive first pages), images/ for everything else; each small copy beside its image. Images from before folders are sorted once at boot by their uses, and every record naming them is rewritten in one transaction after the files move. The Media page and image pickers get a tab per folder; a picker opens on its field's folder and uploads there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
4b249c9e52
commit
9854da965e
14 changed files with 283 additions and 51 deletions
|
|
@ -69,7 +69,9 @@
|
|||
`widget: "image"` is a text box with a preview and upload and
|
||||
library buttons beside it (ImageInput in MediaLibrary.tsx). Its
|
||||
`resolve` option is the media.ts helper for the field's public/
|
||||
directory, so a bare filename previews from the right place.
|
||||
directory, so a bare filename previews from the right place. Its
|
||||
`folder` ("logos" for logo and icon fields) is where uploads go and
|
||||
the tab the library opens on.
|
||||
|
||||
Two options change the box itself rather than what goes in it:
|
||||
|
||||
|
|
@ -347,6 +349,7 @@ export function Field({ field, value, row, options, error, onChange, onPatch }:
|
|||
id={id}
|
||||
value={value}
|
||||
resolve={field.resolve}
|
||||
folder={field.folder}
|
||||
locked={locked}
|
||||
className={locked ? inputLocked : common.className}
|
||||
onChange={onChange}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue