GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(web): keep Markdown preview from changing the default by StiensWout · Pull Request #44896 · pingdotgg/t3code

Conversation

@StiensWout

@StiensWout StiensWout commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

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:

  1. Start the web app in a browser that has not saved a Markdown view choice.
  2. Open a project that contains two Markdown files.
  3. Open a thread in that project.
  4. Open the right panel.
  5. Open Files.
  6. Click the first Markdown file and leave it shown as source, where the control reads Show rendered markdown.
  7. Right-click that same file in the file tree.
  8. Choose Open preview.
  9. Click the other Markdown file.
  10. 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 Before: normally opened notes After: normally opened notes
failure Before: 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.

All reactions
StiensWout and others added 5 commits November 28, 2026 11:16
@StiensWout @codex
test(web): reproduce Markdown preview changing the default
94899f3
Co-authored-by: GPT 6.2 Sol <[email protected]>
@StiensWout @codex
fix(web): keep Markdown preview from changing the default
8810206
Co-authored-by: GPT 6.2 Sol <[email protected]>
@StiensWout @claude
refactor(web): drop the separate transient-state helper and clear the…
7d318f8
… preview flag in withoutReveal

Co-authored-by: Claude Opus 5.5 <[email protected]>
@StiensWout @claude
refactor(web): drop the redundant isMarkdown guard before dismissing …
c133105
…the preview

Co-authored-by: Claude Opus 5.5 <[email protected]>
@StiensWout @codex
fix(web): keep the Markdown toolbar toggle local to explicit previews
a5e43db
Co-authored-by: GPT 6.2 Sol <[email protected]>
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Nov 28, 2026
@coderabbitai

coderabbitai Bot commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

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: Passed 4

Check name Status Explanation
Title check Passed 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 Passed 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 Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed 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)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: pingdotgg/t3code
  • Branch: main
  • File: .coderabbit.config.ts
  • Commit: 40b0a98
  • Layers: Repository TS config
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1c07744f-b4d1-4c4a-9922-f441ff706af6
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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@StiensWout StiensWout mentioned this pull request Nov 28, 2026
fix(web): let users save a PDF after its preview fails #44980
Open

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

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.

Projects

None yet

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.

1 participant

@StiensWout
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.