Data UI Backlog

File-aware image widgets (B)

Motivation: :image / :image-list render every file as an <img> — a PDF or any non-image shows the browser broken-image icon in the grid and the lightbox center, even though the lightbox Download / Open-in-new-tab anchors work for any file. Any app holding mixed content (Model Bank: READMEs beside screenshots) hits this.

The change, frontend-only (web/src/App.tsx): extension sniff off the stored path — the browser-renderable set (png jpg jpeg gif webp avif svg bmp ico) vs everything else. ThumbnailGrid renders non-image paths as a file tile (same box, extension badge, filename) instead of a broken <img>, and gains the onError fallback it is missing today (ImagePreview has one; the grid does not). ImageModal renders non-image paths as a file card — icon, filename, prominent Download — keeping the toolbar anchors, Prev/Next, Esc, and the caption strip. :image (single) rides along: ImagePreview shares ImageModal.

No backend, no wire change, no vocabulary change — the whole thing stays inside the widget render path and benefits every app with mixed content.

Slot
7179
Status
10 Open
Tags
mvp, frontend, blog
Contributors
Donnie, Rose