Repository navigation
Shared preview editor layout - #232
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the ComposerDockview layout architecture to implement a more structured workspace, including specific panel groupings and initial sizing constraints. E2E and unit tests were updated to accommodate these changes. The review feedback identifies dead code in the layout initialization, a tautological unit test that should be addressed, and a missing mock restoration in the test suite that could cause test pollution.
⚡ A2UI Composer PR PreviewYour automated preview is successfully live (commit
|
8cb4c30 to
4ae9db7
Compare
4ae9db7 to
3bdb4ab
Compare
3bdb4ab to
456939b
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a Reset Layout toolbar button to restore the Dockview workspace back to its default panel configuration and proportions, clearing any persisted layout from local storage. It also refactors the workspace layout so that the Rendered A2UI Preview and A2UI JSON Editor share the same tab group instead of being positioned side-by-side. Feedback on the changes suggests removing redundant manual tab clicks in the end-to-end user journey tests, as the waitForMonacoEditor helper already handles activating the tab.
Tab A2UI JSON Editor within the Rendered A2UI Preview dockview group with Preview active by default and JSON Editor inactive. Update E2E test journeys to switch to the A2UI JSON Editor tab prior to Monaco interactions and switch back to Rendered Preview when asserting on the preview iframe. Wait for Monaco to be attached in E2E helpers so background tab evaluation succeeds without forced tab switching. Add unit test asserting Rendered Preview and JSON Editor share the same dockview group with Rendered active.
- Remove dead code in enforceInitialProportions where raw and rendered panels were checked for separate groups. - Rewrite tautological width balancing test to verify debug drawer width matches the shared preview and editor group width. - Restore Storage.prototype.getItem spy in finally block to prevent test pollution.
- Dispatch OpenPanelEvent for ComposerPanelId.Raw in RawFrame snackbar action handlers so "Go to line" switches to the JSON Editor tab. - Add unit tests verifying OpenPanelEvent dispatch on snackbar actions. - Remove redundant renderedPanel setActive call in initial layout.
Add Reset Layout button to main header toolbar to restore Dockview panels and split proportions to initial default state. Dispatch ResetLayoutEvent to reset Dockview workspace and clear saved layout from localStorage. Synchronize active panel state and update overlay render positions immediately and in an animation frame so primary panels are immediately visible. Include unit tests and Playwright E2E layout recovery coverage.
Address review comments on PR 232 by removing redundant manual tab clicks on the A2UI JSON Editor tab prior to waitForMonacoEditor in user journey E2E tests, relying on the helper to activate the tab.
In theme-consistency.e2e.ts, activate and wait for the A2UI JSON Editor tab via waitForMonacoEditor prior to asserting Monaco editor background color, accounting for the shared tab group layout where the Rendered Preview tab is active by default.
456939b to
3f686fa
Compare
suyangw-g
left a comment
There was a problem hiding this comment.
Thanks for addressing the previous review feedback! Reviewed the new Reset Layout feature (776f02b) — leaving 2 P1 comments on resetLayout() state preservation and cross-route behavior.
Hide the New Session, Reset Layout, and Share toolbar buttons in ComposerShell on non-workspace routes (/gallery, /a2a, /settings) while keeping the theme toggle button visible on all routes. Add unit tests in composer-shell.spec.ts and Playwright E2E coverage in workspace-routing-bootstrapping.e2e.ts.
Subscribe directly to messageStream$ in RenderedFrame so intermediate SURFACE_RESIZE events are not dropped by signal effect coalescing when followed immediately by DATA_MODEL_CHANGE or RENDER_SUCCESS. Add unit test for rapid burst messages and Playwright E2E assertion verifying overlay and iframe height fill the container after layout reset.
When resetting the workspace layout or mounting complex multi-component surfaces, the preview frame could become clipped to the 130px initial fallback banner height due to premature resize measurements and circuit breaker latching. - In preview-bridge: skip scheduling SURFACE_RESIZE measurement during the synchronous unmount phase of the two-step dispatch, measuring only after the replacement surface mounts. - In host-communication: reset isRendererReady to false when all iframes are unregistered so that outbound messages buffer until the new iframe emits RENDERER_READY. - In composer-dockview: set inactive: true on secondary panels during layout initialization to prevent unintended tab activation. - In rendered-frame: increase MAX_MONOTONIC_GROWTH_REPORTS from 8 to 16, reset the growth run on RENDER_SUCCESS, iframe load, and iframe registration, and hold the frame at current height instead of resetting to the run start height on latch.
a2ui-project#232 put the JSON editor and the preview in one tab group, and a2ui-project#253's New Session opens with an empty canvas snapshot. - replaceMonacoJson shows the editor tab to edit it and the preview tab afterwards, so tests click a visible preview. - The 360px embed checks use a 630px viewport: the preview now takes the whole group, so the old 1145px viewport made it twice as wide. The score-table check runs at that width too and polls until the table scrolls inside it. - The CopilotKit panel no longer hides an empty snapshot that opens the conversation; New Session shows it as "0 components in this canvas".
Adds the two new baselines from the visual_baselines workflow run and takes the six existing ones it regenerated along with them. Five of those differ only in wall-clock timestamps and antialiasing (well under the 2% threshold). a2a-full-chat-view.png also drops the New Session and share buttons from the toolbar: a2ui-project#232 hides them on non-workspace routes such as /a2a, and that baseline had not been regenerated since, so this catches it up with what the shell renders today.
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.
a2ui-project#232 put the JSON editor and the preview in one tab group, and a2ui-project#253's New Session opens with an empty canvas snapshot. - replaceMonacoJson shows the editor tab to edit it and the preview tab afterwards, so tests click a visible preview. - The 360px embed checks use a 630px viewport: the preview now takes the whole group, so the old 1145px viewport made it twice as wide. The score-table check runs at that width too and polls until the table scrolls inside it. - The CopilotKit panel no longer hides an empty snapshot that opens the conversation; New Session shows it as "0 components in this canvas".
Adds the two new baselines from the visual_baselines workflow run and takes the six existing ones it regenerated along with them. Five of those differ only in wall-clock timestamps and antialiasing (well under the 2% threshold). a2a-full-chat-view.png also drops the New Session and share buttons from the toolbar: a2ui-project#232 hides them on non-workspace routes such as /a2a, and that baseline had not been regenerated since, so this catches it up with what the shell renders today.
…ve the message text (#261) * test(shell): add a visual baseline for an inline surface rendered above the message text #256 made the inline surface card follow the order the agent sent its parts, so a surface that arrives before the text now renders above it. The unit specs cover the ordering, but nothing checks what the bubble actually looks like, and jgindin flagged it as a good candidate for a visual test. The new test drives the mock agent through two turns, surface-then-text and text-then-surface, waits for both guest frames to draw, and snapshots each agent bubble on its own so the first one is not cropped by the history's scroll-to-bottom. * test(shell): commit the workflow-generated visual baselines Adds the two new baselines from the visual_baselines workflow run and takes the six existing ones it regenerated along with them. Five of those differ only in wall-clock timestamps and antialiasing (well under the 2% threshold). a2a-full-chat-view.png also drops the New Session and share buttons from the toolbar: #232 hides them on non-workspace routes such as /a2a, and that baseline had not been regenerated since, so this catches it up with what the shell renders today. * test(shell): send the inline surface with the canonical A2UI MIME type * test(shell): fix the clock in the visual specs that show inspector timestamps The inspector drawer baseline and the full chat view baseline both contain the inspector's event timestamps, so they changed on every regeneration. The validation-errors spec already pins the clock with page.clock.setFixedTime, which keeps timers and the stream running; do the same in the other two. * test(shell): keep the baselines that only differed by antialiasing Four regenerated baselines differed from main by at most 0.05% of pixels with nothing above the antialiasing noise floor, well under the 2% threshold, so leave them as they are on main. * test(shell): regenerate the two inspector baselines with the fixed clock Workflow output; both now show 11:24:22 AM and will stay that way. * test(shell): regenerate the inspector baselines after the rebase onto main Only the two baselines whose specs pin the clock change; the rest came back different by antialiasing noise alone and stay as they are on main.
a2ui-project#232 put the JSON editor and the preview in one tab group, and a2ui-project#253's New Session opens with an empty canvas snapshot. - replaceMonacoJson shows the editor tab to edit it and the preview tab afterwards, so tests click a visible preview. - The 360px embed checks use a 630px viewport: the preview now takes the whole group, so the old 1145px viewport made it twice as wide. The score-table check runs at that width too and polls until the table scrolls inside it. - The CopilotKit panel no longer hides an empty snapshot that opens the conversation; New Session shows it as "0 components in this canvas".
a2ui-project#232 put the JSON editor and the preview in one tab group, and a2ui-project#253's New Session opens with an empty canvas snapshot. - replaceMonacoJson shows the editor tab to edit it and the preview tab afterwards, so tests click a visible preview. - The 360px embed checks use a 630px viewport: the preview now takes the whole group, so the old 1145px viewport made it twice as wide. The score-table check runs at that width too and polls until the table scrolls inside it. - The CopilotKit panel no longer hides an empty snapshot that opens the conversation; New Session shows it as "0 components in this canvas".
a2ui-project#232 put the JSON editor and the preview in one tab group, and a2ui-project#253's New Session opens with an empty canvas snapshot. - replaceMonacoJson shows the editor tab to edit it and the preview tab afterwards, so tests click a visible preview. - The 360px embed checks use a 630px viewport: the preview now takes the whole group, so the old 1145px viewport made it twice as wide. The score-table check runs at that width too and polls until the table scrolls inside it. - The CopilotKit panel no longer hides an empty snapshot that opens the conversation; New Session shows it as "0 components in this canvas".
Description
Have the Preview and JSON dockviews share a "tab group":

Pre-launch Checklist