GeezerVison is showing github.com — fix: honor generic MIME aliases in attachment previews by Jo2234 · Pull Request #29360 · pingdotgg/t3code
Conversation
Attachments with supported Office, archive, or SQLite extensions show "No preview for this file" when their MIME type is a generic alias such as binary/octet-stream or application/unknown. filePreviewKind already treats every member of GENERIC_MIME_TYPES as generic, but the binaryPreviewKind and officePreviewKind fallback guards only accepted application/octet-stream. This PR makes both guards use the same GENERIC_MIME_TYPES set so the helpers agree.
Why this is a small obvious bug fix: two guards now reuse the existing shared generic-MIME set. There are no new preview engines, formats, or settings. The existing set also includes video/mp2t and video/vnd.dlna.mpeg-tts (the OS labels for TypeScript .ts files), so those now allow filename fallback too. That follows from using the existing set; it adds no new supported formats. Specific conflicting MIME types still take precedence. Empty MIME, text/plain, and notebook JSON behave as before. Name-only callers in FilePreviewPanel are unchanged.
Validation
- Focused tests: the existing extension tables in
packages/shared/src/filePreview.test.ts now check each binary and Office kind against empty, application/octet-stream, binary/octet-stream, application/unknown, a padded/uppercase alias with parameters, and text/plain. Base: 17 failing / 70 passing. Head: 87 passing. vp run check:changed passes.
- Integrated local check (base 701e13c vs head 068b53b): an isolated dev app with seeding off. Valid synthetic DOCX, XLSX, ZIP, and SQLite files were each attached through the real composer file input as
binary/octet-stream and as application/unknown, then opened from the real attachment chips. Base: all 8 cases show "No preview for this file". Head: all 8 render (document heading and text, spreadsheet cells, archive entry, database table and row). The same persisted attachments were used at both commits. For representative cases, AttachmentFilePreview props confirmed the uploaded-asset path (hasFile: false) with the alias MIME types.
Before/after screenshots:
| Format / MIME |
Before |
After |
| DOCX · binary/octet-stream |
 |
 |
| XLSX · application/unknown |
 |
 |
| ZIP · binary/octet-stream |
 |
 |
| SQLite · application/unknown |
 |
 |
Not checked
The MIME metadata was supplied synthetically through browser File objects. I did not check which MIME labels real OS file pickers assign, physical mobile devices, live provider behavior, or other formats. Repo-wide checks were not run.
Code and tests by GPT-6.1 Sol in Codex; reviewed by Claude Opus 5.5 in Claude Code.
🤖 Generated with Claude Code
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Approvability
Verdict: Approved at 068b53b
Macroscope's review found this PR approvable — Generic MIME aliases now allow supported Office, archive, and SQLite attachments to use existing previews. Specific MIME precedence and preview settings remain unchanged, with risk limited to attachment classification.
You can add or adjust custom eligibility rules. Learn more.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review.
Recent review info
-
Run configuration
-
Commits
-
Reviewing files that changed from the base of the PR and between 22b5252 and 068b53b.
Files selected for processing: 2
-
packages/shared/src/filePreview.test.ts
packages/shared/src/filePreview.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
Walkthrough
-
Binary and Office preview detection now checks file extensions when the MIME type is listed in GENERIC_MIME_TYPES. Tests cover archive, SQLite, and Office filenames across multiple generic MIME types.
Changes: File preview detection
| Layer / File(s) |
Summary |
Generic MIME extension detection packages/shared/src/filePreview.ts, packages/shared/src/filePreview.test.ts |
Binary and Office preview checks now allow extension matching for MIME types in GENERIC_MIME_TYPES. Tests cover archive, SQLite, and Office assets with multiple generic MIME values. |
Estimated code review effort: 2 (Simple) | ~8 minutes
Change: Bug fix
Suggested reviewers: maria-rcks
Merge Risk: Minimal · up to 068b5
-
No actionable merge-blocking risk was established for this change.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title clearly and concisely describes the main change: supporting generic MIME aliases in attachment previews. It uses an appropriate conventional commit format. |
| Description check |
 |
The description explains the problem, the implementation, scope rationale, focused tests, integrated verification, screenshots, limitations, and tooling. It uses a "Validation" heading instead of the … |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
Full details: Description check
-
Explanation
The description explains the problem, the implementation, scope rationale, focused tests, integrated verification, screenshots, limitations, and tooling. It uses a "Validation" heading instead of the template's "Verification" heading, but it provides the required verification details and is otherwise complete.
Finishing Touches
-
Generate unit tests (beta)
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
maria-rcks
commented
Nov 2, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Note Written by gpt-6.1-sol on behalf of Maria
Verified in a real dev environment
Verified exact head 068b53be025eefac93eeec17c9e0e721eac68864 against github/main at 71646e031a on a disposable Linux VM. Installed both checkouts with vp i and ran one background dev server at a time. Drove the actual web app with repository Playwright and /usr/bin/google-chrome.
Created the project and thread through the app. Real Codex gpt-6.1-sol turns generated release-review deliverables from the repository git log, then read the uploaded attachment paths. No mocks, demo records, or source changes. Browser upload MIME metadata was deliberately set to the two affected aliases; OS MIME assignment was not tested.
All eight persisted attachment previews failed on main with No preview for this file. The same uploaded bytes and MIME metadata rendered on this head: DOCX page, XLSX commit cells, ZIP entry report.txt, and SQLite table with five commit rows, each for binary/octet-stream and application/unknown. Read-only inspection confirmed the alias MIME values and server-asset path (hasFile: false). A fresh real provider turn on the PR confirmed both uploaded SQLite databases have five rows and both ZIPs contain report.txt.
Nearby behavior passed: standard DOCX MIME preview, rendered Markdown, and Save file downloading byte-identical DOCX contents. Blacksmith: 87 focused tests passed; vp run check:changed against the PR parent passed format, lint, knip, affected typechecks, and 88 tests. Existing CI reports 30 successful checks.
before: main, DOCX with binary/octet-stream

after: exact PR head, same DOCX

before: main, SQLite with application/unknown

after: exact PR head, same SQLite database

recording: opening DOCX, XLSX, SQLite, ZIP, and Markdown attachments; uploaded playback and seeking checked

short verification transcript
Not verified
Native Electron, iOS, and Android clients; macOS/Windows file pickers; remote/tunnel connections; other Office/archive formats and generic MIME aliases. These were not exercised on this Linux web-client run. Actual OS assignment of alias MIME labels remains unverified.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:XS
0-9 changed lines (additions + deletions).
vouch:unvouched
Author is not yet trusted in the VOUCHED list.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|