You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Opening a CSV that is not UTF-8 (for example GBK) showed two Show source buttons. The panel's own toggle only affects the text preview path, so clicking it flipped its label to Show table while the binary-file preview kept showing the table. The panel now leaves the rendered toggle to the document/binary preview, which already renders its own working toggle, so one Show source button switches the table to the file's source.
Commit 5c9b36d97d (main). Two Show source buttons appear. Clicking the left one changes it to Show table while the preview still displays the table. Expected: Show source replaces the table with the CSV source.
Save a GBK-encoded people.csv in a demo project with the header Name,Role and the row 张三,Engineer.
Send a message containing people.csv in a Replay (dev) thread in that project.
Expand the message.
Click the people.csv link.
Click the leftmost Show source button once the table appears.
The cause is at apps/web/src/components/files/FilePreviewPanel.tsx:1695. Ran pnpm scenarios:prove scripts/scenarios/legacy-csv-source-button-switches-view.e2e.ts --target web with the repro scenario added: it failed in 2 of 2 runs on a clean boat.dev VM, with expect.toBeHidden failed in the output.
Evidence
Environment: Linux x64 on a boat.dev VM reset before each run, the repository's own tests.
Proven: the replacement test apps/web/src/components/files/FilePreviewPanel.browser.test.tsx fails at the test commit 29ab7404f8 and passes on the head 0e0eeb396b, both on main 5c9b36d97d.
29ab7404f8 adds the failing test, alone, before the fix.
pnpm exec vp run check:changed 5c9b36d97d1b41777f054ab7707557b455fa5771 passed on head.
Not in this change
Binary HTML files still show both the panel toggle and the preview's own toggle; the panel's toggle there switches to the browser preview, so it is kept.
GBK and other legacy encodings still render as replacement characters rather than being decoded.
Who did the work
Repro written by GPT 6.2 Sol, in Codex
Duplicate check judged by Claude Opus 5.5, in Claude Code
Written by Claude Opus 5.5, in Claude Code
Reviewed by Claude Opus 5.5, in Claude Code, and by GPT 6.2 Sol, in Codex
Reproduction, checks and proof run by a program on base and head, not by an agent
Made in T3 Code by Claude Opus 5.5 and GPT 6.2 Sol
Macroscope's review found this PR approvable — The change removes the duplicate rendered/source toggle from document and binary previews while retaining the HTML control. Existing preferences and file-handling behavior remain unchanged, keeping the impact limited to preview controls.
You can add or adjust custom eligibility rules. Learn more.
Reviewing files that changed from the base of the PR and between 0e0eeb3 and dc1c184.
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
No actionable comments were generated in the recent review.
Walkthrough
The file preview panel now hides the rendered-mode toggle for document previews, except HTML previews. Browser tests cover binary-file read errors and switching between table and source views.
Changes: File preview behavior
Layer / File(s)
Summary
Preview toggle rules and binary-read-error coverage apps/web/src/components/files/FilePreviewPanel.tsx, apps/web/src/components/files/FilePreviewPanel.browser.test.tsx
The panel suppresses the rendered-mode toggle for document previews, except HTML previews. Save-button logic uses the shared document-preview condition. Browser tests model read errors and verify that switching from table view to source view displays replacement characters for non-UTF-8 bytes.
The change removes the duplicate "Show source" button for non-UTF-8 CSV files and keeps one working toggle between the table and the source. No remaining merge-blocking risk was identified.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the change: binary CSV previews showed a duplicate Show source button, and the fix makes the single button switch the view. It follows the conventional commit form and is specific to t…
Description check
The description follows the template. It has a problem statement with reproduction steps and environment, and it explains the change and why the panel toggle is left to the binary preview. The scope s…
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: Title check
Explanation
The title names the change: binary CSV previews showed a duplicate Show source button, and the fix makes the single button switch the view. It follows the conventional commit form and is specific to the change in FilePreviewPanel.tsx and its browser test. It is a fix, not a feature.
Full details: Description check
Explanation
The description follows the template. It has a problem statement with reproduction steps and environment, and it explains the change and why the panel toggle is left to the binary preview. The scope section links related issues #33472 and #21564 and names the bug, but it does not state why no issue is needed or whether a maintainer requested the PR. Verification is detailed: a failing test before the fix, a passing test after, check:changed results, and before/after evidence. The author also lists the tooling used and notes what is out of scope.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
On both commits, seed a fresh csvproj project with GBK people.csv (Name,Role; 张三,Engineer), create a Replay thread with a people.csv link, open the thread, expand its Agent message, click the link, and click the leftmost Show source button. Base: two toggles; the clicked toggle changes to Show table while the table remains. Head: one toggle replaces the table with source text; clicking Show table restores the table.
Environment: real web app in Chromium, 1280×800, light theme, fresh isolated server databases and identical synthetic GBK CSV; Replay (dev) seeds the thread.
Scenario: Binary CSV has one working source toggle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size:S10-29 changed lines (additions + deletions).vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.
2 participants
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.
Opening a CSV that is not UTF-8 (for example GBK) showed two Show source buttons. The panel's own toggle only affects the text preview path, so clicking it flipped its label to Show table while the binary-file preview kept showing the table. The panel now leaves the rendered toggle to the document/binary preview, which already renders its own working toggle, so one Show source button switches the table to the file's source.
Related: #33472, #21564
Reproduction on main
Commit 5c9b36d97d (main). Two Show source buttons appear. Clicking the left one changes it to Show table while the preview still displays the table. Expected: Show source replaces the table with the CSV source.
The cause is at
apps/web/src/components/files/FilePreviewPanel.tsx:1695. Ranpnpm scenarios:prove scripts/scenarios/legacy-csv-source-button-switches-view.e2e.ts --target webwith the repro scenario added: it failed in 2 of 2 runs on a clean boat.dev VM, withexpect.toBeHidden failedin the output.Evidence
Environment: Linux x64 on a boat.dev VM reset before each run, the repository's own tests.
Proven: the replacement test
apps/web/src/components/files/FilePreviewPanel.browser.test.tsxfails at the test commit 29ab7404f8 and passes on the head 0e0eeb396b, both on main 5c9b36d97d.Two Show source buttons appear. Clicking the left one changes it to Show table while the preview still displays the table.
Show source replaces the table with the CSV source.
Tests
pnpm exec vp run check:changed 5c9b36d97d1b41777f054ab7707557b455fa5771passed on head.Not in this change
Who did the work
Made in T3 Code by Claude Opus 5.5 and GPT 6.2 Sol