Skip to content

feat(comment): render non-media attachments as a file table - #951

Merged
Zach Dunn (zachdunn) merged 1 commit into
mainfrom
claude/946-comment-file-table
Sep 2, 2026
Merged

feat(comment): render non-media attachments as a file table#951
Zach Dunn (zachdunn) merged 1 commit into
mainfrom
claude/946-comment-file-table

Conversation

@zachdunn

Copy link
Copy Markdown
Member

Non-media attachments (PDF, zip, text, CSV, JSON, markdown, tgz) in the managed GitHub attachments comment now render as a small markdown table instead of bare list links. Image grid and video rendering are unchanged.

Example render (from test/fixtures/github-comment-files.json):

File Type Size
archive.zip · page ZIP 5.2 MB
data.csv CSV 850 B
report.pdf · page · /reports · after PDF 2.4 MB

What changed

  • AttachmentItem gains optional size/contentType, populated by gatherAttachments (apps/api), the settings comment-preview handler, and the CLI's gh-fallback attachment listing.
  • The renderer classifies an item as a file (table row) when it's neither image nor video by content type (preferring contentType, falling back to the filename extension — application/octet-stream, the server's generic default for an object with no explicit type, defers to the filename too, so untyped screenshots keep rendering as images).
  • File items never count toward maxInlineImages and never land in the overflow <details> block — always in the table.
  • Two existing golden fixtures (github-comment-golden.json, github-comment-golden-meta.json) already contained a .log attachment and their expected output changed from a bullet to the new table; updated by hand.
  • previewFixtureItems (settings comment preview) gained report.pdf/bundle.zip fixtures so the preview shows the table too.
  • Regenerated the CLI's inlined copy (packages/uploads/src/comment-render.generated.ts) via node packages/uploads/scripts/inline-shared.mjs.

Test command

pnpm test

5962 tests passed (in-process fakes, no services needed). Also ran pnpm typecheck and pnpm format:check clean.

Refs #946

Non-media attachments (PDF, zip, text, CSV, JSON, markdown, tgz) in the
managed GitHub attachments comment now render as a small markdown table
(File | Type | Size) instead of bare bullet links. Files never count
toward maxInlineImages and never overflow into the <details> block.

- AttachmentItem gains optional size/contentType, populated by
  gatherAttachments (apps/api) and the CLI's gh-fallback listing
  (packages/uploads/src/commands.ts).
- Classification prefers item.contentType, falling back to the
  filename (application/octet-stream defers to the filename too, since
  it is the server's generic default for an object with no explicit
  type, not a real signal).
- Refs #946.
@changeset-bot

changeset-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4f33894

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@buildinternet/uploads Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (2)
  • coderabbit:review
  • review
🚫 Excluded labels (none allowed) (1)
  • wip

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: db12d6b8-e834-467b-8f56-6f60c93da042

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@zachdunn
Zach Dunn (zachdunn) merged commit ec42d24 into main Sep 2, 2026
5 checks passed
@zachdunn
Zach Dunn (zachdunn) deleted the claude/946-comment-file-table branch September 2, 2026 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant