Add Advanced WYSIWYG Builder with AI collaboration#60
Conversation
Co-authored-by: davis9001 <72961+davis9001@users.noreply.github.com>
- Added `normalizeWidgetPositions`, `needsPositionNormalization`, and `stableSortWidgets` functions to ensure unique and sequential widget positions. - Updated various routes to utilize the new widget normalization logic, including the builder and page server routes. - Refactored widget fetching logic to retrieve widgets from published revisions instead of the database directly. - Changed admin page links to redirect to the new builder interface. - Implemented redirection for old page editing and creation routes to the new builder. - Enhanced error handling and logging for widget and page operations.
🚀 Preview DeploymentEnvironment: Preview Preview will be available shortly after deployment completes. |
- Implemented server-side logic for creating and managing layouts in the admin panel. - Added a new page for creating layouts with form validation and slug generation. - Created API endpoints for components, including creation, updating, and deletion. - Enhanced layout management with the ability to associate widgets with layouts. - Introduced a comprehensive CSS file for consistent styling across browser elements. - Updated page API to support layout association for better content management.
…state - Added `widgetChanges.ts` with functions to apply widget changes (add, remove, update, reorder). - Introduced `WidgetChange` interface to define the structure of widget change actions. - Enhanced widget management in the admin builder by loading both published and latest draft revisions. - Updated the admin components page to improve UI and user experience, including better handling of component actions. - Refactored the pages management to utilize a new `DataTable` component for better data presentation. - Added context detection for AI chat interactions to enhance user experience based on conversation history and URL context. - Created a new API endpoint for detecting AI context from conversation history and URL.
🚀 Preview DeploymentEnvironment: Preview Preview will be available shortly after deployment completes. |
- Added 'component_ref' widget type to support component references. - Introduced ComponentWidget and ComponentWithWidgets interfaces for better structure. - Updated getWidgetDisplayLabel function to handle component references and return appropriate labels. - Modified component loading logic to include widgets when fetching components. - Enhanced component creation and update endpoints to handle widget data. - Implemented new API endpoint to retrieve widgets for a specific component. - Improved component management UI to categorize built-in and custom components. - Added cloning and resetting functionality for built-in components.
- Updated page server and client routes to replace 'widgets' with 'components'. - Refactored component imports in Svelte files to align with new component structure. - Modified database interactions to handle components instead of widgets. - Adjusted API endpoints for creating, updating, and retrieving components. - Implemented new component management logic in the builder and layout sections. - Ensured backward compatibility where necessary and updated related types.
fix: delete from Your Components
- Implement tests for ChildLayoutEditor component covering rendering, flex controls, grid controls, order control, responsive values, and quick presets. - Create tests for component database functions including getComponents, getComponentsByType, getComponent, and createComponent. - Enhance component handling by adding is_primitive flag to component structure and ensuring proper parsing of component configurations. - Update component creation logic to include is_primitive flag and ensure correct handling of primitive and non-primitive components. - Introduce circular reference validation when adding component references to prevent dependency issues.
🚀 Preview DeploymentEnvironment: Preview Preview will be available shortly after deployment completes. |
…us display and preview logic
…ructure, routing, data loading, and advanced features
🚀 Preview DeploymentEnvironment: Preview Preview will be available shortly after deployment completes. |
…assword functionalities
…tyling and media queries
- Implement responsive CSS custom properties for container components in FrontendComponentRenderer.svelte, allowing for dynamic styling based on breakpoints. - Add a new function to generate responsive styles and apply them in the component's style attributes. - Introduce a page-level override for showing the page title in PageWithLayout.svelte, allowing individual pages to control title visibility. - Update ComponentPropertiesPanel.svelte to include a toggle for the page title display setting for yield components. - Modify BuilderPropertiesPanel.svelte to allow overriding the layout's default title display setting for pages. - Adjust Pricing.svelte to utilize responsive styles for layout and padding, improving the overall design on different screen sizes. - Update types in pages.ts to reflect new properties for page title display settings. - Ensure proper data flow for page properties in the server-side load function and client-side page component.
… draft save functionality
…w commands, and update database reset/seed scripts
🚀 Preview DeploymentEnvironment: Preview Preview will be available shortly after deployment completes. |
…rt in ContainerDropZone - Updated BuilderToolbar to support mobile view with a hamburger menu and responsive layout adjustments. - Added functionality to toggle mobile menu and display title in a mobile-friendly format. - Implemented touch drag-and-drop functionality in ContainerDropZone for better mobile usability. - Introduced new utility functions to extract content previews from various component types in componentDefaults. - Enhanced unit tests to cover new content preview extraction logic and mobile drag-and-drop interactions.
🚀 Preview DeploymentEnvironment: Preview Preview will be available shortly after deployment completes. |
…ete confirmation, and update styles
- Implement touch drag-and-drop for components in the AdvancedBuilder and BuilderCanvas. - Add a cancel zone for touch drag operations to allow users to cancel adding components. - Update BuilderLeftPanel to maintain sidebar visibility during dragging. - Improve touch drag ghost appearance and behavior for better user experience. - Refactor touch event handling in BuilderSidebar for better compatibility and performance. - Introduce visual indicators for drop zones during touch dragging.
…oll container and updating test cases
- Implemented UserThemePreferences component for managing user theme settings. - Created API endpoints for getting and saving user theme preferences. - Added tests for user theme preferences functionality. - Updated built-in components (Button, Footer, NavBar) to support theme customization. - Enhanced layout and page components to integrate theme preferences. - Included theme toggle in navbar configuration. - Improved FOUC prevention during hydration in layout.
🚀 Preview DeploymentEnvironment: Preview Preview will be available shortly after deployment completes. |
🚀 Preview DeploymentEnvironment: Preview Preview will be available shortly after deployment completes. |
Implements a full-screen visual page builder to replace the basic WYSIWYG editor. Users can compose pages using drag-and-drop components, with live preview, device-specific rendering, and AI assistance.
Implementation
Core Architecture
/admin/builder/[[pageId]]- Full-screen layout bypassing admin chromeAdvancedBuilder: Main orchestrator with keyboard shortcuts (Ctrl+Z/Y/S)BuilderToolbar: Device preview (mobile/tablet/desktop), save status, AI toggleBuilderCanvas: Live preview with widget manipulation controlsBuilderSidebar: Component library (10 widgets) + layers panel with search/filteringBuilderPropertiesPanel: Wrapper for existingWidgetPropertiesPanelBuilderAIPanel: Chat interface for AI-assisted editingIntegration Points
WidgetRendererfor component previewsrc/lib/server/db/DBPageWidget(config as JSON string) toPageWidget(config as object)Widget Operations
Screenshots
Empty canvas with component library:

Hero component added with controls visible:

Current Scope
✅ Phase 2 Complete:
/admin/builder🚧 Future Phases:
Technical Notes
DBPageWidget[]→PageWidget[]transformation in page loadlocals.siteIddirectly (nottenantContext)getPageRevisions()requires 3 args:(db, siteId, pageId)WidgetTypecompletenessAll 1,249 tests passing. Type checking clean except 2 expected warnings for unused exports (
revisions,isNewPage- reserved for future phases).Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
sparrow.cloudflare.com/usr/local/bin/node --no-warnings --experimental-vm-modules /home/REDACTED/work/hermes/hermes/node_modules/wrangler/wrangler-dist/cli.js d1 migrations apply hermes-db --local(dns block)/usr/local/bin/node --no-warnings --experimental-vm-modules /home/REDACTED/work/hermes/hermes/node_modules/wrangler/wrangler-dist/cli.js d1 execute hermes-db --local --file=/home/REDACTED/work/hermes/hermes/scripts/seed-data.sql(dns block)workers.cloudflare.comnode /home/REDACTED/work/hermes/hermes/node_modules/.bin/vite dev --host 0.0.0.0(dns block)/usr/local/bin/node --no-warnings --experimental-vm-modules /home/REDACTED/work/hermes/hermes/node_modules/wrangler/wrangler-dist/cli.js d1 migrations apply hermes-db --local(dns block)/usr/local/bin/node --no-warnings --experimental-vm-modules /home/REDACTED/work/hermes/hermes/node_modules/wrangler/wrangler-dist/cli.js d1 execute hermes-db --local --file=/home/REDACTED/work/hermes/hermes/scripts/seed-data.sql(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
This section details on the original issue you should resolve
<issue_title>Robust and usable WYSIWYG with AI collaborative editing</issue_title>
<issue_description>As a store admin (technical or non-technical), I want an extremely powerful, mobile-first, full-screen Advanced Page & Component WYSIWYG editor with unlimited nesting, live preview, and AI assistance, so that I can visually compose any page type (homepage, landing pages, collection pages, product pages overrides, blog posts, email templates, popups, etc.) using intuitive drag-and-drop, deeply nested sections, reusable components, and beautiful defaults — while retaining limitless customization of layout, styling, animations, logic, and functionality — all without writing code, yet allowing power users to drop in custom CSS/JS/HTML when desired.
Background & Vision
Hermes already has basic Page CRUD with revisions and a simple WYSIWYG. This new editor replaces and dramatically expands that system into a world-class, Framer/Webflow/Builder.io-level visual builder that feels magical on both desktop and mobile. The goal is zero-learning-curve for 90% of use cases (drag beautiful pre-built sections, tweak text/images, done) while giving power users unlimited depth (nested responsive grids, custom animations, conditional visibility, dynamic data binding, custom code components, etc.).
Scope for this Issue
/admin/builder/:pageId?— full-screen, distraction-free, mobile-first builder canvas.Acceptance Criteria
/admin/builder.Technical Notes
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.