Repository navigation
fix(shell): bind reactive form controls by reference so Closure renaming can't break them - #237
Conversation
…ing can't break them
Templates looked up reactive form controls by string (formControlName="x",
form.get('x')), while the controls were created from unquoted object keys.
Under Closure Compiler property renaming those keys are renamed, the lookup
returns null, and setUpControl throws during the first change-detection pass,
leaving the A2A agent configuration panel half-rendered in optimized google3
builds.
Bind every field with [formControl]="form.controls.x" instead, which is plain
property access and is renamed consistently. The agent config panel now
creates a typed form at field initialization and applies its inputs in
ngOnInit. The add-renderer, add-API-key, and MCP server dialogs get the same
change.
There was a problem hiding this comment.
Code Review
This pull request refactors several Angular templates to bind form controls using [formControl]="form.controls.x" instead of formControlName="x" to prevent string-based lookups from breaking when JSCompiler renames keys. Additionally, AgentConfigPanel is updated to use a strongly-typed, non-nullable form group. Feedback suggests typing defaultBackendMode as A2aBackendMode instead of string to improve type safety and avoid unnecessary type assertions.
Narrow A2aBackendOption.id from string to A2aBackendMode so the agent config form's backendMode control is typed end to end, which removes the cast on save. With the form now non-nullable, drop the null fallback on tenantId and update the spec that set it to null.
|
@suyangw-g @jgindin this fixes a bunch of the closure compilations issues we're seeing in 1P when working with these dialogs. |
⚡ A2UI Composer PR PreviewYour automated preview is successfully live (commit
|
…ject#119 card styling The baseline committed with a2ui-project#119 does not match what the pinned Playwright container renders for the A2A full chat view, so every PR based on main fails visual-regression on this snapshot. Regenerated from the CI container output.
…nes workflow Replaces the previous baseline with the one produced by the Visual Baselines workflow (visual_baselines.yml) in the pinned Playwright container, per the README instructions.
Adds the other snapshots the Visual Baselines workflow regenerated in the same run, so the committed baselines match the pinned Playwright container output.
Several templates looked up reactive form controls by string (
formControlName="endpoint",form.get('endpoint')), while the controls themselves were created from unquoted object keys infb.group({...}). That works with the Angular CLI build, but under Closure Compiler property renaming (used by the google3 build of Composer) those keys get renamed and the string lookup returnsnull.setUpControlthen throws during the first change-detection pass, so the A2A agent configuration panel renders half-initialized (no labels, raw icon text, blank Connect button) until the user interacts with it.This binds every field with
[formControl]="form.controls.x"instead. That's plain property access, which the compiler renames consistently with the keys, and it's also type-checked against the form's shape.AgentConfigPanelnow creates a typed, non-nullable form at field initialization and applies its inputs inngOnInitwithsetValue.[formControl]as well.No behavior change in the Angular CLI build. Existing specs pass unchanged.