TemplateChip DOM portal needs fallback when CopilotKit textarea DOM changes
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- frontend
Research direction
Start with apps/app/src/components/template-library/template-chip.tsx:29-46 and index.tsx:69, then trace how the CopilotKit textarea selector and parent traversal are used. Check whether CopilotKit exposes a stable injection API, and verify that the chip remains visible when the portal target is absent while template application can still focus the textarea.
Written by the indexing model from the issue text.
Description
Problem
TemplateChip (template-chip.tsx:29-46) injects itself into CopilotKit's internal DOM by querying [data-testid="copilot-chat-textarea"] and walking to parentElement to insert a portal container. If CopilotKit changes the textarea's DOM nesting in a future update, the chip silently disappears with no indication to the user.
Same fragility exists in template-library/index.tsx:69 which uses the same selector to focus the textarea after applying a template.
Suggested fix
- Add a fallback: if the portal target isn't found, render the chip above the chat area (e.g. as a fixed-position element) instead of rendering nothing
- Add a prominent comment documenting the CopilotKit DOM coupling so it's caught during upgrades
- Consider checking if CopilotKit exposes a stable API for injecting content near the input area
Files
apps/app/src/components/template-library/template-chip.tsxapps/app/src/components/template-library/index.tsx
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
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
dennys-bd/agent-hive#184 ·
-
Add: hunch Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
AbdelStark/awesome-typesafe#104 ·
-
ai-observability bug team/ai-observability
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vicharanashala/fln#563 ·