Skip to content

Commit bedc53a

Browse files
committed
fix(showcase/langgraph-python): widen declarative-gen-ui surface and polish InfoRow
The chat shell caps its scroll column at cpk:max-w-3xl (~768px), which left A2UI-generated cards (KPI dashboards, charts, status reports) feeling pinched on the declarative-gen-ui demo. Locally widen that wrapper to 64rem via a scoped attribute selector on the demo and bump the outer page wrapper from max-w-4xl to max-w-6xl so the card column actually has room to grow. While here, fix the InfoRow trailing-separator artifact: each row now draws its own border-bottom with last:border-b-0 so the final row in a Card (e.g. the Status Report demo) no longer leaves a dangling line, regardless of whether the agent wraps the rows in a Column or drops them directly into the Card child slot. Right-align the value with tabular-nums for cleaner stacks. Card itself gains w-full overflow-hidden so it stretches into the now-wider column instead of sitting at its min-width.
1 parent 7c3edca commit bedc53a

2 files changed

Lines changed: 28 additions & 14 deletions

File tree

showcase/integrations/langgraph-python/src/app/demos/declarative-gen-ui/a2ui/renderers.tsx

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import {
3535
} from "../_components/card";
3636
import { Badge } from "../_components/badge";
3737
import { Button } from "../_components/button";
38-
import { Separator } from "../_components/separator";
3938

4039
// ─── ShadCN-friendly chart palette ─────────────────────────────────────────
4140
// Neutral, slightly muted hues that pair with `bg-card` / `--border`
@@ -163,7 +162,10 @@ function AnimatedBar(props: any) {
163162
// @region[renderers-react]
164163
export const myRenderers: CatalogRenderers<MyDefinitions> = {
165164
Card: ({ props, children }) => (
166-
<Card className="min-w-[260px]" data-testid="declarative-card">
165+
<Card
166+
className="w-full min-w-[260px] overflow-hidden"
167+
data-testid="declarative-card"
168+
>
167169
<CardHeader>
168170
<CardTitle>{props.title}</CardTitle>
169171
{props.subtitle && <CardDescription>{props.subtitle}</CardDescription>}
@@ -210,16 +212,16 @@ export const myRenderers: CatalogRenderers<MyDefinitions> = {
210212
},
211213

212214
InfoRow: ({ props }) => (
213-
<div className="flex flex-col gap-1.5">
214-
<div className="flex items-baseline justify-between gap-4 py-1">
215-
<span className="text-sm text-[var(--muted-foreground)]">
216-
{props.label}
217-
</span>
218-
<span className="text-sm font-medium text-[var(--foreground)]">
219-
{props.value}
220-
</span>
221-
</div>
222-
<Separator />
215+
// Divider via `border-b last:border-b-0` so the final row doesn't dangle
216+
// a trailing line, regardless of whether the agent wraps these in a
217+
// Column or drops them directly into a Card's child slot.
218+
<div className="flex items-baseline justify-between gap-4 py-2 border-b border-[var(--border)] last:border-b-0 last:pb-0 first:pt-0">
219+
<span className="text-sm text-[var(--muted-foreground)]">
220+
{props.label}
221+
</span>
222+
<span className="text-sm font-medium text-[var(--foreground)] text-right tabular-nums">
223+
{props.value}
224+
</span>
223225
</div>
224226
),
225227

showcase/integrations/langgraph-python/src/app/demos/declarative-gen-ui/page.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,22 @@ export default function DeclarativeGenUIDemo() {
3737
agent="declarative-gen-ui"
3838
a2ui={{ catalog: myCatalog }}
3939
>
40-
<div className="flex justify-center items-center h-screen w-full">
41-
<div className="h-full w-full max-w-4xl">
40+
<div className="declarative-gen-ui-wide flex justify-center items-center h-screen w-full">
41+
<div className="h-full w-full max-w-6xl">
4242
<Chat />
4343
</div>
44+
{/*
45+
The chat surface caps its internal scroll column and input row at
46+
`cpk:max-w-3xl` (~768px). For this demo we want the generated A2UI
47+
cards (KPI dashboards, charts, status reports) to breathe wider, so
48+
we widen those wrappers locally to ~64rem. Attribute selector avoids
49+
escaping the `:` in the Tailwind class name.
50+
*/}
51+
<style>{`
52+
.declarative-gen-ui-wide [class~="cpk:max-w-3xl"] {
53+
max-width: 64rem;
54+
}
55+
`}</style>
4456
</div>
4557
</CopilotKit>
4658
// @endregion[provider-a2ui-prop]

0 commit comments

Comments
 (0)