Repository navigation
feat: Theater route — A2UI message-stream playback (native @a2ui/angular) - #130
jerelvelarde wants to merge 12 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 a 'Custom Catalog' page and a 'Theater' playback route to the shell application, allowing users to render assembled components natively and replay recorded A2UI message streams. It adds several custom catalog components (such as charts, tables, and cards) along with their respective schemas, styles, and tests. The review feedback focuses on improving robustness against invalid or malformed user-provided JSON inputs. Specifically, the reviewer recommends adding type checks and optional chaining in the data table, pie chart, bar chart, catalog editor, and theater inspector to prevent potential runtime crashes and TypeErrors when parsing or binding dynamic data.
922f023 to
d00bd0e
Compare
⚡ A2UI Composer PR PreviewYour automated preview is successfully live (commit
|
b6ca3a6 to
4d7d5e2
Compare
|
Addressed the Gemini review — the catalog is driven by user-editable JSON in the Monaco editor, so these harden against malformed input:
|
|
Went back through the Gemini review comments on this PR and resolved them — all five were already addressed in the current code:
One thing worth flagging that the bot did not catch here: Holding off on rebasing until the refactor stack lands, per our chat. |
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.
Transport (reset/step/play-pause), clickable message timeline, and an Events/Data/Config inspector over a native @a2ui/angular surface.
The native renderer.processMessages needs createSurface + updateComponents in one call (as the Assembled/Reference pages send); applying them incrementally left the surface root empty. Each seek now replays [0,target) as one batch on a fresh generation, creating the surface in the same tick the template switches to its id (no mount-before-create gap). Also drops the v0.9 envelope's top-level version field, which the native processor does not consume.
…inst malformed JSON
The composer-shell spec asserts a hardcoded number of aria-hidden MatIcon elements. This branch adds two nav items and raised the count from 5 to 7; main independently raised it from 5 to 6. The rebase kept one increment, so bump it to 8 to match what renders. Also runs prettier over sources that had never been formatted.
These pages are authored against the shell's --cpk-* design tokens, which are introduced by a separate PR. On their 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.
4d7d5e2 to
3918f12
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. The screenshots here previously showed an un-played surface ("Press play…"). Retaken with the stream replayed to 6/6 so the description actually shows what Theater builds. |
|
Parking Theater until Composer has real session capture and an agreed playback workflow. The branch is preserved for reference. The current implementation replays bundled examples and carries the earlier native custom-catalog implementation; a future proposal should use captured sessions and the selected renderer/catalog. |
A "theater" that replays a recorded A2UI message stream into a live native surface, message by message — useful for demoing and debugging how a surface builds up over a generation.
What
/theaterroute with a playback component and a generation-based playback engine.@a2ui/angular(no iframe); replays the message prefix as a batch so the native surface renders correctly at each step.Why
Makes the incremental, message-by-message nature of A2UI surfaces visible — a useful lens for demos and for debugging streamed generations.
Testing
ng build(lint + AOT) green on a clean build;theater+composer-shellunit tests pass (25 specs).Contributed by CopilotKit.
Screenshots
/theater— A2UI message-stream playback: