Repository navigation
feat(gallery): reorganize and edit selected-catalog examples - #129
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 a custom 11-component dashboard catalog, a code-generation script to bundle source files, and integrates 'Custom Catalog' and 'Catalog Reference' views into the shell routes and sidebar navigation, complete with unit tests. Feedback focuses on improving robustness: clamping negative values to zero in BarChart and PieChart to prevent invalid SVG rendering, and adding a safety guard in DataTable to prevent runtime errors if a row is null or undefined.
bb86b15 to
6d4e210
Compare
|
Addressed the Gemini review:
Rebased onto latest |
|
Went back through the Gemini review comments on this PR and resolved them — all three were already addressed in the current code:
Holding off on rebasing this one until the refactor stack lands, per our chat. |
6d4e210 to
4d7d4dd
Compare
|
Rebased onto current Four 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. |
655c892 to
835c45a
Compare
5a99f5a to
630dbea
Compare
630dbea to
361dc39
Compare
⚡ A2UI Composer PR PreviewYour automated preview is successfully live (commit
|
|
Thanks, all three are in. Head is now More properties. The editor now lists every property in the component's schema except
Required properties come first and are marked, the component's own properties follow, and the ones every component shares ( This also exposed that the sample renderers' examples for Button, ChoicePicker, Image, Slider, and TextField used property names the v0.9 catalog doesn't define. ChoicePicker, for example, used DateTimeInput layout. Each property now takes its own row, with the name on the left and the control on the right, so Tabs instead of the two groups. The preview card has Preview and Edit JSON tabs. The JSON tab holds the single editable example, and "Current component JSON" is gone, since Reset example covers going back to the original. The tab group keeps its content mounted, so the preview iframe isn't reloaded when you switch. Unit tests cover each control type, adding and removing optional properties, invalid JSON leaving the draft alone, and bindings being preserved. The four Gallery browser journeys are updated for the tabs and pass. |
|
Synced with main ( |
|
thanks for the PR! i like the direction. Couple things
|
A renderer-owned Slack catalog (samples/react-slack-catalog, served on port 3460) previews A2UI surfaces as Slack Block Kit messages and exports the same validated Block Kit JSON, with no Slack credentials. - 11 Slack components with Gallery examples, native TextField and date-only DateTimeInput controls with writable bindings, aligned tables, diagnostics for approximated layouts, and Block Kit export. - A built-in Book a Car form as real canvas content. - Catalog-aware Gemini/CopilotKit generation and refinement, plus a switchRenderer frontend tool; catalog responses from a detached or replaced renderer cannot overwrite the active catalog. - Slack assets in local, GitHub Pages, and PR-preview builds. - Browser journeys wait for the preview to settle before interacting, so a late render cannot reset a field mid-typing. Built on a2ui-project#215 and independent of the Gallery redesign in a2ui-project#129; the Gallery journey reads examples from main's Gallery.
A renderer-owned Slack catalog (samples/react-slack-catalog, served on port 3460) previews A2UI surfaces as Slack Block Kit messages and exports the same validated Block Kit JSON, with no Slack credentials. - 11 Slack components with Gallery examples, native TextField and date-only DateTimeInput controls with writable bindings, aligned tables, diagnostics for approximated layouts, and Block Kit export. - A built-in Book a Car form as real canvas content. - Catalog-aware Gemini/CopilotKit generation and refinement, plus a switchRenderer frontend tool; catalog responses from a detached or replaced renderer cannot overwrite the active catalog. - Slack assets in local, GitHub Pages, and PR-preview builds. - Browser journeys wait for the preview to settle before interacting, so a late render cannot reset a field mid-typing. Built on a2ui-project#215 and independent of the Gallery redesign in a2ui-project#129; the Gallery journey reads examples from main's Gallery.
A renderer-owned Slack catalog (samples/react-slack-catalog, served on port 3460) previews A2UI surfaces as Slack Block Kit messages and exports the same validated Block Kit JSON, with no Slack credentials. - 11 Slack components with Gallery examples, native TextField and date-only DateTimeInput controls with writable bindings, aligned tables, diagnostics for approximated layouts, and Block Kit export. - A built-in Book a Car form as real canvas content. - Catalog-aware Gemini/CopilotKit generation and refinement, plus a switchRenderer frontend tool; catalog responses from a detached or replaced renderer cannot overwrite the active catalog. - Slack assets in local, GitHub Pages, and PR-preview builds. - Browser journeys wait for the preview to settle before interacting, so a late render cannot reset a field mid-typing. Built on a2ui-project#215 and independent of the Gallery redesign in a2ui-project#129; the Gallery journey reads examples from main's Gallery.
A renderer-owned Slack catalog (samples/react-slack-catalog, served on port 3460) previews A2UI surfaces as Slack Block Kit messages and exports the same validated Block Kit JSON, with no Slack credentials. - 11 Slack components with Gallery examples, native TextField and date-only DateTimeInput controls with writable bindings, aligned tables, diagnostics for approximated layouts, and Block Kit export. - A built-in Book a Car form as real canvas content. - Catalog-aware Gemini/CopilotKit generation and refinement, plus a switchRenderer frontend tool; catalog responses from a detached or replaced renderer cannot overwrite the active catalog. - Slack assets in local, GitHub Pages, and PR-preview builds. - Browser journeys wait for the preview to settle before interacting, so a late render cannot reset a field mid-typing. Built on a2ui-project#215 and independent of the Gallery redesign in a2ui-project#129; the Gallery journey reads examples from main's Gallery.
Gemini keeps generating and editing A2UI; CopilotKit's Angular chat interface (@copilotkit/angular 0.5.2) provides the Assistant panel's message cards and prompt composer. Composer's existing services still own model requests, catalog instructions, history, validation, and editor updates. - One rounded input pill with an Add (+) menu for attachments, a screenshot, Instructions, and Custom Instructions, plus a renderer selector that waits for the new renderer's catalog. - The current canvas is synchronized before every prompt, and the model is told to use the draft's real surface IDs, component IDs, and bindings. Incremental edits keep the full draft; updates to unknown surfaces are rejected and the last valid canvas is kept. - The conversation input survives canvas snapshot changes, and a restored draft is resynchronized after model changes. - Attachments, screenshots, retry, stop, copy, the parse-error card, and light/dark themes are preserved. This branch is built directly on main and no longer depends on the Gallery redesign in a2ui-project#129: the assistant journeys open their draft through the JSON editor instead of the Gallery.
A renderer-owned Slack catalog (samples/react-slack-catalog, served on port 3460) previews A2UI surfaces as Slack Block Kit messages and exports the same validated Block Kit JSON, with no Slack credentials. - 11 Slack components with Gallery examples, native TextField and date-only DateTimeInput controls with writable bindings, aligned tables, diagnostics for approximated layouts, and Block Kit export. - A built-in Book a Car form as real canvas content. - Catalog-aware Gemini/CopilotKit generation and refinement, plus a switchRenderer frontend tool; catalog responses from a detached or replaced renderer cannot overwrite the active catalog. - Slack assets in local, GitHub Pages, and PR-preview builds. - Browser journeys wait for the preview to settle before interacting, so a late render cannot reset a field mid-typing. Built on a2ui-project#215 and independent of the Gallery redesign in a2ui-project#129; the Gallery journey reads examples from main's Gallery.
Gemini keeps generating and editing A2UI; CopilotKit's Angular chat interface (@copilotkit/angular 0.5.2) provides the Assistant panel's message cards and prompt composer. Composer's existing services still own model requests, catalog instructions, history, validation, and editor updates. - One rounded input pill with an Add (+) menu for attachments, a screenshot, Instructions, and Custom Instructions, plus a renderer selector that waits for the new renderer's catalog. - The current canvas is synchronized before every prompt, and the model is told to use the draft's real surface IDs, component IDs, and bindings. Incremental edits keep the full draft; updates to unknown surfaces are rejected and the last valid canvas is kept. - The conversation input survives canvas snapshot changes, and a restored draft is resynchronized after model changes. - Attachments, screenshots, retry, stop, copy, the parse-error card, and light/dark themes are preserved. This branch is built directly on main and no longer depends on the Gallery redesign in a2ui-project#129: the assistant journeys open their draft through the JSON editor instead of the Gallery.
A renderer-owned Slack catalog (samples/react-slack-catalog, served on port 3460) previews A2UI surfaces as Slack Block Kit messages and exports the same validated Block Kit JSON, with no Slack credentials. - 11 Slack components with Gallery examples, native TextField and date-only DateTimeInput controls with writable bindings, aligned tables, diagnostics for approximated layouts, and Block Kit export. - A built-in Book a Car form as real canvas content. - Catalog-aware Gemini/CopilotKit generation and refinement, plus a switchRenderer frontend tool; catalog responses from a detached or replaced renderer cannot overwrite the active catalog. - Slack assets in local, GitHub Pages, and PR-preview builds. - Browser journeys wait for the preview to settle before interacting, so a late render cannot reset a field mid-typing. Built on a2ui-project#215 and independent of the Gallery redesign in a2ui-project#129; the Gallery journey reads examples from main's Gallery.
f867aa3 to
ebba70b
Compare
* feat: pair Gemini + CopilotKit in the Composer assistant Gemini keeps generating and editing A2UI; CopilotKit's Angular chat interface (@copilotkit/angular 0.5.2) provides the Assistant panel's message cards and prompt composer. Composer's existing services still own model requests, catalog instructions, history, validation, and editor updates. - One rounded input pill with an Add (+) menu for attachments, a screenshot, Instructions, and Custom Instructions, plus a renderer selector that waits for the new renderer's catalog. - The current canvas is synchronized before every prompt, and the model is told to use the draft's real surface IDs, component IDs, and bindings. Incremental edits keep the full draft; updates to unknown surfaces are rejected and the last valid canvas is kept. - The conversation input survives canvas snapshot changes, and a restored draft is resynchronized after model changes. - Attachments, screenshots, retry, stop, copy, the parse-error card, and light/dark themes are preserved. This branch is built directly on main and no longer depends on the Gallery redesign in #129: the assistant journeys open their draft through the JSON editor instead of the Gallery. * refactor(chat): provide the CopilotKit panel through DI The chat panel's shared state and actions move into ChatPanelBase. The dependency-free ChatPanel (main's template) and CopilotKitChatPanel both extend it, and the workspace mounts whichever CHAT_PANEL_COMPONENT names. The token defaults to ChatPanel; the open-source app provides the CopilotKit panel in app.config.ts. All CopilotKit code, including its stylesheet and theme, now lives in chat/copilotkit-chat-panel, so a build without that provider never imports @copilotkit/angular. Also documents resolveLayoutUpdate in ChatCoordinator. * fix(chat): label the renderer selector with each renderer's configured name The selector no longer maps specific renderer IDs to its own labels, so new or internal renderers need no code change to appear correctly. * style: brace every if statement this change adds * test(e2e): open instruction dialogs from the Add menu in the custom instructions journey The CopilotKit panel moves both instruction links into the Add (+) menu. The journey also waits for the dialog's open animation before measuring it. * refactor(chat): move the renderer selector out and keep the shared base as main's panel - Remove the renderer selector (the pill menu, RendererSelection, and the renderer switching changes in StartupResolution, SettingsService, and RenderedFrame). It moves to its own PR so it can be discussed separately. - ChatPanelBase is main's ChatPanel logic again: its history, status text, and bubble classes are unchanged. The only differences are that the class is abstract, two fields are protected, and submitPrompt repeats the Send button's checks because pressing Enter calls it directly. - The CopilotKit panel prepares its own view of the history, with comments on how and why it differs from the plain panel. - Add FORCE_PLAIN_CHAT_PANEL, a local storage flag that makes the app mount the plain panel, so browser tests can cover both panels. * test: cover both chat panels and simplify the assistant journeys - Run the custom instructions and malformed-stream journeys against both the CopilotKit panel and the plain panel. - Open the assistant journeys' draft through a shared design link instead of setting Monaco's model directly. - Check the chat panel with @axe-core/playwright instead of a hand-written contrast calculation. - Replace the dark-mode gradient check with a visual test of the CopilotKit panel. - Document the Gemini fixture and drop its timed delay; the Stop journey already holds the stream open until the app cancels it. * test(visual): add the Linux baseline for the CopilotKit panel in dark mode
A renderer-owned Slack catalog (samples/react-slack-catalog, served on port 3460) previews A2UI surfaces as Slack Block Kit messages and exports the same validated Block Kit JSON, with no Slack credentials. - 11 Slack components with Gallery examples, native TextField and date-only DateTimeInput controls with writable bindings, aligned tables, diagnostics for approximated layouts, and Block Kit export. - A built-in Book a Car form as real canvas content. - Catalog-aware Gemini/CopilotKit generation and refinement, plus a switchRenderer frontend tool; catalog responses from a detached or replaced renderer cannot overwrite the active catalog. - Slack assets in local, GitHub Pages, and PR-preview builds. - Browser journeys wait for the preview to settle before interacting, so a late render cannot reset a field mid-typing. Built on a2ui-project#215 and independent of the Gallery redesign in a2ui-project#129; the Gallery journey reads examples from main's Gallery.
A renderer-owned Slack catalog (samples/react-slack-catalog, served on port 3460) previews A2UI surfaces as Slack Block Kit messages and exports the same validated Block Kit JSON, with no Slack credentials. - 11 Slack components with Gallery examples, native TextField and date-only DateTimeInput controls with writable bindings, aligned tables, diagnostics for approximated layouts, and Block Kit export. - A built-in Book a Car form as real canvas content. - Catalog-aware Gemini/CopilotKit generation and refinement, plus a switchRenderer frontend tool; catalog responses from a detached or replaced renderer cannot overwrite the active catalog. - Slack assets in local, GitHub Pages, and PR-preview builds. - Browser journeys wait for the preview to settle before interacting, so a late render cannot reset a field mid-typing. Built on a2ui-project#215 and independent of the Gallery redesign in a2ui-project#129; the Gallery journey reads examples from main's Gallery.
A renderer-owned Slack catalog (samples/react-slack-catalog, served on port 3460) previews A2UI surfaces as Slack Block Kit messages and exports the same validated Block Kit JSON, with no Slack credentials. - 11 Slack components with Gallery examples, native TextField and date-only DateTimeInput controls with writable bindings, aligned tables, diagnostics for approximated layouts, and Block Kit export. - A built-in Book a Car form as real canvas content. - Catalog-aware Gemini/CopilotKit generation and refinement, plus a switchRenderer frontend tool; catalog responses from a detached or replaced renderer cannot overwrite the active catalog. - Slack assets in local, GitHub Pages, and PR-preview builds. - Browser journeys wait for the preview to settle before interacting, so a late render cannot reset a field mid-typing. Built on a2ui-project#215 and independent of the Gallery redesign in a2ui-project#129; the Gallery journey reads examples from main's Gallery.
…N with tabs The example editor only offered properties the example already set to a plain string, number, or boolean, so required properties such as ChoicePicker's options, and optional ones such as displayStyle, could not be edited. It now lists every schema property except the id, component, and constants, and picks the control from the schema: a select for enums (with "(not set)" for optional ones), a checkbox, a number or text input, or a JSON field for arrays and objects. Bound or computed values show a note instead of being overwritten. Required properties come first, properties every component shares sit under "Common properties", and each property takes its own row, so booleans no longer wrap. The Example JSON and Current component JSON groups are replaced by Preview and Edit JSON tabs on the preview card, with the single editable example in the JSON tab. The tab group preserves its content so the preview iframe stays mounted. The sample renderers' Button, ChoicePicker, Image, Slider, and TextField examples used property names the v0.9 catalog does not define (for example selections instead of the required value), which the new editor made visible. They now use the catalog's names.
- JSON fields such as accessibility stacked their name above a full-width box while every other property sat beside its control. They now use the same two columns, with the name aligned to the top of the taller field. - The remove button's column is reserved on every row, so a control no longer changes width when a value is set or cleared. - A required property the example does not set shows "Required, but this example doesn't set it." instead of an empty field that looks fine.
A catalog property typed as, e.g., ["string", "null"] now accepts any of the listed types. Moved here from a2ui-project#215 so the assistant PR no longer changes Gallery code.
…across the shell The rebased Gallery logs its load, dispatch, and copy failures through a tagged ErrorLogger instead of console, and its tests spy on ErrorLogger.
Since a2ui-project#232 the rendered preview and the JSON editor share one dockview tab group, so the "Open in Composer" journey now waits for the preview tab, as the shared-link journey does, before asserting on its iframe.
ebba70b to
33c372b
Compare
A renderer-owned Slack catalog (samples/react-slack-catalog, served on port 3460) previews A2UI surfaces as Slack Block Kit messages and exports the same validated Block Kit JSON, with no Slack credentials. - 11 Slack components with Gallery examples, native TextField and date-only DateTimeInput controls with writable bindings, aligned tables, diagnostics for approximated layouts, and Block Kit export. - A built-in Book a Car form as real canvas content. - Catalog-aware Gemini/CopilotKit generation and refinement, plus a switchRenderer frontend tool; catalog responses from a detached or replaced renderer cannot overwrite the active catalog. - Slack assets in local, GitHub Pages, and PR-preview builds. - Browser journeys wait for the preview to settle before interacting, so a late render cannot reset a field mid-typing. Built on a2ui-project#215 and independent of the Gallery redesign in a2ui-project#129; the Gallery journey reads examples from main's Gallery.
A renderer-owned Slack catalog (samples/react-slack-catalog, served on port 3460) previews A2UI surfaces as Slack Block Kit messages and exports the same validated Block Kit JSON, with no Slack credentials. - 11 Slack components with Gallery examples, native TextField and date-only DateTimeInput controls with writable bindings, aligned tables, diagnostics for approximated layouts, and Block Kit export. - A built-in Book a Car form as real canvas content. - Catalog-aware Gemini/CopilotKit generation and refinement, plus a switchRenderer frontend tool; catalog responses from a detached or replaced renderer cannot overwrite the active catalog. - Slack assets in local, GitHub Pages, and PR-preview builds. - Browser journeys wait for the preview to settle before interacting, so a late render cannot reset a field mid-typing. Built on a2ui-project#215 and independent of the Gallery redesign in a2ui-project#129; the Gallery journey reads examples from main's Gallery.
A renderer-owned Slack catalog (samples/react-slack-catalog, served on port 3460) previews A2UI surfaces as Slack Block Kit messages and exports the same validated Block Kit JSON, with no Slack credentials. - 11 Slack components with Gallery examples, native TextField and date-only DateTimeInput controls with writable bindings, aligned tables, diagnostics for approximated layouts, and Block Kit export. - A built-in Book a Car form as real canvas content. - Catalog-aware Gemini/CopilotKit generation and refinement, plus a switchRenderer frontend tool; catalog responses from a detached or replaced renderer cannot overwrite the active catalog. - Slack assets in local, GitHub Pages, and PR-preview builds. - Browser journeys wait for the preview to settle before interacting, so a late render cannot reset a field mid-typing. Built on a2ui-project#215 and independent of the Gallery redesign in a2ui-project#129; the Gallery journey reads examples from main's Gallery.
|
Closing. Turned over to another team. |
A renderer-owned Slack catalog (samples/react-slack-catalog, served on port 3460) previews A2UI surfaces as Slack Block Kit messages and exports the same validated Block Kit JSON, with no Slack credentials. - 11 Slack components with Gallery examples, native TextField and date-only DateTimeInput controls with writable bindings, aligned tables, diagnostics for approximated layouts, and Block Kit export. - A built-in Book a Car form as real canvas content. - Catalog-aware Gemini/CopilotKit generation and refinement, plus a switchRenderer frontend tool; catalog responses from a detached or replaced renderer cannot overwrite the active catalog. - Slack assets in local, GitHub Pages, and PR-preview builds. - Browser journeys wait for the preview to settle before interacting, so a late render cannot reset a field mid-typing. Built on a2ui-project#215 and independent of the Gallery redesign in a2ui-project#129; the Gallery journey reads examples from main's Gallery.


Summary
Try a component from the selected renderer's catalog, adjust its example, and use the result in Composer. The Gallery redesign separates Preview, Usage, and Properties into cards. The Usage card edits every property in the component's schema, and the Preview card switches between the live preview and the editable example JSON with tabs. This PR owns the Gallery layout changes previously bundled into #119, including responsive drawer behavior and reachable controls in tall previews.
Each draft starts from the renderer's usage example or the Gallery's existing schema fallback. Valid edits immediately update the same renderer preview. Invalid JSON shows an error and preserves the last valid preview and export payload. Copy and Open in Composer use that same complete A2UI draft; opening preserves the selected renderer and changes the workspace only after the user chooses it.
This replaces the earlier custom-catalog page with editing inside the existing guarded Gallery. The selected catalog remains authoritative. Switching component, catalog, or renderer starts a new draft; routine acknowledgments and theme changes preserve edits. Authored root trees and child references remain intact, including custom catalog schemas; the Gallery no longer invents Column wrappers or properties for preview/export.
See it
Full-resolution MP4. Recorded on
34ea3deagainst the local dev servers: ChoicePicker's requiredoptionsandvaluecome first; setting the unsetdisplayStyleto chips and adding an option through theoptionsJSON field both update the live preview. The Edit JSON tab holds the single editable example, and Reset example restores the original. DateTimeInput then shows one property per row. No API key or live model call is used.Property editor. It lists every schema property except
id,component, and constants, including optional ones the example doesn't set, and picks the control from the schema: a select for enums (with "(not set)" for optional ones), a checkbox, a number or text input, or a JSON field for arrays and objects. Required properties come first; properties every component in the catalog shares sit under "Common properties". A value bound to the data model or computed by a function call shows a note pointing to the JSON tab and is never overwritten. The tab group keeps its content mounted, so switching tabs doesn't reload the preview iframe.Gallery text sizes, weights, line heights, tracking, and colors use Material system tokens. Cards use Material's shape/elevation defaults; code retains a monospace family with Material typography metrics.
Scope and merge order
#217 and #119 have merged, and this branch is rebased onto
main(5f346b1), so the diff is only this PR's own work: 13 files, covering the Gallery component and its tests, the Gallery browser journeys, and the three sample renderers' usage examples (main has since removed the MCP sample). The Button, ChoicePicker, Image, Slider, and TextField examples used property names the v0.9 catalog doesn't define (ChoicePicker usedselectionsinstead of the requiredvalue), which the new editor made visible; they now use the catalog's names. The Settings layout is isolated in #218. #193 (the demo wall) and #215 (the chat panel) are independent of it.Validation
Rebased onto
mainat5f346b1(after #232, #238, #252, #253, #256, #257 and #260); head is33c372b. The one conflict was ingallery.spec.ts, where #232 added aStateSyncmock in the same place this PR adds its catalog fixtures; both are kept. #232 also put the workspace's JSON editor and preview in one tab group, so the "Open in Composer" journey now shows the preview tab before checking the workspace iframe. Earlier, the rebase onto #245 routed the Gallery's four error paths throughErrorLogger, tagged[Gallery].build-and-testandvisual-regressionon the fork).CatalogSchemaResolverto take anErrorLogger; the Gallery andparseGalleryExamplenow pass one.