client: avoid necessary network requests and fix focus loss#984
Merged
nan-yu merged 3 commits intogoogle:mainfrom Mar 25, 2026
Merged
client: avoid necessary network requests and fix focus loss#984nan-yu merged 3 commits intogoogle:mainfrom
nan-yu merged 3 commits intogoogle:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors Angular components to directly update the local data model for immediate UI feedback, reducing network requests. It also optimizes the MessageProcessor to use a version signal for better change detection with in-place mutations and introduces a focus loss prevention mechanism in the Renderer by updating component inputs in-place when the component identity remains the same. Feedback includes a high-severity issue regarding an incorrectly formatted valueMap in multiple-choice.ts that could lead to incorrect data model updates, and a medium-severity suggestion to improve type safety in renderer.ts by using a more specific type for componentRef.
gspencergoog
approved these changes
Mar 25, 2026
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.
Description
The v0.8 Angular renderer's
TextFieldand other input components were hardcoded to dispatch every input event as a server action, so local updates were also sent to the server. TheMessageProcessorlacks a mechanism to distinguish between local state updates and global agent actions. This PR updatesMessageProcessorto handle local notifications and modify input components (TextField,DateTimeInput,Checkbox,SliderandMultipleChoiceto use these local notifications for intermediate updates.There was also a focus loss issue caused by Angular recreating components on every keystroke. It was fixed by updating the
Rendererto reuse components viaComponentRefinstead of re-creating them on every update.Before
unnecessary.network.requests.webm
Focus.loss.webm
After
booking.demo.webm
streaming.demo.for.contact.sample.webm
Streaming.demo.for.restaurant.sample.webm
Pre-launch Checklist
If you need help, consider asking for advice on the discussion board.