Since #925, non-media uploads (PDF, text, markdown, CSV, JSON, zip, tgz) are accepted, but the surfaces that present them still assume images and video.
Today
- Managed comment (
packages/comment-render/src/index.ts): a non-image item renders as a bare list link, - [report.pdf](…) · /path · after. No kind, no size, no download affordance. Overflow uses the same shape inside <details>.
- Public file page
/f/… (MediaStage.astro): kind file shows the generic "Preview unavailable" fallback with an "Open" link to the raw object. The page-level download control exists (?download=1 → Content-Disposition: attachment), but the stage itself says nothing about what the file is.
- Settings comment preview (
apps/api/src/comment-preview-fixtures.ts): the three fixture items are all PNGs, so a workspace never sees how a non-media attachment will look before it happens.
Proposal
- Comment: render
kind: file items as a small table under the images: name (linked), type or extension, size, and a download link. Keep the image grid unchanged. fileKindFromName already exists in the renderer package but the renderer doesn't use it; this is the place to.
- Settings preview: add one or two non-media fixture items (a PDF and a zip) so the preview shows the table form alongside the image grid.
- File page: give the
file state a type-aware card (extension badge, size, download button) instead of "Preview unavailable". Optional first-class previews later: text/markdown/CSV/JSON inline, PDF via <iframe> only if we're happy with the sandbox story.
Notes
Refs: #925, #929.
Since #925, non-media uploads (PDF, text, markdown, CSV, JSON, zip, tgz) are accepted, but the surfaces that present them still assume images and video.
Today
packages/comment-render/src/index.ts): a non-image item renders as a bare list link,- [report.pdf](…) · /path · after. No kind, no size, no download affordance. Overflow uses the same shape inside<details>./f/…(MediaStage.astro): kindfileshows the generic "Preview unavailable" fallback with an "Open" link to the raw object. The page-level download control exists (?download=1→Content-Disposition: attachment), but the stage itself says nothing about what the file is.apps/api/src/comment-preview-fixtures.ts): the three fixture items are all PNGs, so a workspace never sees how a non-media attachment will look before it happens.Proposal
kind: fileitems as a small table under the images: name (linked), type or extension, size, and a download link. Keep the image grid unchanged.fileKindFromNamealready exists in the renderer package but the renderer doesn't use it; this is the place to.filestate a type-aware card (extension badge, size, download button) instead of "Preview unavailable". Optional first-class previews later: text/markdown/CSV/JSON inline, PDF via<iframe>only if we're happy with the sandbox story.Notes
/f/because responses already carrynosniffand a sandbox CSP (Accept SVG and XML behind a sandboxing CSP on the storage hosts #929).<img>-only on/f/.Refs: #925, #929.