fix: ExplainerCardsPortal relies on CopilotKit internal DOM structure

Open
#4 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
typescript
Domain
frontend

Research direction

Start in apps/app/src/components/explainer-cards.tsx:108-118 and inspect how ExplainerCardsPortal traverses welcomeScreen and mainContent. Check whether the expected role or testid and a CopilotKit-provided extension point are available before choosing the safer integration. Done means structural changes no longer cause cards to disappear or render in the wrong location.

Written by the indexing model from the issue text.

Description

bug

Description

Severity: P2 — Fragility

ExplainerCardsPortal in apps/app/src/components/explainer-cards.tsx:108-118 reaches into CopilotKit's internal DOM via welcomeScreen.children[0] and .lastElementChild. There are no guards for structural changes.

Failure mode

Cards silently disappear or render in the wrong location after a CopilotKit upgrade.

Suggested fix

  • Add defensive checks: verify mainContent has the expected role/testid before inserting
  • Consider a comment with the CopilotKit version this was tested against
  • Alternatively, use a CopilotKit-provided extension point if one exists

From self-review finding F05

Dominant language
TypeScript
Stars
1.6k
Forks
202
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from CopilotKit/OpenGenerativeUI

All issues in CopilotKit/OpenGenerativeUI

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.