Skip to content

feat(chat): A2UI surface store per-component readiness (PR A)#295

Merged
blove merged 7 commits into
mainfrom
claude/genui-surface-store-readiness
May 13, 2026
Merged

feat(chat): A2UI surface store per-component readiness (PR A)#295
blove merged 7 commits into
mainfrom
claude/genui-surface-store-readiness

Conversation

@blove
Copy link
Copy Markdown
Contributor

@blove blove commented May 13, 2026

Summary

Phase A of the progressive GenUI rendering redesign. Lib-only foundation that PR B's per-component fallback gate will consume. No visible rendering change in this PR.

  • Adds A2uiViewEntry { component, fallback? } catalog shape (thin alias of @ngaf/render's RenderViewEntry) plus normalizeViewEntry for the bare-Type<unknown> legacy form. Public API gains A2uiViewEntry, A2uiViews, normalizeViewEntry, A2uiComponentView, A2uiSurfaceState.
  • Adds extractBindings(def) — pure helper that pulls {\$.path} references out of a component's prop expressions (dedupe + sort for stable signal identity, recurses into nested records/arrays).
  • Extends A2uiSurfaceStore with parallel surfaceStates / surfaceState() signals carrying per-component bindings and a monotonic ready boolean (flips false → true once all bindings have resolved, stays true thereafter). The wire-format surfaces / surface() API is unchanged; existing consumers (surfaceToSpec, etc.) keep working.

Spec: `docs/superpowers/specs/2026-05-11-progressive-genui-bubble-coalescing-design.md`
Plan: `docs/superpowers/plans/2026-05-11-progressive-genui-bubble-coalescing.md`

Test plan

  • `npx nx test chat` passes (5 new readiness tests + partial-substitution test + props-content assertion)
  • `npx nx build chat` passes
  • No demo/composition behavior change visible at http://localhost:4200/embed (lib-only, additive)

blove and others added 6 commits May 13, 2026 08:23
…de wiring)

Three independent PRs per spec's phasing (order A → B → C):
- PR A — Surface store + catalog shape (lib only) [this branch]
- PR B — <a2ui-surface> per-component rendering (lib only)
- PR C — Backend coalescing + envelope reordering (Python only)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds the { component, fallback? } catalog entry type for the A2UI
surface renderer plus a normalizer that wraps the bare Type<unknown>
form. Public API gains A2uiViewEntry, A2uiViews, normalizeViewEntry.
No rendering change — wires the shape that PR B's per-component
fallback gate consumes.
Pure helper that walks a component's prop bag and returns the
deduplicated, sorted set of data-model references in {\$.path} form.
Consumed by the surface store to compute per-component readiness.
Materialized by the surface store on surfaceUpdate apply with
bindings extracted from prop expressions, ready=false initially,
and an empty props bag. Surface store flips ready -> true once
all bindings have resolved (monotonic).
Surface store now materializes A2uiComponentView entries with
bindings (extracted from \$.path references in prop expressions)
and a monotonic ready signal that flips false -> true once all
bindings have resolved. Exposed via the new surfaceStates /
surfaceState signals; the wire-format surfaces signal is unchanged
so existing consumers (surfaceToSpec etc.) continue to work.
- Export A2uiSurfaceState type from public-api so consumers can write
  the return-type of surfaceState() / surfaceStates.
- Add a test exercising the partial-substitution path in resolveProps
  (mixed literal + {$.path} reference inside a prop string).
- Strengthen the existing 'ready becomes true' test to also assert
  the resolved props content (catches regressions in resolveProps).
@vercel
Copy link
Copy Markdown

vercel Bot commented May 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cacheplane Ready Ready Preview, Comment May 13, 2026 4:46pm

Request Review

- chat: rename test-fixture selectors in views.spec.ts to start with
  the required 'chat-' prefix (was 't-real' / 't-fb').
- website: regenerate chat/api-docs.json so it reflects the new
  A2uiSurfaceState / A2uiComponentView / A2uiViewEntry exports from
  PR A.

CI failures on the last push:
- Library — lint / test / build: 2 component-selector errors fixed.
- Website — lint / build: api-docs drift fixed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@blove blove merged commit 40509f7 into main May 13, 2026
14 checks passed
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.

1 participant