GeezerVison is showing github.com — fix(web): keep Markdown preview from changing the default by StiensWout · Pull Request #44896 · pingdotgg/t3code
Conversation
Opening a rendered Markdown preview in the Files panel used to change the saved view for other Markdown files. Now Open preview starts the selected file in rendered mode, and its toolbar can switch between rendered and source without changing the saved default. Regular file opens still follow the saved preference.
Related: #33932, #43654, #43673, #33969, #21564, #33472
Reproduction on main
Commit 9f887c5a39 (main), in the running web app:
- Start the web app in a browser that has not saved a Markdown view choice.
- Open a project that contains two Markdown files.
- Open a thread in that project.
- Open the right panel.
- Open Files.
- Click the first Markdown file and leave it shown as source, where the control reads Show rendered markdown.
- Right-click that same file in the file tree.
- Choose Open preview.
- Click the other Markdown file.
- Reload the app and open either Markdown file again.
The other file also opens rendered, and its control reads Show markdown source. After a reload, Markdown files still open rendered. Expected: Open preview renders only the file you chose. The other file opens as source, and later Markdown files still open as source after a reload.
The cause is at apps/web/src/components/files/FilePreviewPanel.tsx:2000. Ran pnpm scenarios:prove scripts/scenarios/markdown-preview-preserves-source-preference.e2e.ts --target web with the repro scenario added: it failed in 2 of 2 runs on a clean checkout, with expect.toBeVisible failed in the output.
Evidence
Environment: The web app in Chromium on Linux x64, a fresh checkout.
Proven: the repro fails at the test commit 94899f37ae and passes on the head a5e43db92b, both on main 5009bdb1c6.
|
Before |
After |
| Commit |
94899f37ae |
a5e43db92b |
| Result |
ASSERTION_FAILED: expect.toBeVisible failed |
passed |
| normally opened notes |
 |
 |
| failure |
 |
|
Before the fix, recorded:
https://pub-b182a4071edc4521829926b34990540b.r2.dev/files/7ccc1ffd-88fd-44b0-aa57-b449b0df0594/before-recording.webm
After the fix, recorded:
https://pub-b182a4071edc4521829926b34990540b.r2.dev/files/379caa0a-4d5c-42fd-b388-13e849e34798/after-recording.webm
Outside view: a person sees it in the running web app by following the steps under Reproduction on main.
Tests
- 94899f37ae adds the failing test, alone, before the fix.
pnpm exec vp run check:changed 5009bdb1c64db921171e251c3a31169332a2d429 passed on head.
Not in this change
- The toolbar on a normally opened Markdown file still updates the saved preference.
- Preview mode is temporary. Reloading or restoring a closed tab uses the saved preference.
- The change applies to the Files panel shared by web and Electron. Native mobile uses its own file-view mode.
Who did the work
- Repro written by GPT 6.2 Sol, in Codex
- Outside view by Grok 4.7, in Grok
- Duplicate check judged by Claude Opus 5.5, in Claude Code
- Written by GPT 6.2 Sol, in Codex
- Trimmed 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, and by Gemini 4 Neon, in Antigravity
- Reproduction, checks and proof run by a program on base and head, not by an agent
Made in T3 Code by GPT 6.2 Sol, Claude Opus 5.5, Grok 4.7 and Gemini 4 Neon
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.
Walkthrough
-
The change adds per-file-surface Markdown rendering state. File previews can use and update that state without changing the saved Markdown preference. An end-to-end scenario covers normal opening and context-menu preview.
Changes: Markdown preview state
| Layer / File(s) |
Summary |
Store Markdown rendering state apps/web/src/rightPanelStore.ts |
File surfaces can carry a Markdown rendering flag. openFile accepts the flag, and setFileMarkdownPreview updates it when the surface and reveal request match. Surface cleanup removes the flag. |
Connect file preview to surface state apps/web/src/components/chat/RightPanelSurfaceContent.tsx, apps/web/src/components/chat/useRightPanelActions.ts, apps/web/src/components/files/FilePreviewPanel.tsx, scripts/scenarios/markdown-preview-preserves-source-preference.e2e.ts |
File-opening callbacks pass the optional rendering state through to the store. The preview panel uses and updates supplied state when present, and context-menu preview opens with rendered Markdown. The end-to-end scenario checks preview behavior and source preference. |
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Suggested labels: bugfix
Suggested reviewers: willem-jaap, juliusmarminge
Merge Risk: Minimal · up to a5e43
-
Opening a Markdown file with Open preview now renders only that file and no longer changes the saved view preference for other Markdown files. No remaining merge risk was identified.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title follows the conventional commit format and names the main change: Markdown preview no longer changes the saved Markdown view default. The title matches the changeset, which adds a per-surfac… |
| Description check |
 |
The description covers the problem, the change, the scope, and verification. It gives reproduction steps, a clear expected behavior, and links to the failing test and passing head commit with before a… |
| 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 follows the conventional commit format and names the main change: Markdown preview no longer changes the saved Markdown view default. The title matches the changeset, which adds a per-surface renderMarkdown flag so Open preview renders only the selected file, and the title is specific enough for a teammate scanning history.
Full details: Description check
-
Explanation
The description covers the problem, the change, the scope, and verification. It gives reproduction steps, a clear expected behavior, and links to the failing test and passing head commit with before and after evidence. It also states what the change does not cover. The Scope section lists related issues but does not explain why the fix needs no issue or whether a maintainer requested it. The description also includes a long list of model and tool attributions that the template does not ask for, but the required sections are present and substantively filled in.
Finishing Touches
-
Generate unit tests (beta)
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
-
Run configuration
-
Commits
-
Reviewing files that changed from the base of the PR and between 40b0a98 and a5e43db.
Files selected for processing: 5
-
apps/web/src/components/chat/RightPanelSurfaceContent.tsx
apps/web/src/components/chat/useRightPanelActions.ts
apps/web/src/components/files/FilePreviewPanel.tsx
apps/web/src/rightPanelStore.ts
scripts/scenarios/markdown-preview-preserves-source-preference.e2e.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This branch has not been deployed
No deployments
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:L
100-499 changed lines (additions + deletions).
vouch:trusted
Author is trusted by repo permissions or 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.
|