-
Notifications
You must be signed in to change notification settings - Fork 867
fix(preview-server): file names and extensions not being used in download #2684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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>
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.