-
Notifications
You must be signed in to change notification settings - Fork 132
Unify Template type definitions across frontend and backend #35
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem
There are three separate Template type definitions that can drift out of sync:
UITemplateinapps/agent/src/templates.py(backend)Templateinterface inapps/app/src/components/template-library/index.tsx(frontend)SeedTemplateinapps/app/src/components/template-library/seed-templates.ts(frontend)
SeedTemplate is missing component_type and component_data fields, so seed templates for charts would need to be cast. Any field added to one type but not the others causes silent mismatches.
Suggested fix
- Unify
TemplateandSeedTemplateinto a single shared frontend type - Ensure the frontend type matches the backend
UITemplateschema (all optional fields present) - Consider a shared schema definition (e.g. Zod on frontend, matching TypedDict on backend)
Files
apps/agent/src/templates.pyapps/app/src/components/template-library/index.tsxapps/app/src/components/template-library/seed-templates.ts
From PR #20 review
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request