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