Includes new page templates (fitness-gym, nonprofit, online-course, photography-studio, real-estate, startup-company, travel-blog, wedding-invitation) with thumbnail SVGs, test specs, documentation files, and minor updates to index.html, router.php, and playwright config. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
7.8 KiB
Final Fixes - Video Background & HTML Editor
Date: 2026-02-22 (Final Update)
✅ Issue 1: Video Background Section - Video URL Field Not Showing
Problem
When selecting the "Section (Video BG)" element, the Video URL input field was not appearing in the Settings panel. Users were selecting child divs instead of the parent section.
Root Cause
- Child elements (bg-overlay, bg-content) were selectable
- Clicking on these children selected them instead of the parent section
- The Video URL trait is only on the parent section element
Fix Applied
Made child elements non-selectable in the video-section component:
// In video-section init()
this.components().forEach(child => {
const classes = child.getClasses();
if (!classes.includes('bg-content')) {
child.set({
selectable: false,
hoverable: false,
editable: false
});
}
});
How to Use Now
- Add "Section (Video BG)" block to canvas
- Click anywhere on the section (dark background area)
- Section should be selected (blue outline)
- Right sidebar → Settings tab
- You'll see "Video URL" field at the top
- Enter your YouTube/Vimeo/.mp4 URL
- Press Enter → video loads!
Only ONE place to enter the URL - it's in the Settings panel when the section is selected.
✅ Issue 2: HTML Editor Always Visible (Cluttered UI)
Problem
HTML editor was always visible in the Settings panel for every element, making the UI cluttered.
Fix Applied
1. Hidden by Default
- HTML editor now starts hidden
- Shows a simple "Edit HTML" button instead
2. Toggle Button
- Click "Edit HTML" button to open the editor
- Editor appears with textarea, Apply, and Cancel buttons
- Click "Close" or "Cancel" to hide it again
3. Page-Level HTML Editing
- Added new "Code" button in top toolbar (next to Preview)
- Opens modal with full page HTML
- Edit entire page structure at once
- Apply Changes button updates the whole canvas
How to Use
Edit Individual Element HTML:
- Select any element on canvas
- Scroll down in Settings panel
- Click "Edit HTML" button
- Editor opens with element's HTML
- Make changes
- Click "Apply Changes" (or "Cancel" to discard)
- Editor hides automatically after applying
Edit Full Page HTML:
- Click "Code" button in top toolbar
- Modal opens with entire page HTML
- Edit as needed
- Click "Apply Changes"
- Page updates with new HTML
Files Modified
/home/jknapp/code/site-builder/js/editor.js
Changes:
video-sectioncomponent - added child element configuration to make them non-selectable- HTML editor - added toggle functionality with show/hide functions
- Page HTML modal - added handlers for viewing/editing full page HTML
Lines changed:
- Line ~1205-1245: video-section component init
- Line ~1450-1480: HTML editor toggle button and modal handlers
- Line ~2995-3050: Page HTML editor modal handlers
/home/jknapp/code/site-builder/index.html
Changes:
- Added "Edit HTML" toggle button in Settings panel
- Updated HTML editor section with Close button
- Added "Code" button to top toolbar
- Added Page HTML Editor modal
Lines changed:
- Line ~65: Added "Code" button to toolbar
- Line ~162-180: HTML editor toggle button and updated editor section
- Line ~531-551: Page HTML Editor modal
/home/jknapp/code/site-builder/css/editor.css
No new changes - existing HTML editor styles work for both element and page editing
Testing Checklist
Video Background Section
- Add "Section (Video BG)" block
- Click on the section (not the text inside)
- Settings panel shows "Video URL" field
- Enter YouTube URL:
https://www.youtube.com/watch?v=OC7sNfNuTNU - Press Enter
- Video loads in background
- No duplicate Video URL fields appear
HTML Editor - Element Level
- Select any element
- See "Edit HTML" button in Settings
- Click button → editor opens
- Make a simple change (add class, edit text)
- Click "Apply Changes"
- Change takes effect
- Editor hides automatically
- Click "Edit HTML" again → editor reopens
HTML Editor - Page Level
- Click "Code" button in top toolbar
- Modal opens with full page HTML
- Make a change
- Click "Apply Changes"
- Page updates
- Modal closes
- Canvas reflects changes
User Guide Updates
Video Background - Simplified Instructions
WHERE to enter Video URL: ✅ One place only: Main section → Settings panel → "Video URL" field
HOW to access it:
- Add the block
- Click the section (blue outline should wrap whole section)
- Settings tab (right sidebar)
- "Video URL" field at top
DON'T look for:
- ❌ Multiple Video URL fields (there's only one now!)
- ❌ Inner wrapper elements (hidden from selection)
- ❌ Advanced traits or hidden settings
HTML Editor - New Workflow
Element Editing (Hidden by Default):
- Select element → Scroll to "Edit HTML" button → Click to open
- Editor shows → Make changes → Apply or Cancel
- Editor hides after action
Page Editing (Modal):
- Top toolbar → "Code" button → Modal opens
- Edit full page HTML → Apply Changes
- Modal closes → Canvas updates
Benefits:
- ✅ Cleaner UI (editor hidden when not needed)
- ✅ Easy access (one click to show)
- ✅ Two levels (element + page)
- ✅ Professional workflow
Before vs After
Video Background
Before (Broken):
User adds Section (Video BG)
→ Clicks on it
→ Actually selects child div
→ No Video URL field
→ Confused, frustrated
After (Fixed):
User adds Section (Video BG)
→ Clicks anywhere on section
→ Parent section selected
→ Video URL field visible in Settings
→ Enter URL → Works! ✅
HTML Editor
Before (Cluttered):
Select element
→ Settings panel shows HTML editor always
→ Takes up space even if not needed
→ UI feels cluttered
After (Clean):
Select element
→ Settings panel shows "Edit HTML" button
→ Click if you need it
→ Editor opens with full controls
→ Clean, professional UX ✅
Known Limitations
Video Background
- Videos won't autoplay (YouTube Error 153 prevention)
- User must click play button
- This is expected behavior, not a bug
HTML Editor
- Invalid HTML will show error message
- Changes replace entire element (not merged)
- Use carefully - can break styling if not careful
- Page-level changes replace ALL content
Next Steps
Recommended Testing Order
- Test video background with your test URL
- Try editing a simple element (like heading text)
- Test page-level HTML editing with small change
- Export and check final HTML
- Report any issues found
If You Find Bugs
Video Background Issues:
- Check browser console (F12) for errors
- Verify you selected the section (not child div)
- Confirm Settings tab is active
- Try different video URL
HTML Editor Issues:
- Check if HTML syntax is valid
- Try simpler changes first
- Use Cancel button to revert
- Report error message if any
Documentation Files
All guides are in /home/jknapp/code/site-builder/:
- VIDEO_BACKGROUND_GUIDE.md - Complete video background usage guide
- HEADING_LEVEL_FEATURE.md - H1-H6 selector with auto-sizing
- WINDOWS_EXPORT_FIX.md - Copy HTML export feature
- FIXES_2026-02-22.md - All fixes from earlier today
- FIXES_FINAL_2026-02-22.md - This file (latest fixes)
Summary
✅ Video Background: Now works correctly with ONE clear place to enter URL
✅ HTML Editor: Clean, toggle-based UI with element + page editing
✅ User Experience: Professional, intuitive, less clutter
Ready to test! Open /home/jknapp/code/site-builder/index.html and try both features.
All fixes complete as of 2026-02-22 11:10 PST 🎉