Skip to content

Shared preview editor layout - #232

Merged
jgindin merged 9 commits into
mainfrom
shared-preview-editor-layout
Oct 6, 2026
Merged

jgindin merged 9 commits into
mainfrom
shared-preview-editor-layout

Conversation

@jgindin

@jgindin jgindin commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Description

Have the Preview and JSON dockviews share a "tab group":
image

Pre-launch Checklist

  • I signed the [CLA].
  • I read the [Contributors Guide].
  • I read the [Style Guide].
  • I have added updates to the [CHANGELOG].
  • I updated/added relevant documentation.
  • My code changes (if any) have tests.
  • If my branch is on fork, I have verified that scripts/e2e_test.sh passes.

@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 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.

@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

⚡ A2UI Composer PR Preview

Your automated preview is successfully live (commit b598ba1):
👉 Launch PR Preview

Note: This environment will be wiped automatically when the PR is merged or closed.

@suyangw-g suyangw-g 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 Summary (PR #232)

Reviewed against Google TypeScript/Angular readability (go/tsstyle), interactive quality (go/a11y), and lifecycle invariants.

See inline comments for P1 findings.

@jgindin
jgindin force-pushed the shared-preview-editor-layout branch 2 times, most recently from 8cb4c30 to 4ae9db7 Compare September 24, 2026 17:28
@jgindin
jgindin requested a review from suyangw-g September 24, 2026 17:36
@jgindin
jgindin force-pushed the shared-preview-editor-layout branch from 4ae9db7 to 3bdb4ab Compare September 24, 2026 18:48
@jgindin
jgindin force-pushed the shared-preview-editor-layout branch from 3bdb4ab to 456939b Compare October 5, 2026 12:54
@jgindin

jgindin commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

@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 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.

Comment thread shell/e2e/user-journey.e2e.ts Resolved
Comment thread shell/e2e/user-journey.e2e.ts Resolved
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.
@jgindin
jgindin force-pushed the shared-preview-editor-layout branch from 456939b to 3f686fa Compare October 5, 2026 15:58

@suyangw-g suyangw-g 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.

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.
@jgindin
jgindin merged commit c19eed5 into main Oct 6, 2026
15 checks passed
@jgindin
jgindin deleted the shared-preview-editor-layout branch October 6, 2026 01:10
jerelvelarde added a commit to jerelvelarde/a2ui-composer that referenced this pull request Oct 6, 2026
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".
mikzat added a commit to mikzat/a2uicomposer that referenced this pull request Oct 8, 2026
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.
jerelvelarde added a commit to jerelvelarde/a2ui-composer that referenced this pull request Oct 9, 2026
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.
jerelvelarde added a commit to jerelvelarde/a2ui-composer that referenced this pull request Oct 9, 2026
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".
mikzat added a commit to mikzat/a2uicomposer that referenced this pull request Oct 12, 2026
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.
mikzat added a commit that referenced this pull request Oct 12, 2026
…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.
jerelvelarde added a commit to jerelvelarde/a2ui-composer that referenced this pull request Oct 15, 2026
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".
jerelvelarde added a commit to jerelvelarde/a2ui-composer that referenced this pull request Oct 16, 2026
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".
jerelvelarde added a commit to jerelvelarde/a2ui-composer that referenced this pull request Oct 19, 2026
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".
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.

2 participants