Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Older cmux preview screenshots (latest comment is below)Preview Screenshots⏳ Preview screenshots are being captured... Workspace and dev browser links will appear here once the preview environment is ready. Generated by cmux preview system |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds WYSIWYG email editing end-to-end: JSX transpiler that injects editable-region sentinels, dashboard in-iframe editor with commit messaging, backend POST /internal/wysiwyg-edit (mock OpenRouter mode, timeout, guarded client), rendering support for editable markers, admin SDK/app hooks for apply/delete, and associated unit and e2e tests and UI wiring. Changes
Sequence Diagram(s)sequenceDiagram
participant User as User
participant Client as Dashboard Client
participant Layout as VibeCodeLayout
participant Preview as EmailPreview
participant Backend as Backend API
participant AI as OpenRouter/OpenAI
User->>Client: Edit region and click Commit
Client->>Layout: onWysiwygEditCommit(metadata, newText)
Layout->>Preview: optimistic preview update (in-iframe)
Layout->>Backend: POST /internal/wysiwyg-edit (metadata, sourceType, old/new)
Backend->>AI: generateText (system + user prompt) OR return mock
AI-->>Backend: updated_source
Backend-->>Layout: return updated_source
Layout->>Client: update editor code and preview
Client-->>User: show updated code/preview
sequenceDiagram
participant User as User
participant Client as Dashboard Client
participant Dialog as Confirm Dialog
participant Backend as Backend API
participant DB as Database
User->>Client: Click Delete template/draft/theme
Client->>Dialog: open confirm
User->>Dialog: Confirm
Dialog->>Backend: DELETE /internal/.../{id}
Backend->>Backend: verify admin, check shared-server or active-theme
Backend->>DB: delete record / update config
DB-->>Backend: success
Backend-->>Client: 200 OK
Client-->>User: refresh UI
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Older cmux preview screenshots (latest comment is below)Preview Screenshots⏳ Preview screenshots are being captured... Workspace and dev browser links will appear here once the preview environment is ready. Generated by cmux preview system |
Older cmux preview screenshots (latest comment is below)Preview Screenshots⏳ Preview screenshots are being captured... Workspace and dev browser links will appear here once the preview environment is ready. Generated by cmux preview system |
…hosphor icons successful
Older cmux preview screenshots (latest comment is below)Preview Screenshots⏳ Preview screenshots are being captured... Workspace and dev browser links will appear here once the preview environment is ready. Generated by cmux preview system |
Older cmux preview screenshots (latest comment is below)Preview Screenshots⏳ Preview screenshots are being captured... Workspace and dev browser links will appear here once the preview environment is ready. Generated by cmux preview system |
Older cmux preview screenshots (latest comment is below)Preview Screenshots⏳ Preview screenshots are being captured... Workspace and dev browser links will appear here once the preview environment is ready. Generated by cmux preview system |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
There was a problem hiding this comment.
Pull request overview
This PR redesigns the email system UI with a focus on modern, glassmorphic design patterns and improved user experience. It adds delete functionality for email themes, templates, and drafts, introduces device viewport preview modes for emails, and enhances the AI chat integration for email editing.
Key Changes:
- Added delete operations for email themes, templates, and drafts with proper API endpoints
- Redesigned email configuration pages with glassmorphic cards and improved layouts
- Implemented device viewport simulation (phone/tablet/desktop) with realistic email client frames
- Enhanced the vibe code layout with integrated toolbar, viewport switching, and code editor modal
- Improved AI system prompts for better email design generation
Reviewed changes
Copilot reviewed 42 out of 42 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/template/src/lib/stack-app/apps/interfaces/admin-app.ts | Added delete methods for themes, templates, and drafts to admin interface |
| packages/template/src/lib/stack-app/apps/implementations/admin-app-impl.ts | Implemented delete methods with cache management and race condition handling |
| packages/stack-shared/src/interface/admin-interface.ts | Added DELETE request handlers for themes, templates, and drafts |
| packages/stack-shared/src/helpers/emails.ts | Updated email templates with improved styling and added default template source |
| packages/stack-ui/src/components/data-table/view-options.tsx | Made view options customizable with variant, className, and iconClassName props |
| apps/dashboard/src/components/vibe-coding/* | Complete redesign of code editing layout with hero-preview, viewport switching, and integrated chat |
| apps/dashboard/src/components/email-preview.tsx | Added realistic email client frame simulation for phone/tablet/desktop views |
| apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/emails/page-client.tsx | Redesigned email server configuration with glassmorphic cards and improved UX |
| apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/email-themes/* | Complete UI refresh with device preview and theme management |
| apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/email-templates/* | Added delete functionality and redesigned template list with glassmorphic cards |
| apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/email-drafts/* | Full redesign with empty states, draft cards, and improved UX |
| apps/backend/src/app/api/latest/internal/email-/ | Added DELETE endpoints with proper validation and error handling |
| apps/backend/src/lib/ai-chat/* | Enhanced AI system prompts with detailed design principles and technical rules |
| apps/e2e/tests/* | Added comprehensive tests for email template creation and SMTP configuration |
Comments suppressed due to low confidence (1)
docker/dependencies/freestyle-mock/Dockerfile:19
- This container exposes port 8080 and runs
server.ts, which implements an HTTP endpoint that executes arbitrary TypeScript from the request body with no authentication or sandboxing, effectively giving any client that can reach this container full remote code execution with the service’s privileges. An attacker can POST to the script-execution endpoint and run filesystem, network, or process-manipulation code inside the container, including accessing any secrets available to the process. This service should only accept code from strictly trusted callers and run it in a strongly isolated environment (e.g., separate low-privilege container or sandbox) and/or avoid executing arbitrary user-supplied code altogether.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/template/src/lib/stack-app/apps/implementations/admin-app-impl.ts
Outdated
Show resolved
Hide resolved
apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/email-templates/page-client.tsx
Show resolved
Hide resolved
Greptile SummaryThis PR implements a comprehensive redesign of the email system with device viewport previews, AI-assisted editing, and CRUD operations for templates, drafts, and themes. Major Changes:
Critical Security Issue:
Security Improvements:
Confidence Score: 1/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User as User/Dashboard
participant Dashboard as Dashboard Client
participant Backend as Backend API
participant AI as AI Provider (OpenAI/OpenRouter)
participant Freestyle as Freestyle-Mock Server
participant DB as Database
Note over User,DB: Email Template Editing Flow
User->>Dashboard: Edit email template
Dashboard->>Backend: PATCH /email-templates/{id}
Backend->>Backend: Validate theme_id type
Backend->>Freestyle: POST /execute/v1/script
Note right of Freestyle: Executes user-provided<br/>TSX code (SECURITY RISK)
Freestyle->>Freestyle: Install dependencies
Freestyle->>Freestyle: Execute script
Freestyle-->>Backend: Return rendered HTML
Backend->>DB: Update config override
Backend-->>Dashboard: Return rendered HTML
Dashboard-->>User: Show preview
Note over User,DB: AI-Assisted Editing Flow
User->>Dashboard: Ask AI for help
Dashboard->>Backend: POST /ai-chat/{threadId}
Backend->>Backend: Validate messages
Backend->>AI: Generate text with tools
AI-->>Backend: Response with tool calls
Backend->>DB: Save thread message
Backend-->>Dashboard: Return AI response
Dashboard-->>User: Show AI suggestions
Note over User,DB: Template Deletion Flow
User->>Dashboard: Delete template
Dashboard->>Backend: DELETE /email-templates/{id}
Backend->>Backend: Check if template exists
Backend->>DB: Set template config to null
Backend-->>Dashboard: Success
Dashboard-->>User: Refresh list
|
apps/backend/src/app/api/latest/internal/email-drafts/[id]/route.tsx
Outdated
Show resolved
Hide resolved
…-catch blocks with direct checks for draft existence before deletion and retrieval, improving code clarity. Update loading state management in email template client to prevent state updates after component unmount.
<!-- Make sure you've read the CONTRIBUTING.md guidelines: https://github.com/stack-auth/stack-auth/blob/dev/CONTRIBUTING.md --> --------- Co-authored-by: Konstantin Wohlwend <n2d4xc@gmail.com>
…ayout responsiveness. Updated sidebar layout styles, added data-full-bleed attributes to email draft and template components, and refactored VibeCodeLayout for better light mode handling.
… and enhance the Design Guide with clearer usage principles and best practices. Introduced new components: `DesignAlert`, `DesignBadge`, `DesignButton`, `DesignCard`, `DesignEditableGrid`, and `CursorBlastEffect`. Updated existing components to utilize the new structure, ensuring consistent UI patterns across the dashboard.
…pport. Added `useOffWhiteLightChrome` and `useOffWhiteLightMode` properties to `VibeCodeLayout` in both email drafts and themes for improved visual consistency.
…istency. Adjusted main content area and stack companion overlay for better responsiveness and visual clarity.
Summary by CodeRabbit
New Features
Improvements
Tests
Documentation
Note
Modernizes email authoring and AI integration across backend and dashboard.
STACK_OPENROUTER_API_KEY), updates internal chat to OpenRouter with mock mode fallbackPOST /internal/wysiwyg-editAI endpoint to apply WYSIWYG text edits to JSX sourcesPOST /emails/render-emailto accepteditable_markers/editable_sourceand returneditable_regionsDELETE /internal/email-drafts/:id), templates (DELETE /internal/email-templates/:templateId), and themes (DELETE /internal/email-themes/:id) with safeguards (no default/active theme deletion)theme_id, usesdefaultNewTemplateSource, precise config overridesWritten by Cursor Bugbot for commit 9ae5ad7. This will update automatically on new commits. Configure here.