feat(chat): A2UI surface store per-component readiness (PR A)#295
Merged
Conversation
…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).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- 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>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
A2uiViewEntry { component, fallback? }catalog shape (thin alias of@ngaf/render'sRenderViewEntry) plusnormalizeViewEntryfor the bare-Type<unknown>legacy form. Public API gainsA2uiViewEntry,A2uiViews,normalizeViewEntry,A2uiComponentView,A2uiSurfaceState.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).A2uiSurfaceStorewith parallelsurfaceStates/surfaceState()signals carrying per-componentbindingsand a monotonicreadyboolean (flipsfalse → trueonce all bindings have resolved, staystruethereafter). The wire-formatsurfaces/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