Skip to content

Non-media attachments: table form in the managed comment, settings preview fixtures, and a file card on /f/ #946

Description

@zachdunn

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

  1. 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.
  2. 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.
  3. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions