Skip to content

feat: lock form fields during AI fill turn#9298

Merged
tomivirkki merged 2 commits into
mainfrom
feat/form-ai-controller-field-locking
May 19, 2026
Merged

feat: lock form fields during AI fill turn#9298
tomivirkki merged 2 commits into
mainfrom
feat/form-ai-controller-field-locking

Conversation

@tomivirkki
Copy link
Copy Markdown
Member

Summary

  • Prevent the user from typing into a field the AI is about to overwrite by switching every non-ignored, currently-editable field to read-only for the duration of a fill turn, releasing on success, failure, or timeout.
  • Document the limitation that application code which toggles a field's read-only state mid-turn (e.g. a value-change listener reacting to the LLM's writes) will be overridden when the controller releases its locks — applications should avoid mid-turn toggling, or reapply state after the turn completes.

Related to https://github.com/orgs/vaadin/projects/103/views/3?pane=issue&itemId=186543521

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tomivirkki tomivirkki requested a review from ugur-vaadin May 18, 2026 08:45
}

private boolean isIgnored(HasValue<?, ?> field) {
if (!(field instanceof Component component)) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: this check seems to be unnecessary since it is currently not possible to trigger it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tomivirkki tomivirkki enabled auto-merge May 19, 2026 06:43
@tomivirkki tomivirkki added this pull request to the merge queue May 19, 2026
@sonarqubecloud
Copy link
Copy Markdown

Merged via the queue into main with commit 19711a7 May 19, 2026
15 checks passed
@tomivirkki tomivirkki deleted the feat/form-ai-controller-field-locking branch May 19, 2026 06:56
@vaadin-bot
Copy link
Copy Markdown
Collaborator

This ticket/PR has been released with Vaadin 25.2.0-alpha8.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants