Repository navigation
feat(theme): unify shell and renderer card styling - #119
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 the CopilotKit design system token layer, updating the shell to use custom theme variables, soft background blur circles, and new typography (Plus Jakarta Sans and Spline Sans Mono). Feedback focuses on optimizing performance and accessibility: specifically, offloading the large blur circle rendering to the GPU using transform: translateZ(0) and providing solid background fallbacks via @supports queries for elements using backdrop-filter to ensure readability on unsupported browsers.
245e20d to
2420a63
Compare
d556e91 to
252e020
Compare
|
Addressed the Gemini review:
Rebased onto latest |
⚡ A2UI Composer PR PreviewYour automated preview is successfully live (commit
|
252e020 to
c6fa0bb
Compare
|
Rebased onto latest Verified locally on the rebased branch:
Two notes on what changed underneath since this branch was first opened:
Re: the outstanding Gemini thread on Ready for broader feedback. |
|
Pushed What was failing. Two tests in Root cause. The six decorative background circles used Worse: the Fix. Replaced the blur filter with Bisected locally, all against the same running harness:
Full file now 16/16 (was 14/16), matching One thing worth a second pair of eyes: the gradient is a close approximation of a gaussian, not an exact match, so the wash may read very slightly differently. Happy to tune the stops if it looks off — the preview build should show it. |
bff3c18 to
d6c475d
Compare
d6c475d to
9f91c4f
Compare
5fac378 to
21dba8d
Compare
| @@ -0,0 +1,7 @@ | |||
| # React 0.10.2 CSS module repair | |||
|
|
|||
| The published `@a2ui/[email protected]` bundle replaces its four CSS module maps with empty objects and ships unprocessed `:global(...)` selectors. Functional tests still pass, but headings, buttons, text fields, and choice pickers lose their styles. The current 0.11.1 archive has the same empty maps and also requires a broader web_core migration, so upgrading does not resolve this issue. | |||
There was a problem hiding this comment.
This worries me quite a bit.
If there's a bug in the upstream a2ui libraries, we need to report that and get it fixed. We shouldn't try to work around it here.
There was a problem hiding this comment.
Fair point. I traced this upstream: it’s already reported in a2ui#1307, and a2ui#2639 proposes the package fix. I checked the published 0.10.2 and 0.11.1 packages; both still have the broken class maps.
I’ve linked that work in the README. This needs to stay open until there’s a compatible upstream release, at which point the patch and custom CSS import can go together. Removing them today would leave the React sample unstyled.
There was a problem hiding this comment.
Can you add a note in those tickets that this has to get fixed up when those are resolved?
There was a problem hiding this comment.
| <link rel="preconnect" href="https://fonts.googleapis.com" /> | ||
| <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> | ||
| <link | ||
| href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined" |
There was a problem hiding this comment.
Just double checking -- we need both this and line 23?
There was a problem hiding this comment.
They do different things: line 23 opens the connection to Google Fonts early; this stylesheet actually loads Material Symbols. The preconnect is optional for correctness, but it avoids waiting to establish the connection when the font stylesheet is requested.
| }, | ||
| "dependencies": { | ||
| "@a2ui/react": "0.10.2", | ||
| "@a2ui/react": "patch:@a2ui/react@npm%3A0.10.2#~/.yarn/patches/@a2ui-react-npm-0.10.2-877cbd9ad2.patch", |
There was a problem hiding this comment.
See my other comment in the .yarn/patches/README.md
There was a problem hiding this comment.
Same upstream dependency as the README thread. There isn’t a released version that fixes this yet—even 0.11.1 has the same packaging problem. Keeping this thread open until we can replace the patch with a compatible official release.
| "sourceMap": true, | ||
| "noEmit": true | ||
| "noEmit": true, | ||
| "types": ["vite/client"] |
There was a problem hiding this comment.
Why do we need to add this? (Same question on the tsconfig.json in the react sample.
There was a problem hiding this comment.
It supplies Vite’s type declarations for the CSS imports added to these samples. I checked both sample typechecks with and without it: removing it gives TS2882 on the shared stylesheet import (and the package stylesheet in React); with it, both typechecks pass.
| await page.goto(`/?renderer=${config.rendererUrl}`); | ||
| await expect(page.locator('.workspace-container')).toBeVisible(); | ||
|
|
||
| // Verify actual styles, not just readable DOM text: broken CSS bundles can |
There was a problem hiding this comment.
Should this be in an independent test?
There was a problem hiding this comment.
Yep, pulled the styling assertions into their own test for each renderer. They check the computed font family, button styling, and light surface; the startup test now sticks to the handshake and catalog messages.
| } | ||
|
|
||
| // Shared shell tokens resolve against the active Material theme. Keep the | ||
| // existing --cpk-* names so companion pages inherit the same solid surfaces. |
There was a problem hiding this comment.
Can we keep this simpler by not creating the cpk aliases?
For the cpk- styles that aren't aliases, are they used? Are there Material system tokens that we should be using instead?
There was a problem hiding this comment.
Removed the whole alias layer. Shell styles now reference Material tokens directly, and the unused spacing, radius, shadow, and status tokens are gone. I also updated the Gallery, Settings, and demos consumers so they don’t depend on those aliases. The code font remains an explicit monospace family.
| surface: #fefbff, | ||
| surface-dim: #ddd9d9, | ||
| surface-bright: #fefbff, | ||
| background: #f5f6f8, |
There was a problem hiding this comment.
I'm not entirely sure which of these changes has changed the overall background to (pure?) white...
I think it's probably just me (I tend to run everything in dark mode), but it seems harder on my eyes. WDYT?
There was a problem hiding this comment.
Agreed, the big white surfaces were a bit harsh. I softened the light background and panels to off-white/light gray, including the renderer samples. The recording in the description now shows the updated light/dark treatment.
| ) { | ||
| // Grid groups reference these records, so reject the whole layout rather than | ||
| // leaving dangling references by removing retired or invalid panels. | ||
| throw new Error(`Unsupported saved dockview panel: ${key}`); |
There was a problem hiding this comment.
This scares me.
If this is thrown, what does the user see? What happens to the Composer screen?
There was a problem hiding this comment.
That throw is caught by the layout loader. Composer falls back to its default seven panels, so the invalid saved arrangement isn’t restored but the workspace stays usable. I added a comment at the catch and browser tests that exercise both invalid-layout cases, check the editor is visible, click a preview action, and open Data Model, and check there’s no uncaught error. This is in #217 and inherited here.
| } finally { | ||
| returningFixture?.destroy(); | ||
| errorSpy.mockRestore(); | ||
| if (previousLayout === null) storage.removeItem(LocalStorageKey.DOCKVIEW_LAYOUT); |
There was a problem hiding this comment.
Please always use braces with if/else statements.
Same applies to similar constructs elsewhere.
There was a problem hiding this comment.
Fixed—those branches all use braces now, including the shared cleanup hook in #217.
| const errorSpy = vi.spyOn(console, 'error'); | ||
| let returningFixture: ComponentFixture<ComposerWorkspace> | undefined; | ||
|
|
||
| try { |
There was a problem hiding this comment.
Seems strange to have a try block in a test.
What are we protecting against?
There was a problem hiding this comment.
The finally blocks were there to restore fixtures, spies, and browser storage if an assertion failed; they weren’t catching the failure. I moved that cleanup into an afterEach scoped to the saved-layout tests in #217, so the tests no longer need the try/finally blocks.
9ce38ba to
a797f3b
Compare
|
@wrenj yep, cleaned this up in bcff33e. A2A, the chat panel, and the message inspector now use the same surface colors, and the update events use the shared blue accent. Also fixed the Material controls that were still picking up purple. Checked both light and dark mode — screenshot below, and there’s a recording in the PR description too. |
|
okay great, lgtm, wait for jay to approve, thanks |
|
Awesome! |
Main's preview resilience work (a2ui-project#196) makes the frame follow the renderer's reported content height and asserts it settles on that height. Pinning docked frames to their panel contradicted that, so drop the docked override and let the docked panel scroll instead. The frame keeps its content height and its controls stay reachable without extending beneath the debug panel. Also replace the real-time debounce waits in the saved layout test with fake timers.
Main's new error colour tokens move into the shared sample stylesheet, and the React error overlay keeps its inline styles.
Main's spec tsconfigs replace the sample types with node only, so the build's spec typecheck rejected the shared stylesheet import.
|
Synced with main and the updated #217. Head is now
Formatting, lint, typechecks, the production build, and all unit tests pass. |
|
It looks like some of the code / tests that were moved to #217 are still here. |
Main routes the layout-restore failure through ErrorLogger, so the recovery tests now assert the logged entry and its Errors tab row instead of a console error.
Three things kept panels off --mat-sys-surface: - Dockview puts its own theme classes on inner elements, which redefined the shell's --dv-* variables below the workspace root, so the group background stayed white and the tab strip used Dockview's gray. The variables now also apply to those elements. - Monaco was asked for 'vs-light', which is not a built-in theme, and fell back to its white 'vs' background. The editor now uses light and dark themes whose background is read from the surface token. - A long message origin wrapped inside the fixed-height Raw Messages row and overlapped the next one. It now truncates.
|
Thanks, good catch. Three separate things were keeping panels off the shared surface color. All are fixed in 44eb7ec.
One thing the PR preview can't show: its Rendered A2UI Preview loads the samples deployed from Update: the light theme now puts panels on white, with neutral grays (no blue tint) for the workspace, tab strips, and borders behind them ( Before (left) and after (right), light and dark: A new browser test in On the #217 code: that's a side effect of stacking. GitHub diffs a fork PR against |
The light theme's panels move from a blue-gray off-white to white, and the workspace, tab strips, and borders behind them move to neutral grays with no blue tint. The shared sample stylesheet follows, so the preview matches the panels around it. Dark mode is unchanged.
Regenerated on Linux by the Visual Baselines workflow (run 36046315929).
Main now contains a2ui-project#217 (squashed) and a2ui-project#231's default Data Model tab. The workspace keeps this branch's Dockview variable scoping, and the attachment baseline is regenerated below.
Regenerated on Linux by the Visual Baselines workflow (run 36052706930).
|
Two updates. Head is now
Full e2e: 70 pass, and 2 are flaky (main's React sizing tests). The one failure is |
…ject#119 card styling The baseline committed with a2ui-project#119 does not match what the pinned Playwright container renders for the A2A full chat view, so every PR based on main fails visual-regression on this snapshot. Regenerated from the CI container output.
…ing can't break them (#237) * fix(shell): bind reactive form controls by reference so Closure renaming can't break them Templates looked up reactive form controls by string (formControlName="x", form.get('x')), while the controls were created from unquoted object keys. Under Closure Compiler property renaming those keys are renamed, the lookup returns null, and setUpControl throws during the first change-detection pass, leaving the A2A agent configuration panel half-rendered in optimized google3 builds. Bind every field with [formControl]="form.controls.x" instead, which is plain property access and is renamed consistently. The agent config panel now creates a typed form at field initialization and applies its inputs in ngOnInit. The add-renderer, add-API-key, and MCP server dialogs get the same change. * refactor(shell): type backend option ids as A2aBackendMode Narrow A2aBackendOption.id from string to A2aBackendMode so the agent config form's backendMode control is typed end to end, which removes the cast on save. With the form now non-nullable, drop the null fallback on tenantId and update the spec that set it to null. * test(shell): update a2a-full-chat-view visual baseline after #119 card styling The baseline committed with #119 does not match what the pinned Playwright container renders for the A2A full chat view, so every PR based on main fails visual-regression on this snapshot. Regenerated from the CI container output. * test(shell): regenerate a2a-full-chat-view baseline via Visual Baselines workflow Replaces the previous baseline with the one produced by the Visual Baselines workflow (visual_baselines.yml) in the pinned Playwright container, per the README instructions. * test(shell): commit remaining baselines from Visual Baselines workflow Adds the other snapshots the Visual Baselines workflow regenerated in the same run, so the committed baselines match the pinned Playwright container output.
|
Following up from a2ui-project/a2ui#1307 (comment), @jerelvelarde: We just closed a2ui-project/a2ui#1307 (and repurposed a2ui-project/a2ui#2639 to build-config cleanup only). Rather than patching the React-specific v0.9 basic catalog or backporting to When Composer upgrades Filed: #315 |






Summary
Give Composer readable light/dark surfaces, blue accents, and consistent cards. Angular, Lit, and React samples share typography, spacing, controls, and borderless Card surfaces. Theme changes preserve iframe identity and form state.
Shell styles use Angular Material system tokens directly, without a second
--cpk-*alias layer. A2A, the Composer chat panel, and the protocol inspector share the same neutral panel surfaces in light and dark modes. Routine update labels, agent controls, and loading indicators use the shared primary accent; errors retain their distinct error colors. Inputs and nested content use a consistent subtle surface treatment. Renderer style assertions run independently from the telemetry tests.Upstream dependency: the published React package still has broken CSS class maps in both 0.10.2 and 0.11.1. This is tracked in a2ui#1307, with a proposed fix in a2ui#2639. The temporary version-pinned patch must be removed together with its custom CSS import once a compatible official release ships working styles. Jay's two comments about that dependency remain open;
.yarn/patches/README.mdrecords the evidence and removal condition.Recording
Full-resolution MP4. Recorded on
e45b60dagainst the local dev servers: the A2A conversation and inspector on white panels, a draft preserved through light/dark/light changes, then the Composer chat, preview, JSON editor, and raw messages in both themes. Deterministic mock agent; no API key, live model call, or source/CSS overrides.Earlier renderer-control recording covers the renderer styling and action/state preservation on
7341d52.Scope and dependencies
The Gallery redesign and editing are in #129. The Settings page layout is in #218. Neither page-specific layout is part of this branch.
This PR depends on #217, which contains saved-layout restoration and docked-preview containment. Its workspace changes are included in the cumulative diff against
main. A separate 1280×480 browser regression now verifies that even short docked previews keep their controls reachable.Merge #217 → #119, then #129, #193, or #218 independently. #215 follows #129; #216 follows #215. Rebase descendants after a squash merge to trim inherited changes.
Validation
Published head:
bcff33e. The upstream workflow currently requires maintainer approval; it has not run on this head.The final application source,
b153dfd, passes Composer CI: build, unit tests, all 59 behavioral browser cases, and all 16 pinned Linux visual tests. Updated screenshots come from the successful pinned Linux baseline workflow on that same source. The following commit updates only those screenshot baselines.