Media captures its upload filename as a display label #189

Closed
opened 2026-08-12 05:57:17 +00:00 by rosa · 0 comments
Owner

Parent

Implementation spec: Media management: Library page and editor picker — implementation spec (§1.1).

What to build

When a user uploads an image — through the post editor or the Micropub media endpoint — the Media remembers the filename it was uploaded under, as an opaque, read-only display label. Nothing renders it yet; the Library and picker tickets consume it. A Media uploaded without a filename simply has none, and everything uploaded before this ticket stays that way.

Acceptance criteria

  • A MediaFilename value type parses the client-supplied filename: basename only (clients may send paths), trimmed, blank or whitespace treated as absence, capped at 255 chars by truncating on a char boundary — over-long input is never rejected, since a cosmetic label must not fail an upload.
  • Media carries an optional filename, threaded through creation from both upload adapters (the web editor's multipart photo part and the Micropub media endpoint's file part). A part with no client filename stores absence.
  • A migration adds the nullable column; every pre-existing row stays absent.
  • Conformance tests exercise the new field against both the SQLite and in-memory repository implementations (no mock-only tests).
  • mise run format, mise run ci, and mise run clippy pass.

Blocked by

None — can start immediately.

## Parent Implementation spec: [Media management: Library page and editor picker — implementation spec](https://code.cosmicrose.dev/rosa/vernier/issues/188) (§1.1). ## What to build When a user uploads an image — through the post editor or the Micropub media endpoint — the Media remembers the filename it was uploaded under, as an opaque, read-only display label. Nothing renders it yet; the Library and picker tickets consume it. A Media uploaded without a filename simply has none, and everything uploaded before this ticket stays that way. ## Acceptance criteria - [ ] A `MediaFilename` value type parses the client-supplied filename: basename only (clients may send paths), trimmed, blank or whitespace treated as absence, capped at 255 chars by truncating on a char boundary — over-long input is never rejected, since a cosmetic label must not fail an upload. - [ ] Media carries an optional filename, threaded through creation from both upload adapters (the web editor's multipart photo part and the Micropub media endpoint's file part). A part with no client filename stores absence. - [ ] A migration adds the nullable column; every pre-existing row stays absent. - [ ] Conformance tests exercise the new field against both the SQLite and in-memory repository implementations (no mock-only tests). - [ ] `mise run format`, `mise run ci`, and `mise run clippy` pass. ## Blocked by None — can start immediately.
rosa closed this issue 2026-08-12 17:59:05 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rosa/vernier#189
No description provided.