-
Notifications
You must be signed in to change notification settings - Fork 428
refactor vibe coding components, basic email templates config #770
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
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Greptile Summary
This PR implements a significant refactor of the email template and theme editing functionality, introducing a new modular "vibe-coding" component system. The changes centralize common UI patterns for code editing, preview, and AI-assisted editing capabilities.
Key changes include:
- New VibeCodeEditor component using Monaco editor for TypeScript/JSX support
- Three-panel layout system with preview, editor, and chat functionality
- New email template schema and API endpoints supporting TSX-based templates
- Standardized chat adapters for AI assistance in template editing
- Migration path from old email templates to new system with backward compatibility
PR Description Notes:
- PR description is missing key details about the changes being made
- Consider adding migration notes for existing users
Confidence score: 3/5
- This PR requires careful testing of email template rendering before merging
- Score of 3 given due to inconsistent routing paths and incomplete TODOs in template implementation
- The following files need more attention:
- apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/email-templates-new/page-client.tsx (routing inconsistencies)
- apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/email-templates-new/[templateId]/page-client.tsx (incomplete TODOs)
21 files reviewed, 14 comments
Edit PR Review Bot Settings | Greptile
) : ( | ||
<XCircle className="size-4 text-red-500" /> | ||
)} | ||
<span className="text-sm">Created email theme</span> |
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.
style: message is not dynamic based on success/failure state
<span className="text-sm">Created email theme</span> | |
<span className="text-sm">{result?.success ? 'Created email theme' : 'Failed to create email theme'}</span> |
) : ( | ||
<XCircle className="size-4 text-red-500" /> | ||
)} | ||
<span className="text-sm">Updated email template</span> |
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.
logic: message for CreateEmailTemplateUI should say 'Created email template' not 'Updated email template'
<span className="text-sm">Updated email template</span> | |
<span className="text-sm">Created email template</span> |
{toolComponents.map((ToolComponent, index) => ( | ||
<ToolComponent key={index} /> | ||
))} |
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.
logic: Using array index as key can cause issues with component re-rendering. Use a stable unique identifier from the ToolComponent instead
}: VibePreviewPanelProps) { | ||
return ( | ||
<> | ||
<div className="p-3 flex justify-between items-center"> |
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.
style: div uses flex justify-between but only has one child element - remove justify-between or add expected right-side content
<div className="p-3 flex justify-between items-center"> | |
<div className="p-3 flex items-center"> |
title="Shared Email Server" | ||
okButton={{ | ||
label: "Edit Templates Anyway", onClick: async () => { | ||
router.push(`email-templates/${sharedSmtpWarningDialogOpen}`); |
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.
logic: Incorrect route path. Should be 'email-templates-new' to match the new route structure
router.push(`email-templates/${sharedSmtpWarningDialogOpen}`); | |
router.push(`email-templates-new/${sharedSmtpWarningDialogOpen}`); |
// TODO: Implement template update when API becomes available | ||
console.log("Tool call content:", toolCallContent); | ||
} |
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.
logic: Console.log of toolCallContent may leak sensitive template data to browser console
onCodeChange={(code) => { | ||
// TODO: Implement code change handling | ||
}} | ||
isLoading={false} |
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.
logic: isLoading prop is hardcoded to false - should reflect actual loading state from templates query
"e7d009ce-8d47-4528-b245-5bf119f2ffa3": { | ||
displayName: "Email Verification", | ||
description: "Will be sent to the user when they sign-up with email/password", | ||
variables: [], |
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.
logic: variables array is empty but projectDisplayName is used in subject and template. Should define required variables.
variables: [], | |
variables: ["projectDisplayName"], |
return { | ||
async run({ messages, abortSignal }) { | ||
try { | ||
const formattedMessages = []; |
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.
style: array initialization should specify type formattedMessages: ChatContent[]
// "a70fb3a4-56c1-4e42-af25-49d25603abd0": { | ||
|
||
// }, | ||
// "822687fe-8d0a-4467-a0d1-416b6e639478": { | ||
|
||
// }, | ||
// "066dd73c-36da-4fd0-b6d6-ebf87683f8bc": { | ||
|
||
// }, | ||
// "e84de395-2076-4831-9c19-8e9a96a868e4": { | ||
|
||
// }, |
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.
style: consider removing commented template IDs if not used. Can add when implementing.
...rd/src/app/(main)/(protected)/projects/[projectId]/email-templates-new/[templateId]/page.tsx
Show resolved
Hide resolved
😱 Found 1 issue. Time to roll up your sleeves! 😱 🗒️ View all ignored comments in this repo
Need help? Join our Discord for support! |
if (emailConfig?.type === 'shared') { | ||
setSharedSmtpWarningDialogOpen(template.id); | ||
} else { | ||
router.push(`email-templates-new/${template.id}`); |
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.
Consider using a tagged template literal (e.g. urlString``) to construct dynamic route URLs (both here and at line 62) to ensure proper escaping and reduce injection risks.
This comment was generated because it violated a code review rule: mrule_pmzJAgHDlFZgwIwD.
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.
can you add a loom? I'll do a full review tmrw
ready to merge after loom |
…/stack-auth into vibe-coding-templates
https://www.loom.com/share/b43b8fc7dfc947ab88d3cf709d2a167e?sid=d6e635ce-ab0f-4e86-887b-373632996cea
Important
Refactor vibe coding components and add basic email template configurations, including new components and schema updates.
route.tsx
inapi/latest/internal/email-templates
to handle GET requests for email templates.useNewEmailTemplates()
inadmin-app-impl.ts
to fetch new email templates.listInternalEmailTemplatesNew()
inadmin-interface.ts
to list new email templates.VibeCodeEditor
,VibePreviewPanel
,VibeAssistantChat
, andVibeCodeEditorLayout
invibe-coding
for email template editing and preview.page-client.tsx
inemail-templates-new
to use new components for template editing.page-client.tsx
inemail-themes
to use new vibe coding components.emailTemplateListSchema
inschema-fields.ts
for email template validation.emails.ts
to includeDEFAULT_EMAIL_TEMPLATES
.schema.ts
to includetemplateList
in email configurations.This description was created by
for 18fdae9. You can customize this summary. It will automatically update as commits are pushed.