feat(comment): render non-media attachments as a file table - #951
Conversation
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 detectedLatest commit: 4f33894 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (2)
🚫 Excluded labels (none allowed) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
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):/reports·afterWhat changed
AttachmentItemgains optionalsize/contentType, populated bygatherAttachments(apps/api), the settings comment-preview handler, and the CLI'sgh-fallback attachment listing.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).maxInlineImagesand never land in the overflow<details>block — always in the table.github-comment-golden.json,github-comment-golden-meta.json) already contained a.logattachment and their expected output changed from a bullet to the new table; updated by hand.previewFixtureItems(settings comment preview) gainedreport.pdf/bundle.zipfixtures so the preview shows the table too.packages/uploads/src/comment-render.generated.ts) vianode packages/uploads/scripts/inline-shared.mjs.Test command
5962 tests passed (in-process fakes, no services needed). Also ran
pnpm typecheckandpnpm format:checkclean.Refs #946