Repository navigation
Draw an interface a Bot puts in a Card with one frame, not two - #1379
Merged
Merged
Conversation
CopilotKit draws its own frame (a border and 12px of padding) around every interface in a chat, and the catalog's Card draws a border too. A Card on top, the shape most interfaces take, came out as a box inside a box with a gap between them, as in the "Build a trip budget" starter task. When the interface's top component is a Card that draws a box, the frame now gives up its border and padding, so the Card, drawn in the app's tokens, is the one card in the conversation. A bare Column, or a Card drawn as a borderless section or a transparent one, keeps the frame as its only box. A real-browser test renders the transcript with interfaces delivered as the runtime's activities, under CopilotKit's stylesheet and the app's, and checks which boxes around each interface draw a border. It runs in CI's browser job.
davidmckayv
requested review from
MikeRyanDev,
dustywusty,
guidovizoso,
mxmzb,
samjulien and
tylerslaton
as code owners
November 9, 2026 21:33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
An interface a Bot draws inside a Card, such as the "Build a trip budget" starter task, showed two frames in the conversation: CopilotKit's own frame around every interface in a chat (a border and 12px of padding) and the Card's border inside it, with a gap between them.
When the interface's top component is a Card that draws a box, the frame now gives up its border and padding, so the Card, drawn in the app's tokens, is the one card in the conversation. Anything else on top, including a Card drawn as a borderless
sectionor atransparentone, keeps the frame as its only box.How
One unlayered rule in
app/src/styles.css, keyed on CopilotKit'sdata-generative-ui-chat-surfaceframe and the catalog's owndata-a2ui-card="top"mark, including a Card wrapped in thedisplay: contentsspan the SDK adds when it is given an accessible name. It covers both chat surfaces, since the frame is the SDK's in each.Test
app/tests/a2ui-frame.test.tsxrenders the real transcript in Chromium with four interfaces delivered asgenerative-ui-surfaceactivities (a Card, a named Card, a bare Column, a section Card), under CopilotKit's stylesheet and the app's inmain.tsxorder, and checks which boxes around each interface draw a border, the inset and the frame's padding. It fails onmain(frame and Card both bordered, 13px inset) and passes with the rule. Added to CI's real-browser step.OPENBOT_APP_SHOTS=<dir>saves light and dark screenshots at chat width.Visual check, before and after, light and dark: the trip budget is one card edge to edge with the column; the bare Column keeps its frame. The bright frame border in the dark theme for interfaces that keep the frame is handled separately in #1375.