Bugfix: Why does clicking one checkbox in live preview select ALL ro...
Documentation for Sessions
🐛 Bugfix: Why does clicking one checkbox in live preview select ALL ro...
Date: 2026-03-27
Time: 21:41:00 UTC
Session: gspace1-281.5
Agent: backend
Confidence: 95%
Status: ✅ Documented
📋 Decision Context
Question:
Why does clicking one checkbox in live preview select ALL rows?
Task: Fix live preview select-all checkbox bug
🎯 Decision Made
Chosen:
Normalize _id → id in BaseCrudApiService stubs (getList, getById, create, update) + fix preview bridge to not block interactive form controls
Options Considered:
- Normalize _id→id in stubs API layer
- Add _id fallback in useCrudList stub methods
- Change generated templates to use item._id || item.id
- Add backend transform in UniverseDataController
💭 Reasoning
MongoDB returns documents with _id but generated templates reference item.id. Without normalization, item.id is undefined for ALL items. toggleSelection(undefined) adds undefined to selectedIds, then isSelected(undefined) returns true for ALL rows since all pass undefined. Secondary fix: preview bridge click handler called e.preventDefault()+e.stopPropagation() on ALL clicks inside data-studio-id elements, which blocks checkboxes/buttons/links from functioning.
📁 Files Involved
libs/libs-structural/platform-preview/src/lib/config/sdk-preview-stubs.tslibs/libs-structural/platform-preview/src/lib/config/preview-bridge-client.ts
🔗 Related
- Decision ID:
dev_1774647660012_z5rvmo8 - Session: 281
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation