showcase/integrations/langgraph-python/qa/declarative-gen-ui.md
/demos/declarative-gen-ui on the dashboard host/api/copilotkit/health or the host's /api/health); OPENAI_API_KEY is set on Railway; LANGGRAPH_DEPLOYMENT_URL points at a LangGraph deployment exposing the a2ui_dynamic graph (registered as agent name declarative-gen-ui — see src/app/api/copilotkit-declarative-gen-ui/route.ts)data-testid attributes. Checks below rely on verbatim visible text, DOM structure, and inline-style fingerprints declared in src/app/demos/declarative-gen-ui/a2ui/renderers.tsx/demos/declarative-gen-ui; verify the page renders within 3s and a single CopilotChat pane is centered (max-width ~896px, rounded-2xl, full-height)runtimeUrl="/api/copilotkit-declarative-gen-ui" and agent="declarative-gen-ui" (DevTools → Network: sending a message hits that endpoint, not /api/copilotkit)a2ui={{ catalog: myCatalog }})a2ui_operations container with catalogId: "declarative-gen-ui-catalog" (matches CUSTOM_CATALOG_ID in src/agents/a2ui_dynamic.py and createCatalog(..., { catalogId: "declarative-gen-ui-catalog" }) in a2ui/catalog.ts)render_a2ui Tool Call (secondary-LLM pattern)Metric tiles (each: uppercase label with letterSpacing: 0.12em, large value in 1.5rem/600 weight, optional ↑/↓ trend arrow — green #189370 for up, red #FA5F67 for down)SYSTEM_PROMPT: "Keep chat replies to one short sentence; let the UI do the talking.")PieChart Renderer (catalog component + includeBasicCatalog merge)#010507) and description (0.85rem, color #57575B)<svg> with transform: scaleX(-1)) containing a grey background <circle> plus one stroked <circle> per slice (at least 2 slices)%; percentages sum to 100% (rounding-tolerant)#BEC2FF and subsequent slices cycle through the CHART_COLORS palette (#85ECCE, #FFAC4D, #FFF388, …)BarChart Renderer (Recharts + barSlideIn keyframe)ResponsiveContainer at height 280<rect> bar elements render, X-axis tick labels match the backend label values, Y-axis ticks are numeric, and the scoped @keyframes barSlideIn animation fires on first paint (bars translate up from translateY(40px) to 0)CHART_COLORS and bars have rounded top corners (radius: [6, 6, 0, 0])Card + InfoRow + StatusBadge + PrimaryButton (catch-all custom-component coverage)Card (white background, 1px #DBDBE5 border, 16px border-radius, 20px padding) with a bold titleStatusBadge pill renders — uppercase 0.1em-tracked text, rounded-pill (borderRadius: 999), one of the 4 variants (success green, warning orange, error red #FA5F67, info lilac #BEC2FF)InfoRow renders inside a Card: label (0.85rem, color #57575B) on the left, value (0.9rem, 500 weight, color #010507) on the right, separated by a 1px bottom border #E9E9EFPrimaryButton, verify it renders as a black (#010507) pill-rounded button with white text; hovering changes background to #2B2B2BCard, StatusBadge, Metric, InfoRow, PrimaryButton, PieChart, BarChart. If any did not, send a follow-up prompt targeting the missing one (e.g. "give me a one-button call-to-action card" to force PrimaryButton)generate_a2ui (no a2ui_operations in the response stream, no surface rendered)path-binding on a catalog rendererrender_a2ui is called exactly once per surface-producing prompt; result contains a valid a2ui_operations container with catalogId: "declarative-gen-ui-catalog"myDefinitions shape (Zod prop names from a2ui/definitions.ts line up with values visible in the DOM)