Skip to content

Refine renderer guide, add Gallery App specifications, and strengthen generic constraints#821

Merged
jacobsimionato merged 8 commits intogoogle:mainfrom
jacobsimionato:guide-update
Mar 13, 2026
Merged

Refine renderer guide, add Gallery App specifications, and strengthen generic constraints#821
jacobsimionato merged 8 commits intogoogle:mainfrom
jacobsimionato:guide-update

Conversation

@jacobsimionato
Copy link
Copy Markdown
Collaborator

@jacobsimionato jacobsimionato commented Mar 11, 2026

Description of Changes

  • Model Reactivity Updates: Clarified principles for the unsubscribe pattern, payload support, and ensured consistency across all state models.
  • Type Safety: Strengthened generic type constraints across SurfaceLifecycleListener, SurfaceGroupModel, SurfaceModel, MessageProcessor, ComponentContext, and Catalog to extend ComponentApi.
  • DataContext Clarification: Added note about the instantiating system's responsibility to provide available functions as a FunctionInvoker.
  • Client Capabilities Generation: Added comprehensive documentation on dynamically generating the a2uiClientCapabilities payload, including schema type locations, detectable common types via tags (REF:), and required test cases.
  • Catalog API Expansion: Detailed models for Catalog, ComponentApi, FunctionApi, and FunctionImplementation. Added guidelines on function observability and return types.
  • The Gallery App Specification: Introduced a new major section defining the UX architecture (three-column layout) and integration testing requirements for the reference Gallery App.
  • Agent Implementation Guide: Replaced the "Demo Application" milestone with the more robust "Gallery Application" milestone to align with the new specifications.

Rationale

  • Clarity & Consistency: These updates clarify the responsibilities of the data context, reactivity mechanisms, and provide a much more structured approach to client capabilities generation.
  • Standardization: Strengthening generic constraints helps prevent invalid types from being used as component implementations across different renderers.
  • Reference Implementation Guidance: Formally defining the Gallery App ensures that all A2UI renderer implementations have a consistent, high-quality reference environment for debugging and integration testing.

Testing/Running Instructions

  • This is a documentation-only change. Review the markdown file specification/v0_9/docs/renderer_guide.md for accuracy, formatting, and readability.

- Enhanced the Standard Observer Pattern details with clear Unsubscribe Pattern notes and Payload Support specifics.
- Added clarification that the instantiating system is responsible for extracting functions from the Catalog.
- Replaced the brief overview with a highly detailed section on 'Generating Client Capabilities and Schema Types'.
- Inserted a new rationale detailing observability consistency and function categorizations.
- Replaced the brief 'Demo Application' outline with the full, detailed 'The Gallery App' documentation.
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

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 significantly enhances the renderer_guide.md by adding more detail, examples, and new sections. The changes improve clarity on the observer pattern, DataContext responsibilities, and client capabilities generation. The new sections on "Function Implementation Rationale" and "The Gallery App" are excellent additions that provide valuable guidance for developers. The "Agent Implementation Guide" has also been updated consistently. I've identified a couple of minor areas for improvement to enhance clarity and consistency in the documentation.

1. It translates the definition into a raw JSON Schema.
2. It traverses the schema tree looking for string descriptions starting with the `REF:` tag.
3. It strips the tag and replaces the entire node with a valid JSON Schema `$ref` object.
3. It strips the tag and replaces the entire node with a valid JSON Schema `$ref` object, preserving any actual developer descriptions using a separator token.
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.

medium

The documentation mentions a "separator token" for preserving developer descriptions alongside REF: tags, but it doesn't specify what this token is. For clarity, it would be helpful to explicitly state that the separator is a pipe character (|) and provide an example, like REF:common_types.json#/$defs/DynamicString|This is a developer description.. This would make it easier for implementers to follow the specification.

Suggested change
3. It strips the tag and replaces the entire node with a valid JSON Schema `$ref` object, preserving any actual developer descriptions using a separator token.
3. It strips the tag and replaces the entire node with a valid JSON Schema `$ref` object, preserving any actual developer descriptions using a separator token (the pipe character `|`).

Comment on lines +701 to +702
* **Reactive Logic**: Opening the "Capitalize Text" sample and typing into the input must result in the upper-case version of the text appearing dynamically in the associated output component.
* **Action Context Scoping**: Opening the "Incremental List" sample and clicking a "Book now" button must emit an action containing the correctly resolved restaurant name (e.g., "The Golden Fork") in its context, proving that dynamic values within actions are correctly scoped to their containing list item.
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.

medium

The integration testing requirements mention the "Capitalize Text" and "Incremental List" samples. However, these sample files don't seem to be present in the repository under specification/v0_9/json/catalogs/minimal/examples/ or specification/v0_9/json/catalogs/basic/examples/. To avoid confusion for developers trying to implement and run these tests, it would be beneficial to either add these missing sample files or update the documentation to reference existing examples that demonstrate the same concepts.

@jacobsimionato jacobsimionato changed the title docs: Update renderer guide with detailed architecture docs(a2ui): refine renderer guide, add Gallery App specifications, and strengthen generic constraints Mar 12, 2026
@jacobsimionato jacobsimionato changed the title docs(a2ui): refine renderer guide, add Gallery App specifications, and strengthen generic constraints Refine renderer guide, add Gallery App specifications, and strengthen generic constraints Mar 12, 2026
## Implementation Topologies
## 1. Unified Architecture Overview

The A2UI client architecture follows a strict, unidirectional data flow that bridges language-agnostic data structures with native UI frameworks.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not really unidirectional, though, right? There are events that go the other direction.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair. I removed this!

@jacobsimionato jacobsimionato merged commit c95cf7a into google:main Mar 13, 2026
8 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in A2UI Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants