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:

  1. Add CSS class to hide decorations globally in preview
  2. Pass previewMode input from parent to child component
  3. 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


🔗 Related


Auto-generated by MCP Smart Consolidation