PhoenixKit 2.9.0: Discussions on media annotations, and file types repaired
PhoenixKit 2.9.0 turns shapes drawn on images in the media viewer into discussions, and repairs files that were stored with the wrong type, such as videos treated as images or audio served as an unknown download.
Discussions on annotations
Drawing a shape on the media viewer’s canvas no longer opens a comment box: the shape is saved straight away, and its label is typed in place. Hovering a shape shows three buttons. Reply starts a thread under the shape and opens a small reply box. Edit label opens the label editor again. View discussion scrolls the sidebar to the shape’s thread. Each shape shows how many comments it has, and the count updates as comments come and go.
Several bugs around this are fixed. A label typed into a shape was lost on reload. Saving a label crashed the page. Deleting a comment in the sidebar closed the whole media window. Connector anchors, which point at nothing on a single image, are now always off in the media viewer. Videos fill the lightbox instead of showing as a small box, and the audio player is centred.
File types that match the file
An upload could be stored with a type that contradicted the file, for example a .mov stored as an image, which broke thumbnails, type filters and image processing for it. PhoenixKit now checks the claimed type against the file’s MIME type and name when it stores a file, and corrects it. Uploads in the admin pass the type the browser reported, instead of guessing from the extension.
Audio files guessed from their extension, such as .mp3, .m4a and .wav, were stored and served as application/octet-stream. They now get their audio type.
Migration V174 repairs files already stored wrongly: audio files with a blank or generic type get their audio type, and generic file types that contradict the MIME type are corrected. Files without enough evidence are left alone. Until it runs, the admin already shows such files by their corrected type.
Upgrading
Run mix phoenix_kit.update for migration V174. It cannot be rolled back, since nothing records the old values; rolling back leaves the repaired rows as they are. The annotation tools need the Etcher 0.13 script, which this release loads.
Full release notes: PhoenixKit 2.9.0
2.9.0 · 17 August 2026
Media file-type integrity gets defended at the write boundary and repaired for rows already corrupted, and the media viewer’s shape annotations grow a real discussion flow (#721).
Added
- Annotation discussions. Drawing a shape on the media viewer’s canvas
no longer opens a composer — every kind saves silently, with labels typed
through Etcher’s inline editor. The tooltip gets three header buttons
(Etcher 0.13’s
tooltipActions): Reply lazily creates the shape’s master comment (content = label, author = shape creator, backdated to the shape’s creation) and opens a body-only popup that threads under it; Edit reopens Etcher’s inline label editor; View scrolls the sidebar to the shape’s thread. Shapes show a live comment-count badge that refreshes on create/delete via the existing comments PubSub relay. Storage.store_file_in_buckets/7:mime_typeopt. Callers can now pass the browser-observed mime (client_type/content_type) so it’s stored verbatim instead of guessed from the extension; all core upload call sites (UploadController,MediaBrowser,MediaSelectorModal,MediaSelector) now pass it.Storage.display_file_type/1. Reconciles a stored row’sfile_typeagainst its own mime/filename evidence for display, so a row misclassified before this release (e.g. a.movstored as"image") renders correctly without needing the repair migration to have run.- V174 migration — repairs media rows corrupted by two now-fixed writer
defects: blank/octet-stream mimes with a known audio extension get the
real audio mime (files and file instances), and generic
file_typevalues contradicted by the mime are reclassified. System types ("tile") and rows without evidence are left untouched; the migration is idempotent and itsdown/1is deliberately a no-op (there’s no record of the pre-repair values to restore).
Fixed
- Upload paths could poison
file_typefor every downstream surface. The storage write boundary now cross-checks a caller’s claimedfile_typeagainst the mime/filename evidence and corrects a contradicted generic claim, so one careless call site (e.g. an external module hardcoding"image") can no longer break the thumbnail grid, type filters, and variant processing for every file it uploads. determine_mime_type/1had no audio entries. Every.mp3/.m4a/.wavguessed from an extension landed asapplication/octet-streamand was served that way. Now routed throughMIME.type/1with an audio fallback map for the extensions it still answers octet-stream for.- Etcher label text silently vanished on reload.
annotation_unchanged?compared geometry/style/kind only, so a label typed into Etcher’s inline editor (the only way text/callout/dimension shapes collect text since Etcher 0.12) changed nothing the comparison looked at and the write was skipped. - Committing a shape label crashed the LiveView. The sync path read a
curated map (as
load_annotations_for/1produces it) as if it were theAnnotationschema struct. - Deleting a sidebar comment killed the whole LiveView, which read as
“the page refreshed and the media modal closed” — the
Embedmacro now handles the{:comments_updated, ...}message the comments component reports to the host process. - The media viewer’s connector anchors are now hard-disabled (
connectors={:off}) instead of following a shared saved preference that could follow a user in from boards, where the anchors point at nothing. - Lightbox video/audio sizing. Video fills the column via
object-containinstead of floating as a tiny box at its intrinsic size; the audio player is centered with a max width instead of stretching full width. default.potextraction drift + missing translations. The composer’s copy change (“Reply to this annotation”) had never been extracted; re-extracted and translated into de/es/et/fr/it/pl/ru.
Dependencies
- etcher 0.13.0 (was 0.12.1) — adds
tooltipActionsand the hardconnectors={:off}layer option.
PhoenixKit 2.9.0. Install or update: {:phoenix_kit, "~> 2.9"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.