Skip to content

Phase 1: Shell Layout & Complete Startup Resolution Scaffolding - #2

Merged
jgindin merged 11 commits into
mainfrom
phase-1
Jun 1, 2026
Merged

jgindin merged 11 commits into
mainfrom
phase-1

Conversation

@jgindin

@jgindin jgindin commented May 26, 2026

Copy link
Copy Markdown
Contributor

The developer can launch the application standalone in their browser, observe the permanent top header bar titled "A2UI Composer" and the persistent left-hand navigation sidebar, navigate seamlessly between the primary Composer workspace and the Components Gallery placeholder page by clicking entries in the sidebar via Angular routing, click the prominent "New Session" button in the header to observe session state clears, and have the application resolve its target renderer URL reliably through a consolidated priority engine (evaluating static config.json locks, URL query parameters, and LocalStorage).

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Important

Installation incomplete: to start using Gemini Code Assist, please ask the organization owner(s) to visit the Gemini Code Assist Admin Console and sign the Terms of Services.

@jgindin
jgindin force-pushed the phase-1 branch 5 times, most recently from 96416da to 7b8104f Compare May 27, 2026 14:48
jgindin added 11 commits May 27, 2026 10:50
Initialize the standalone Angular v21 workspace configuration, pin exact
baseline package dependencies, setup yarn v4 linker policy, and scaffold
initial placeholder components for all primary feature folders adhering
to the Domain-Driven architecture tree. Every component uses separated
templates, separated styles, custom test harnesses, and harness-driven
unit tests.

TAG=agy
CONV=0e0596eb-433c-4742-9c61-3162831c96c6
Build out the A2UI Composer permanent top header toolbar displaying the
static title, embed the New Session reset button wired to flush session
state, and implement the persistent left-hand navigation sidebar
wrapping the primary Angular router outlet. Every component uses
separated templates, separated styles, custom test harnesses, and
harness-driven unit tests exclusively.

TAG=agy
CONV=0e0596eb-433c-4742-9c61-3162831c96c6
Build out the initialization priority resolution mechanics inside a
dedicated StartupResolutionService provider loaded via APP_INITIALIZER,
evaluating static config.json fetches with a 5-second watchdog timeout,
URL query parameters, and LocalStorage persistence, enforcing context
locking boundaries when overrides are prohibited.

TAG=agy
CONV=0e0596eb-433c-4742-9c61-3162831c96c6
Build out the QueryParser utility inside src/app/shell/query-parser.ts,
enforcing deterministic missing fallbacks, malformed string stripping
with console warnings, take-first-valid URI evaluation, and prohibiting
embedded API keys. Integrates directly into StartupResolutionService
step 2 priority evaluation chain. Includes complete active verb unit
test suites.

TAG=agy
CONV=0e0596eb-433c-4742-9c61-3162831c96c6
Map dedicated routing paths wrapping the primary workspace mounting
dashboard and the components gallery placeholder page, wiring clean
view swaps. Every component uses separated templates, separated styles,
custom test harnesses, and harness-driven unit tests exclusively.

TAG=agy
CONV=0e0596eb-433c-4742-9c61-3162831c96c6
Define concrete CachedCatalogRecord and capability Catalog TypeScript
model interfaces, and initialize the sandboxed IndexedDB catalogs object
store with keyPath mapping using native Promise wrappers to avoid
third-party library overhead. Includes complete active verb unit test
suites.

TAG=agy
CONV=0e0596eb-433c-4742-9c61-3162831c96c6
Build out resilient write wrappers wrapping IndexedDB transactions in
atomic QuotaExceededError rollbacks to prevent database corruption,
enforcing the hard LRU capacity limit of 10 distinct catalog origins,
evicting down to the 3 most recent upon an initial quota error, and
logging a visible warning while flushing ALL remaining records upon an
extreme double quota retry error.

TAG=agy
CONV=0e0596eb-433c-4742-9c61-3162831c96c6
Set up playwright.config.ts local web server execution parameters and
build out the standalone e2e/startup-resolution.e2e.ts integration test
suite verifying full Phase 1 user capabilities: launching standalone,
observing permanent headers, navigating seamlessly between central
workspace and gallery via sidebar routing links, resetting session
state via the prominent button, and evaluating priority resolution
fallbacks.

TAG=agy
CONV=0e0596eb-433c-4742-9c61-3162831c96c6
Added button to the header bar to switch between the themes.

Enable collapsing / expanding of the left-hand panel with a hamburger
menu.
`yarn e2e` now properly works.
Tests are run using Chrome.
Browser opens to show test results after all tests complete.
Comment thread src/app/shell/query-parser.ts Resolved
@jgindin
jgindin merged commit a8ed069 into main Jun 1, 2026
9 checks passed
@jgindin
jgindin deleted the phase-1 branch June 3, 2026 17:23
mikzat added a commit to mikzat/a2uicomposer that referenced this pull request Oct 7, 2026
Adds e2e/a2a-multi-frame-surfaces.e2e.ts. A stubbed agent answers each
turn with a surface whose root Column holds an inline Text and a Canvas
card (autoOpen: false). The test sends turn one, opens its canvas, sends
turn two, opens that canvas, and then checks every frame's document:
each inline frame shows its own "INLINE SURFACE #n" and the side canvas
shows "CANVAS CONTENT a2ui-project#2".

On main the last step fails: the second inline frame shows "CANVAS
CONTENT a2ui-project#2", because the canvas payload is dispatched to whichever frame
registered last. On this branch it passes (3/3 repeats).

connectMockAgent/setupMockA2aRoutes take an optional per-request
responder so a test can script turn-specific replies; the existing
keyword routing is unchanged when it is omitted. sseEvent is exported for
building those replies.
mikzat added a commit that referenced this pull request Oct 8, 2026
…s stop clobbering each other (#252)

* fix(shell): track renderer readiness per iframe so concurrent surfaces stop clobbering each other

The /a2a route mounts several renderer iframes at once: one per inline chat
surface plus the side canvas. HostCommunication tracked readiness with a
single global flag, reset it and wiped the whole outbound queue whenever any
iframe registered, and sendMessage read that flag inside the components'
effects. Opening the canvas therefore briefly flipped every frame back to
"not ready", re-ran every RenderedFrame effect, and queued and replayed the
inline surfaces' payloads. A2aChatView compounded this by also sending the
canvas payload with no target, which goes to the most recently registered
iframe: on first open that is still the inline frame, so the canvas content
is drawn inline for roughly 600 ms and the inline surface is then recreated
(losing its data model); when the canvas is already open and a newer turn
has mounted its own inline frame, that inline surface is overwritten for
good.

Readiness is now recorded per guest window. A message is posted as soon as
its own frame has announced RENDERER_READY, regardless of siblings that are
still loading, and a frame's RENDERER_READY flushes only the messages
addressed to it (plus untargeted ones, as before). Registering a frame
discards only that frame's previous readiness and queued messages, and
unregisterIframe releases the window and its queued messages even when the
element already left the DOM. The duplicate untargeted sendRenderA2UI
effects in A2aChatView are removed; the canvas RenderedFrame already sends
its payload to its own iframe. The one spec that expected a frame's queued
message to be delivered when a *different* frame became ready now expects
delivery on that frame's own handshake, since a renderer that has not
announced itself drops the message anyway.

* fix(shell): queue untargeted sends for a detached default frame; ignore sourceless RENDERER_READY

Follow-up to the per-frame readiness tracking, addressing two review
comments.

An untargeted send resolves to the default (most recently registered)
frame. When that frame's element is registered but momentarily has no
window, `isTargetReady` previously fell through to the overall readiness
flag, so with a ready sibling the message was handed to `sendMessage`
with no window to post to and dropped. The default is now resolved up
front and handled like an explicit target, so the message waits for the
frame to announce itself.

A RENDERER_READY without a source window can no longer flip the overall
readiness flag, keeping it consistent with the per-window bookkeeping.
Real guest frames always carry a source; only synthetic events lack one.

* fix(shell): send the handshake theme only to the announcing frame; read readiness untracked in sendMessage

Follow-ups from review:

- RENDERER_READY now sends SET_THEME to the frame that announced itself
  instead of calling sendTheme(), which broadcast to every frame on every
  handshake (and, for the default frame, through the queue as well, so a
  second frame's handshake re-sent the theme to the first). sendTheme()
  itself now posts to each registered frame that is up and skips frames
  still handshaking, since those receive the current theme on their own
  RENDERER_READY; a queued copy would only arrive as a duplicate. The
  direct-postMessage loop is gone; everything goes through sendMessage.
- MCP_REQUEST marks the source frame ready and flushes the queue, the same
  as a handshake, so a frame whose RENDERER_READY was missed does not wait
  for some other frame's handshake to receive its queued messages.
- sendMessage reads readiness through untracked(). Callers run inside
  component effects (RenderedFrame's payload and theme effects); readiness
  must not become a dependency of those effects or every frame's handshake
  would re-run them and re-send their payloads.
- Docs: isRendererReady is described as the aggregate it is,
  resolveTargetWindow names the default frame precisely, and the
  registerIframe/unregisterIframe comments say why untargeted queued
  messages are dropped on unregister.
- Specs assert on what each window receives via postMessage instead of
  reaching into the private buffer, and cover the effect-dependency,
  per-frame theme, and MCP_REQUEST flush cases. The A2aChatView spec now
  asserts the canvas payload reaches the side-canvas iframe and that no
  canvas payload is ever sent without a target.

* test(shell): cover the multi-frame A2A journey end to end

Adds e2e/a2a-multi-frame-surfaces.e2e.ts. A stubbed agent answers each
turn with a surface whose root Column holds an inline Text and a Canvas
card (autoOpen: false). The test sends turn one, opens its canvas, sends
turn two, opens that canvas, and then checks every frame's document:
each inline frame shows its own "INLINE SURFACE #n" and the side canvas
shows "CANVAS CONTENT #2".

On main the last step fails: the second inline frame shows "CANVAS
CONTENT #2", because the canvas payload is dispatched to whichever frame
registered last. On this branch it passes (3/3 repeats).

connectMockAgent/setupMockA2aRoutes take an optional per-request
responder so a test can script turn-specific replies; the existing
keyword routing is unchanged when it is omitted. sseEvent is exported for
building those replies.

* fix(shell): make a sourceless RENDERER_READY a no-op; match the file's return-type convention

- A RENDERER_READY without a source window already did not mark anything
  ready, but still went on to send the handshake theme untargeted, which
  queued a stray SET_THEME for the default frame. The whole branch now
  requires a source window. The spec for this case now drives the
  detached default frame through its real handshake afterwards and
  checks it receives the theme exactly once; without the guard it
  received two.
- Reuse envelope.sourceWindow instead of computing the source a second
  time.
- The private methods added in this PR carry explicit return types like
  the rest of the file.
- The e2e journey's first-open assertions are documented as a
  steady-state check: the brief flash the old code showed until the
  canvas frame's handshake is not something a retrying assertion can pin
  down; the permanent variant of the misrouting is what the test guards.

* test(shell): find the side canvas iframe through the harness

The canvas payload dispatch specs located the side canvas iframe with a
By.css query. A2aChatViewHarness now exposes the RenderedFrame inside the
side canvas viewport, RenderedFrameHarness hands out its guest iframe, and
the specs resolve the element from there (via
TestbedHarnessEnvironment.getNativeElement, since the assertion is about
which element the host posts to).
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