Built Welcome Emails design customization modal#26802
Built Welcome Emails design customization modal#26802
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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 |
🤖 Velo CI Failure AnalysisClassification: 🟠 SOFT FAIL
|
| const selectedColor = Color(value); | ||
| const defaultColor = Color(defaultValue); | ||
|
|
||
| const [hue, setHue] = useState( |
There was a problem hiding this comment.
There are some bugs in the color picker component. I'm going to pull this fix out into a separate PR and add tests for the color-picker component. For now I'll leave this here so it's functional for demos, but this diff will drop off before merging.
| @@ -0,0 +1,13 @@ | |||
| import ColorPickerField from '../color-picker-field'; | |||
There was a problem hiding this comment.
This and all the other files in this directory are mostly just thin wrappers around Shade components, with the addition of the useEmailDesign() hooks for managing state and changes.
🤖 Velo CI Failure AnalysisClassification: 🟠 SOFT FAIL
|
| @@ -0,0 +1,217 @@ | |||
| import React from 'react'; | |||
There was a problem hiding this comment.
This file is pretty gnarly
🤖 Velo CI Failure AnalysisClassification: 🟠 SOFT FAIL
|
🤖 Velo CI Failure AnalysisClassification: 🟠 SOFT FAIL
|
…rom shade Foundation for the welcome email design customization modal: - Export ColorPicker component from shade's index - Create EmailDesignSettings type and DEFAULT_EMAIL_DESIGN defaults - Extract color resolution logic into reusable design-utils
Reusable preview+sidebar modal layout built with shade Dialog. Left pane shows email preview, right sidebar (400px) holds design controls with title and save/close buttons.
- EmailPreview: simplified welcome email preview with real-time styling for colors, fonts, buttons, links, and dividers - DesignSettingsForm: design controls using shade ColorPicker, Select, ToggleGroup with font weight mapping logic
Replaced placeholder modal with full design customization UI: preview pane on left, design controls on right. Uses shared email-design components built with the shade design system. Currently frontend-only (no backend persistence yet).
Removed unused Button import and added explicit type annotations to callback parameters.
… preview - Extracted design fields into composable zero-prop components using React context - Added email envelope header (From, To, Subject) to preview - Wired General tab settings (publication title, header image, footer) to preview - Simplified reply-to email to text input - Removed publication icon, post title color, and title alignment fields - Matched border styling between sender header and email body
Split monolithic design-fields.tsx into a design-fields/ directory with one file per component for better maintainability and code navigation.
Welcome emails don't have a post title concept, so this section was misleading in the preview.
The welcome email modal now composes field components directly, making this wrapper unnecessary.
Broke sidebar into GeneralTab, DesignTab, and Sidebar components. Deleted unused post-title-color-field and title-alignment-field.
The email preview was a single large component with deeply nested inline conditionals and styles, making it hard to read and maintain. Extracted EnvelopeHeader, PublicationHeader, Divider, BodyContent, ActionButton, and Footer as discrete components. Replaced inline styles with Tailwind classes where possible. Removed unused publication icon prop and site icon reference.
dec7da9 to
93f0665
Compare
The buttonTextColor from resolveAllColors can be undefined, so the ActionButton prop needed to be optional. The config.emailDomain returns a broad JSON type that needed a string cast.
Added eslint-disable comments for unfixable tailwindcss/classnames-order violations caused by complex arbitrary variants and border utilities.
The eslint-plugin-tailwindcss resolves the config path relative to
the process CWD, not relative to the .eslintrc.cjs file. Using
${__dirname} makes the path absolute so it resolves correctly
regardless of whether lint runs from the package dir or repo root.
Same fix as applied to Shade in #26821.
|
Split this into multiple smaller PRs that have merged separately. |
Summary