Skip to content

Fix icons and modals in 0.8, support 0.8 in the angular explorer app and add missing 0.8 integration tests#1405

Closed
josemontespg wants to merge 20 commits into
google:mainfrom
josemontespg:angular-explorer-version-toggle
Closed

Fix icons and modals in 0.8, support 0.8 in the angular explorer app and add missing 0.8 integration tests#1405
josemontespg wants to merge 20 commits into
google:mainfrom
josemontespg:angular-explorer-version-toggle

Conversation

@josemontespg
Copy link
Copy Markdown
Collaborator

@josemontespg josemontespg commented May 12, 2026

This PR Fixes the modal and icon components in the 0.8 basic catalog. Also implements a dropdown in the Angular explorer sample app to switch between v0.8 and v0.9 specifications and renderers, to help with manual and automated testing.

Key changes:

  • Modal: Fixed modal overlay rendering inline, instead of in an overlay.
  • Icon: Fixed icons not rendering when the icon name used camelCase or TitleCase.
  • Version Toggle: Added a dropdown in the sidebar to switch between 0.8 and 0.9.
  • URL Parameter: Added support for ?version=0.8 URL parameter to load a specific version directly.
  • Examples: Updated generate-examples.mjs to bundle examples for both versions.
  • Integration tests: Added integration tests for the Angular explorer app to test the 0.8 core, renderer and basic catalog. These tests run also in CI.

Why:

The motivation for these tests is http://b/511068435#comment3 because we were missing a test for the 0.8 modal component. I found that we were missing 0.8 tests for the explorer app, which is already a great sample app to exercise many different features and edge cases for 0.8.

Testing:

  • Verified the 0.8 examples by running the Angular explorer app. The URL param works, and components/icons render correctly.
  • Added unit tests for the icon and modal fixes. Also, added one integration test for each of the example JSONs

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 introduces multi-version support (v0.8 and v0.9) to the A2UI Explorer, enabling users to toggle between versions via a new UI selector. The changes include refactoring the example generation script to bundle messages for both versions, updating the AgentStubService and DemoComponent to handle version-specific message processing, and enhancing v0.8 components such as the Modal and Icon. Feedback was provided regarding a bug in the Icon component's name resolution logic, where the regex conversion to snake_case incorrectly prepends an underscore to leading uppercase characters.

Comment thread renderers/angular/src/v0_8/components/icon.ts Outdated
@josemontespg josemontespg changed the title feat(angular-explorer): Add version toggle and fix v0.8 rendering fix icons and modals in 0.8, support 0.8 in the angular explorer app and add missing 0.8 integration tests May 12, 2026
@josemontespg josemontespg changed the title fix icons and modals in 0.8, support 0.8 in the angular explorer app and add missing 0.8 integration tests Fix icons and modals in 0.8, support 0.8 in the angular explorer app and add missing 0.8 integration tests May 12, 2026
@josemontespg josemontespg marked this pull request as ready for review May 12, 2026 23:28
@polina-c
Copy link
Copy Markdown
Member

For your future PRs: try to separate code reorg and code changes (make two different PRs), to make it easier to make reviews.

@polina-c
Copy link
Copy Markdown
Member

Would you mind to link an issue that it contributes to, in the description?

(if you did not know that PR can auto-resolve an issue: flutter/genui#914)

@josemontespg
Copy link
Copy Markdown
Collaborator Author

josemontespg commented May 13, 2026

For your future PRs: try to separate code reorg and code changes (make two different PRs), to make it easier to make reviews.

Sorry for the large change, I'll keep this in mind in the future. Thank you for taking the time to review it!

Would you mind to link an issue that it contributes to, in the description?

Added a link to the internal issue in the description that motivates this PR

Copy link
Copy Markdown
Member

@polina-c polina-c left a comment

Choose a reason for hiding this comment

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

LGTM, but I would want also review from someone who is more familiar with our ts codebase.

Copy link
Copy Markdown
Collaborator

@ditman ditman left a comment

Choose a reason for hiding this comment

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

I am hesitant of adding v0.8 "inline" to the explorer app; I think this should be a slightly different "demo" component.

Also, needs CHANGELOG updates.

Also also, @polina-c is right, can we please split this PR in at least 3 or 4 (support angular explorer app 0.8, add missing tests, fix icons, fix modals?)

Comment on lines +43 to +45
if (!example) {
example = examples.find(ex => ex.name === `${exampleName} (minimal)`);
}
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.

I think we should remove the "minimal" catalog and examples. They don't add much value once the renderer is fully built (instead, they add maintenance burden like here)

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.

Sounds good to me. Is there alignment on doing this? Created #1432 to track

Comment thread renderers/angular/a2ui_explorer/src/app/agent-stub.service.ts
Comment thread renderers/angular/a2ui_explorer/src/app/demo.component.ts Outdated
examples = EXAMPLES;
selectedExample: Example | undefined = undefined;
version: '0.8' | '0.9' = '0.9';
examples: Array<Example | Example_08> = EXAMPLES_V09;
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.

Would it make sense to have DemoComponentV08 and DemoComponentV09 where each one of them knows how to handle its version of the protocol (with duplicated code) instead of adding many "if version == 0.8 else..." here?

@josemontespg
Copy link
Copy Markdown
Collaborator Author

Thanks for the feedback! I'm closing this PR in favor of smaller PRs

@github-project-automation github-project-automation Bot moved this from Todo to Done in A2UI May 14, 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.

3 participants