Commits
The media manager goes through an audit: thumbnails, real validation and usability
Full audit of the media section of the Web Base panel: webp thumbnails, real content validation, batch deletion and a more pleasant library to use. Seven new tests and v0.1.64 green.
This week I put the spotlight on the media section of the Web Base panel. It was one of those audits requested a long time ago that, once I really got into it, ended up touching almost everything: performance, validation, usability and a few errors that had been hiding for days.
Thumbnails: the most noticeable change
The problem was textbook: the gallery downloaded the original of each image, up to 2000 pixels, to render 180-pixel cards. Now a webp thumbnail of at most 480px is generated at upload time, and for historical ones it is created on demand with a public endpoint (/api/media/{id}/thumb) served with immutable cache. The migration adds the thumb_filename column.
Validating content for real
Until now, the extension was enough: any binary renamed to .jpg died with an uninformative 500. Now the real signature of the content is checked (PDF, MP4, WebM, MP3, WAV) and unreadable images are rejected with a 415 that clearly says what's going on.
Bugs that broke the flow
I've also cleared out: renaming a folder to empty, deleting a user with uploaded files (the foreign key uploaded_by now does SET NULL instead of breaking), TTL-based purging of AI image jobs and, above all, batch deletion: before it did one commit per file, now just one for the entire batch.
A library that's nicer to use
On the usability side there are search by name and alt, type filter, total library size, drag-and-drop upload with per-file progress (an error no longer aborts the queue), video and audio preview with controls, closing with Escape, copy URL with confirmation, badge for files without alt, icons by type and a selection that no longer crosses folders. And the form's accept filter now only promises what's actually accepted: before it advertised .mov and .ogg that bounced back.
Version and outstanding debt
Seven new tests, suite at 281, and v0.1.64 green. The catalog still lists 0.1.63 — 0.1.64 is waiting for its --publish-only. Documented debt remains: the media listing still doesn't paginate, the AI-generated alt is synchronous and takes minutes, and a media picker inside the editor is still missing. All noted in the task in case I have to come back to it.