feat: add field highlighting for ai updated fields#9413
Open
ugur-vaadin wants to merge 3 commits into
Open
Conversation
tomivirkki
reviewed
Jun 3, 2026
| * handler | ||
| * @return this controller, for chaining | ||
| */ | ||
| public FormAIController withFieldValuesChanged( |
Member
There was a problem hiding this comment.
The method naming doesn't fit into the controller interface. We've typically used the with-prefixed API in builders
Contributor
Author
There was a problem hiding this comment.
Should be changed to addFieldValueChangedListener with field, old value, new value.
Contributor
Author
There was a problem hiding this comment.
Updated the PR:
- Listener name is now
addFieldValueChangedListener FieldValueChangenow contains theHasValuefield- The listener parameter consumer now provides the list of changes rather than a map.
tomivirkki
reviewed
Jun 3, 2026
| static void show(Element field, String userId) { | ||
| field.executeJs( | ||
| "customElements.get('vaadin-field-highlighter')" | ||
| + ".addUser(this, {id: $0, name: 'AI', colorIndex: 0})", |
Member
Contributor
Author
There was a problem hiding this comment.
The decision after discussion: keep the name as "AI" for now.
tomivirkki
reviewed
Jun 3, 2026
| * entry — other users on the field stay untouched. | ||
| */ | ||
| static void show(Element field, String userId) { | ||
| field.executeJs( |
Member
There was a problem hiding this comment.
This will probably not survive reattach. Should be wrapped in an attach listener
|
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
This PR:
withFieldValuesChanged(Consumer<Map<HasValue, FieldValueChange>>), which fires once per successful turn. Ignored fields are excluded. Skipped when the turn ended in error or when no field changed.showHighlight(HasValue)andhideHighlight(HasValue)to control the highlighter. Each controller carries a per-instance UUID id (vaadin-ai-<uuid>) and usesaddUser/removeUser, so the AI highlight coexists with any other field-highlighter user the application keeps on the same field. The highlight is not retained across detach/re-attach.Fixes https://github.com/orgs/vaadin/projects/103/views/1?filterQuery=&pane=issue&itemId=193540699
Type of change
Checklist