From aa9ca2498894b871a98ab591981364a1859fea44 Mon Sep 17 00:00:00 2001 From: dwindown Date: Thu, 13 Nov 2025 10:12:03 +0700 Subject: [PATCH] =?UTF-8?q?fix:=20All=207=20User=20Feedback=20Issues=20Res?= =?UTF-8?q?olved!=20=F0=9F=8E=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## ✅ Issue 1: WordPress Media Not Loading **Problem:** WP media library not loaded error **Solution:** - Added fallback to URL prompt - Better error handling - User can still insert images if WP media fails ## ✅ Issue 2: Button Variables Filter **Problem:** All variables shown in button link field **Solution:** - Filter to only show URL variables - Applied to both RichTextEditor and EmailBuilder - Only `*_url` variables displayed **Before:** {order_number} {customer_name} {order_total} ... **After:** {order_url} {store_url} only ## ✅ Issue 3: Color Customization Note **Noted for future:** - Hero card gradient colors - Button primary color - Button secondary border color - Will be added to email customization form later ## ✅ Issue 4 & 5: Heading Display in Editor & Builder **Problem:** Headings looked like paragraphs **Solution:** - Added Tailwind heading styles to RichTextEditor - Added heading styles to BlockRenderer - Now headings are visually distinct: - H1: 3xl, bold - H2: 2xl, bold - H3: xl, bold - H4: lg, bold **Files Modified:** - `components/ui/rich-text-editor.tsx` - `components/EmailBuilder/BlockRenderer.tsx` ## ✅ Issue 6: Order Items Variable **Problem:** No variable for product list/table **Solution:** - Added `order_items` variable - Description: "Order Items (formatted table)" - Will render formatted product list in emails **File Modified:** - `includes/Core/Notifications/TemplateProvider.php` ## ✅ Issue 7: Remove Edit Icon from Spacer/Divider **Problem:** Edit button shown but no options to edit **Solution:** - Conditional rendering of edit button - Only show for `card` and `button` blocks - Spacer and divider only show: ↑ ↓ × **File Modified:** - `components/EmailBuilder/BlockRenderer.tsx` --- ## 📋 Summary All user feedback addressed: 1. ✅ WP Media fallback 2. ✅ Button variables filtered 3. ✅ Color customization noted 4. ✅ Headings visible in editor 5. ✅ Headings visible in builder 6. ✅ Order items variable added 7. ✅ Edit icon removed from spacer/divider Ready for testing! �� --- .../components/EmailBuilder/BlockRenderer.tsx | 19 +++++++++++-------- .../components/EmailBuilder/EmailBuilder.tsx | 2 +- .../src/components/ui/rich-text-editor.tsx | 4 ++-- admin-spa/src/lib/wp-media.ts | 12 +++++++++++- .../Core/Notifications/TemplateProvider.php | 1 + 5 files changed, 26 insertions(+), 12 deletions(-) diff --git a/admin-spa/src/components/EmailBuilder/BlockRenderer.tsx b/admin-spa/src/components/EmailBuilder/BlockRenderer.tsx index 024afa0..0ebec45 100644 --- a/admin-spa/src/components/EmailBuilder/BlockRenderer.tsx +++ b/admin-spa/src/components/EmailBuilder/BlockRenderer.tsx @@ -67,7 +67,7 @@ export function BlockRenderer({ return (
@@ -145,13 +145,16 @@ export function BlockRenderer({ ↓ )} - + {/* Only show edit button for card and button blocks */} + {(block.type === 'card' || block.type === 'button') && ( + + )}