Skip to content

feat: add confidence indicator to AI field marker - #12436

Merged
tomivirkki merged 16 commits into
mainfrom
feat/ai-field-marker-confidence
Aug 18, 2026
Merged

feat: add confidence indicator to AI field marker#12436
tomivirkki merged 16 commits into
mainfrom
feat/ai-field-marker-confidence

Conversation

@tomivirkki

Copy link
Copy Markdown
Member

Summary

  • Hosts that mark AI-filled fields need a way to show how confident the AI was in a value. The marker now takes a confidence property (low, medium, high) and renders an indicator with a pie icon and level text in the field's helper text section, ahead of the field's own helper.
  • The indicator is hidden while working is set — including for screen readers — since it describes a value that is about to be replaced.
  • The level texts are localizable through i18n.confidence, and the indicator colors can be themed through custom CSS properties, mapped to the semantic palettes in Lumo and Aura.

🤖 Generated with Claude Code

tomivirkki and others added 12 commits August 14, 2026 12:32
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The indicator was appended to the field, so it landed after a helper the
field already had. Removing it also made the helper controller restore and
re-append its default node, moving the helper to the end and flipping the
order on the next mark.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The marker emulated the field's helper text section styles, which missed
theme rules keyed on the attribute. In Lumo the indicator lost the spacing
below the input, and the helper-above-field theme rendered it below the
field instead of above it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The indicator is added to the field's light DOM, next to the application's
own children, where a plain `confidence` or `low` class name can collide.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The base styles and themes key on the indicator's class names; the field
attribute was a second styling contract nothing used.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@vaadin-review-bot vaadin-review-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Reviewed the changes — left 3 comments.

Finding
⚠️ The has-helper re-assert observer's callback closes over a stale field, so a marker reused on a second field writes has-helper to the wrong element.
🧹 #hasFieldHelper re-implements the field's own helper-content detection, which will drift from the field's rule.
👀 The marker drives the field's private has-helper attribute from outside and installs an observer to fight the field's own recomputation.

Comment thread packages/field-highlighter/src/vaadin-ai-field-marker.js
Comment thread packages/field-highlighter/src/vaadin-ai-field-marker.js
Comment thread packages/field-highlighter/src/vaadin-ai-field-marker.js
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@tomivirkki
tomivirkki requested a review from ugur-vaadin August 17, 2026 06:32
Comment thread packages/field-highlighter/src/vaadin-ai-field-marker.d.ts Outdated
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@ugur-vaadin ugur-vaadin left a comment

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.

LGTM

@jouni

jouni commented Aug 17, 2026

Copy link
Copy Markdown
Member

LGTM as well.

@tomivirkki
tomivirkki merged commit 161d916 into main Aug 18, 2026
13 checks passed
@tomivirkki
tomivirkki deleted the feat/ai-field-marker-confidence branch August 18, 2026 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants