Skip to content

Re-enable the change: Upgrade A2UI examples to v0.9 schema#759

Draft
nan-yu wants to merge 1 commit intomainfrom
revert-758-revert-751-examples-0.9
Draft

Re-enable the change: Upgrade A2UI examples to v0.9 schema#759
nan-yu wants to merge 1 commit intomainfrom
revert-758-revert-751-examples-0.9

Conversation

@nan-yu
Copy link
Collaborator

@nan-yu nan-yu commented Mar 3, 2026

Reverts the revert PR #758, which basically re-enables #751.

@github-project-automation github-project-automation bot moved this to Todo in A2UI Mar 3, 2026
@nan-yu nan-yu marked this pull request as draft March 3, 2026 18:01
@nan-yu
Copy link
Collaborator Author

nan-yu commented Mar 3, 2026

Make it a draft PR for now, and will change it to ready for review when the v0.9 renderer is ready.

Copy link
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 primarily focuses on migrating A2UI examples and agent configurations from version 0.8 to 0.9. Key changes include updating version constants from VERSION_0_8 to VERSION_0_9 across multiple agent files (agent.py, prompt_builder.py, __main__.py). The UI_DESCRIPTION prompts are adjusted to reflect the new updateDataModel.value property instead of dataModelUpdate.contents and variant: "primary" for buttons instead of primary: true. All example JSON files are updated to the 0.9 schema, introducing createSurface, updateComponents, and updateDataModel messages, along with camelCase icon names (e.g., calendarToday, locationOn). A new Python script, migrate_v08_to_v09.py, is added to automate this migration process, handling the transformation of message types, component properties, and data model structures. Additionally, the a2ui_examples.py and prompt_builder.py files in contact_multiple_surfaces are updated to dynamically load inline catalogs and examples based on the new versioning scheme. Review comments highlight the need to consistently use camelCase for icon names in the 0.9 schema and suggest a safer way to access dictionary keys in the migration script to prevent IndexError.

Comment on lines +12 to +13
m_val_key = [mk for mk in m_item.keys() if mk.startswith("value")][0]
m_val = m_item[m_val_key]
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This list comprehension with index [0] is unsafe and will raise an IndexError if no key in m_item starts with "value". Using next() with a default value would be safer and more robust, similar to the implementation on line 189.

    m_val_key = next((mk for mk in m_item.keys() if mk.startswith("value")), None)
    if m_val_key is None:
      continue
    m_val = m_item[m_val_key]

@jacobsimionato
Copy link
Collaborator

Make it a draft PR for now, and will change it to ready for review when the v0.9 renderer is ready.

I'm curious, what would stop us from reviewing and merging this now?

@jacobsimionato
Copy link
Collaborator

(and nice work getting this done so fast, even with the rollback!!)

@nan-yu
Copy link
Collaborator Author

nan-yu commented Mar 3, 2026

Make it a draft PR for now, and will change it to ready for review when the v0.9 renderer is ready.

I'm curious, what would stop us from reviewing and merging this now?

The original PR was reviewed and merged, but with the ADK agent on v0.9 and renderer on v0.8, the samples stopped working. So we decided to wait until the v0.9 renderer is ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants