fix(preview-server): file names and extensions not being used in download#2684
Merged
gabrielmfern merged 7 commits intocanaryfrom Nov 13, 2025
Merged
fix(preview-server): file names and extensions not being used in download#2684gabrielmfern merged 7 commits intocanaryfrom
gabrielmfern merged 7 commits intocanaryfrom
Conversation
🦋 Changeset detectedLatest commit: 78bbe77 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
commit: |
vcapretz
approved these changes
Nov 13, 2025
Contributor
There was a problem hiding this comment.
1 issue found across 5 files
Prompt for AI agents (all 1 issues)
Understand the root cause of the following 1 issues and fix them.
<file name="packages/preview-server/src/app/preview/[...slug]/preview.tsx">
<violation number="1" location="packages/preview-server/src/app/preview/[...slug]/preview.tsx:39">
Refactoring `lang` identifiers from `jsx`/`markup` to `tsx`/`html` without handling old values in URL parameters causes a crash. Visiting a previously valid URL with `?lang=jsx` will now break the source view.</violation>
</file>
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.
| const isDarkModeEnabled = searchParams.get('dark') !== null; | ||
| const activeView = searchParams.get('view') ?? 'preview'; | ||
| const activeLang = searchParams.get('lang') ?? 'jsx'; | ||
| const activeLang = searchParams.get('lang') ?? 'tsx'; |
Contributor
There was a problem hiding this comment.
Refactoring lang identifiers from jsx/markup to tsx/html without handling old values in URL parameters causes a crash. Visiting a previously valid URL with ?lang=jsx will now break the source view.
Prompt for AI agents
Address the following comment on packages/preview-server/src/app/preview/[...slug]/preview.tsx at line 39:
<comment>Refactoring `lang` identifiers from `jsx`/`markup` to `tsx`/`html` without handling old values in URL parameters causes a crash. Visiting a previously valid URL with `?lang=jsx` will now break the source view.</comment>
<file context>
@@ -36,7 +36,7 @@ const Preview = ({ emailTitle, className, ...props }: PreviewProps) => {
const isDarkModeEnabled = searchParams.get('dark') !== null;
const activeView = searchParams.get('view') ?? 'preview';
- const activeLang = searchParams.get('lang') ?? 'jsx';
+ const activeLang = searchParams.get('lang') ?? 'tsx';
const handleDarkModeChange = (enabled: boolean) => {
</file context>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 can test this in the preview deploy of the demo
Summary by cubic
Fixes download filenames in the preview server to use the actual email file name and correct extension. Also standardizes language keys for tabs and downloads.
Written for commit 78bbe77. Summary will update automatically on new commits.