Bugfix: Why did selection handles and edit decorations still appear ...
Documentation for Sessions
🐛 Bugfix: Why did selection handles and edit decorations still appear ...
Date: 2026-03-24
Time: 17:37:12 UTC
Session: gspace1-131.4
Agent: angular
Confidence: 99%
Status: ✅ Documented
📋 Decision Context
Question:
Why did selection handles and edit decorations still appear on widgets in Preview mode?
Task: Page builder production readiness — preview mode fix
🎯 Decision Made
Chosen:
Added [previewMode]="isPreviewMode()" binding to the top-level lib-canvas-widget in page-canvas.component.html
Options Considered:
- Add CSS class to hide decorations globally in preview
- Pass previewMode input from parent to child component
- Use a shared service/signal for preview state
💭 Reasoning
Root cause: canvas-widget.component.ts already had a previewMode = input<boolean>(false) signal and a showEditDecorations computed that gates all selection UI on !this.previewMode(). Child widgets correctly propagated [previewMode]="previewMode()". But page-canvas.component.html — which renders top-level widgets — never passed the previewMode input. Since the input defaults to false, widgets always showed edit decorations. One-line fix: add the binding [previewMode]="isPreviewMode()" to the <lib-canvas-widget> element inside the @for loop in page-canvas.component.html. This was a classic 'missing input binding' bug where the child component had the capability but the parent never activated it.
📁 Files Involved
libs/libs-structural/page-builder/src/lib/canvas/page-canvas.component.htmllibs/libs-structural/page-builder/src/lib/components/canvas-widget/canvas-widget.component.ts
🔗 Related
- Decision ID:
dev_1774373832305_zj1xxgg - Session: 131
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation