Skip to content

feat: native @a2ui/angular rendering — custom catalog - #121

Closed
jerelvelarde wants to merge 8 commits into
a2ui-project:mainfrom
jerelvelarde:jerel/pr3-native-catalog
Closed

jerelvelarde wants to merge 8 commits into
a2ui-project:mainfrom
jerelvelarde:jerel/pr3-native-catalog

Conversation

@jerelvelarde

@jerelvelarde jerelvelarde commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Adds @a2ui/angular + @a2ui/web_core for native A2UI rendering, alongside the existing iframe sandbox.
  • An 11-component custom A2UI v0.9 catalog (zod contract) with native Angular renderers — layout (Row / Column / DashboardCard), content (Title / Badge), data display (Metric / PieChart / BarChart / DataTable / FlightCard, with hand-rolled SVG charts), and an interactive Button.
  • An Assembled Components route (/custom-catalog): two example trees assembled from the one catalog, data-model editable with live re-bind.
  • New nav entry + route; renders natively (no 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/angular rendering (no iframe) — 11-component catalog with SVG charts:

Light Dark

@google-cla

google-cla Bot commented Jul 22, 2026

Copy link
Copy Markdown

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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@jerelvelarde
jerelvelarde marked this pull request as ready for review July 23, 2026 12:23
@jerelvelarde
jerelvelarde force-pushed the jerel/pr3-native-catalog branch 2 times, most recently from ef6deb1 to 3f56de9 Compare July 24, 2026 17:47
@jerelvelarde jerelvelarde changed the title feat: native @a2ui/angular rendering — custom catalog, catalog reference, theater, gallery feat: native @a2ui/angular rendering — custom catalog Jul 24, 2026
@jerelvelarde
jerelvelarde force-pushed the jerel/pr3-native-catalog branch 2 times, most recently from 2b5db7d to 41d0120 Compare July 27, 2026 20:32
@jerelvelarde

Copy link
Copy Markdown
Contributor Author

Addressed the Gemini review:

  • Removed the state-propagating effect() in the assembled custom-catalog. State now loads through an explicit loadState() invoked from the selectExample / selectState handlers, so there's no signal-write-inside-effect and the data flow is explicit.

jerelvelarde and others added 8 commits August 28, 2026 05:13
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.
@jerelvelarde
jerelvelarde force-pushed the jerel/pr3-native-catalog branch from 210be67 to 17f0bb0 Compare August 28, 2026 17:38
@jerelvelarde

Copy link
Copy Markdown
Contributor Author

Rebased onto current main and pushed. Verified locally: tsc, prettier, lint clean, full suite green, clean build.

Three things changed beyond the rebase:

  1. Decorative-icon count. composer-shell.spec.ts asserts a hardcoded number of aria-hidden mat-icon elements. main raised it for its new nav item and this branch had raised it for its own, so the rebase collapsed the two identical edits into one and the spec asserted fewer icons than actually render. Corrected. Worth deriving that count from the template at some point — it will catch anyone who adds a nav item on a branch.

  2. Formatting. Several files here had never been through prettier. yarn prettier over them, no logic touched.

  3. Standalone theming. This page is authored against the shell's --cpk-* design tokens, which the theme PR introduces. On its own none of them resolved, so every padding, radius and colour collapsed and the page rendered unstyled. Added styles/_cpk-fallbacks.scss with light and dark defaults under --cpk-fb-*, and each usage is now var(--cpk-x, var(--cpk-fb-x)). The real token always wins where it exists, so nothing shadows or overrides the theme.

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.

@jerelvelarde

Copy link
Copy Markdown
Contributor Author

Superseded by #129.

#129 carries this branch's native @a2ui/angular catalog and its assembled page, along with both review fixes made here: the explicit selectExample / selectState handlers that replaced the signal-writing effect(), and the _cpk-fallbacks.scss layer that lets the page render correctly without the shell theme. On top of that it adds the Definitions and Renderers views, which show the catalog's own source beside the components it renders.

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. jerel/pr3-native-catalog is left in place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant