Repository navigation
feat: native @a2ui/angular rendering — custom catalog - #121
jerelvelarde wants to merge 8 commits into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request introduces several new features and architectural updates, including a native /custom-catalog route with assembled demo components, a /catalog-reference route for component documentation and source viewing, a /theater route for protocol playback, and a masonry /gallery showcase. The existing components gallery has been moved to /basic-catalog. Feedback focuses on improving code robustness and aligning with Angular best practices. Specifically, the path resolution in the gallery codegen script should be made more resilient to standard clone structures, and Angular effects used for propagating state changes and writing to signals in CustomCatalog and CatalogReference should be replaced with explicit state updates in event handlers and view-switching methods.
ef6deb1 to
3f56de9
Compare
2b5db7d to
41d0120
Compare
|
Addressed the Gemini review:
|
Enables in-app (no-iframe) rendering of custom catalogs. Pin shell zod to
3.25.76 so app-authored catalog schemas share the exact zod instance the
@a2ui/web_core binder introspects (Angular's own zod 4 stays nested/isolated).
Validated end-to-end: a shell-authored custom Title resolves a {path} binding
via <a2ui-v09-surface>.
Port of the react-flight-catalog dashboard catalog to native @a2ui/angular renderers (Row/Column/Title/Badge/Metric/DashboardCard/FlightCard/DataTable/ Button + hand-rolled SVG PieChart/BarChart), themed via --cpk-* tokens. buildDashboardCatalog() registers all 11 into an AngularCatalog. Surface-render tests green (children, chart shapes, path bindings, action dispatch).
Native /custom-catalog page: renders the Flight Card + Sales Dashboard trees via <a2ui-v09-surface> (no iframe) from the 11-component dashboard catalog, with an editable Monaco data-model panel. Example toggle + data-state tabs (Morning/Afternoon, Q1-Q4); editing the JSON live-updates the surface via updateDataModel. Surfaces are built once per example (createSurface+ updateComponents), so data changes push updateDataModel only. Nav item added to Google's list; shell spec nav counts updated for the new route.
The composer-shell spec asserts a hardcoded number of aria-hidden MatIcon elements. Both this branch and main independently raised it from 5 to 6, so the rebase kept a single increment while seven icons now render. Bump it to 7. Also runs prettier over the custom-catalog sources, which had never been formatted.
This page is authored against the shell's --cpk-* design tokens, which are introduced by a separate PR. On its own none of the tokens resolve, so every padding, radius, font and colour collapsed and the page rendered unstyled. Add a small styles/_cpk-fallbacks.scss partial supplying light and dark defaults under --cpk-fb-* names, and reference each token as var(--cpk-x, var(--cpk-fb-x)). The real token always wins where it exists, so nothing here shadows or overrides the theme; the fallbacks apply only in its absence. Dark values are keyed off the existing .dark-theme class via :host-context, so the standalone page themes correctly too.
210be67 to
17f0bb0
Compare
|
Rebased onto current Three things changed beyond the rebase:
Screenshots in the description have been retaken against this branch. Note on ordering: this still looks best merged after the theme layer. The fallbacks are there so it reviews correctly on its own, not to replace the theme. |
|
Superseded by #129. #129 carries this branch's native The two branches had already drifted once, and keeping both open means maintaining two copies of the same catalog. Closing this one in favour of the single branch. |
Adds native (no-iframe) A2UI v0.9 rendering via
@a2ui/angular, with an 11-component custom catalog as the first showcase. This is the foundation of a three-PR set — everything here is what the other two build on.What
@a2ui/angular+@a2ui/web_corefor native A2UI rendering, alongside the existing iframe sandbox./custom-catalog): two example trees assembled from the one catalog, data-model editable with live re-bind.startupGuard/iframe).Why
Demonstrates the native rendering path and provides a reusable component catalog that the follow-up PRs build directly on.
Testing
ng build(lint + AOT) green on a clean build; custom-catalog + shell unit tests pass (25 specs).Split note
Originally opened as one large PR spanning custom catalog + catalog reference + theater. Per review-size feedback it's now split into three stacked PRs, all based on
main:Because cross-repo PRs must target
main, #129 and #130 include this PR's commits in their diffs until this one merges.Contributed by CopilotKit.
Screenshots
Native
@a2ui/angularrendering (no iframe) — 11-component catalog with SVG charts: