Skip to content

fix: ExplainerCardsPortal relies on CopilotKit internal DOM structure #4

@GeneralJerel

Description

@GeneralJerel

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions