Prototype the media picker in the post editor #185
Labels
No labels
kind
bug
kind
enhancement
wayfinder
grilling
wayfinder
map
wayfinder
prototype
wayfinder
research
wayfinder
task
workflow
needs-info
workflow
needs-triage
workflow
ready-for-agent
workflow
ready-for-human
workflow
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rosa/vernier#185
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Map: #181
Blocked by: #183 (Does Media grow user-facing metadata?) — what each pickable item shows depends on what metadata exists.
Question
Prototype the media picker in the post editor. The Photo field today is a bare file input (
crates/web/src/pages.rs:895); the picker must let the author select already-uploaded Media alongside inline upload, which stays (standing decision: complement, not replace).The unclear part is the interaction: how do "upload new" and "pick existing" coexist in one form field without cluttering the common case? Modal gallery? Inline expandable grid? How does a picked Media preview, and how does Remove/Replace/Keep precedence (
photo_action,crates/web/src/handlers/posts.rs:46) extend to a picked-not-uploaded Photo?Build a throwaway UI prototype (via /prototype) to react to; the reaction settles the design. Note the picker needs the URL-resolving ownership check that is currently
pub(crate)Micropub-only (resolve_photo) — the prototype can fake it, but the spec must expose it.Prototype is up on branch
prototype/media-picker(commit822f329). It renders in place of the real new-post form, so: check out the branch,mise run serve, log in, and open:/new/post?variant=a— Inline expandable library: today's file input untouched, plus a<details>"Or pick from your library" that expands a tile grid in the form./new/post?variant=b— Compact slot + modal gallery: a preview slot with two peer buttons ("Upload from device" / "Choose from library"); the library opens as a<dialog>with a staged selection committed by "Use this photo"./new/post?variant=c— Tabbed field: "Upload new" / "From your library" as tabs; the grid scrolls in place instead of growing the form.Append
¤t=set(or use the toggle in the floating pill) to fake an already-attached photo and exercise the full remove/replace/pick/keep interaction.←/→cycle variants; the pill at the bottom shows which one you're on.Interaction model implemented, for reaction:
remove > upload > pick > keep, with upload and pick mutually exclusive — the last action wins and clears the other. A live line under the field narrates what the form would do on save.img-src 'self', which also blocksblob:, so a freshly uploaded (not yet saved) file can't be previewed client-side — variants show its filename instead. If we want live upload preview in the real build, the CSP needsblob:added toimg-src.The picked selection is display-only — submitting ignores
photo_media_id; the real handler still needsresolve_photoexposed beyond Micropub, which goes in the spec.Unrelated heads-up:
mise run servecurrently fails on this machine withtable media_rendition already exists— dev-DB migration state, happens onmaintoo; the prototype branch touches no migrations.Resolved: variant A — inline expandable library. Reaction on the running prototype picked A over B (compact slot + modal gallery) and C (tabbed field).
The settled design:
<details>expands an inline tile grid — the common case (plain upload, or no photo) looks exactly like the current editor.photo_media_idform field.remove_photocheckbox beats both, as today.img-src 'self'stays untouched — this design needs no CSP change.Carried forward into Assemble the implementation spec: expose the URL-resolving ownership check (
resolve_photo, todaypub(crate)Micropub-only) to the web editor path; the new-post and edit-post handlers acceptphoto_media_id; the picker grid shares the list-by-user domain op with the Library.Primary source: all three variants plus the switcher are preserved on branch
prototype/media-picker(commit822f329). Nothing from that branch merges — the winner gets rebuilt properly during implementation.