Bugfix: Why did scaffold-generated form components fail to compile w...

Documentation for Sessions

🐛 Bugfix: Why did scaffold-generated form components fail to compile w...

Date: 2026-03-10
Time: 21:12:42 UTC
Session: gspace1-200.7
Agent: angular
Confidence: 95%
Status: ✅ Documented


📋 Decision Context

Question:

Why did scaffold-generated form components fail to compile with missing properties (isFieldInvalid, form, onSubmit, mode, getFieldError)?

Task: S200: Fix scaffold template API mismatch


🎯 Decision Made

Chosen:

Rewrote scaffold form template to use useCrudForm composable return object (crud.form(), crud.onSubmit(), crud.onCancel(), crud.isFieldInvalid(), crud.getFieldError(), crud.isEditMode()). Also fixed list template to use useCrudList signals directly instead of passing [crud] binding to GgsCrudListShellComponent.

Options Considered:


💭 Reasoning

Root cause: scaffold templates were written against an assumed API that didn't match the actual composable implementations. The form template called form.submit(), form.cancel(), form.formGroup() — none of which exist on UseCrudFormReturn. The actual API is: onSubmit(), onCancel(), form() (Signal). Similarly, the list template used <ggs-crud-list-shell [crud]='crud' /> but GgsCrudListShellComponent has 14 individual input() properties, not a single [crud] binding. This is a class of bugs where generated code templates drift from the actual library APIs. Prevention: scaffold templates should be tested against the real composable return types, or ideally generated from the type definitions.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation