Unify Template type definitions across frontend and backend
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- python, typescript
- Domain
- full-stack
Research direction
Compare the type definitions in apps/agent/src/templates.py, apps/app/src/components/template-library/index.tsx, and apps/app/src/components/template-library/seed-templates.ts, starting with the backend UITemplate schema and the missing seed-template fields. Unify the frontend definitions and align them with the backend fields, then verify that chart seed templates no longer need casts and the three definitions cannot drift independently.
Written by the indexing model from the issue text.
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
- Dominant language
- TypeScript
- Stars
- 1.6k
- Forks
- 202
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from CopilotKit/OpenGenerativeUI
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
CopilotKit/OpenGenerativeUI#87 · 2 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
All issues in CopilotKit/OpenGenerativeUI
Similar issues
-
clawsweeper:linked-pr-open clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:message-loss issue-rating: 🦞 diamond lobster maturity:stable P2
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#616 ·
-
ZCode 3.14.3 に対応する Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
supermomonga/zcode-acp#24 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
growthbook/growthbook#7100 ·
-
triage
Difficulty 1/5 1-3 hours Newbie friendliness 88/100