improvement(emcn): show per-chip error tooltips on invalid email chips#4998
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview
Reviewed by Cursor Bugbot for commit fde36b4. Configure here. |
Greptile SummaryInvalid email chips now show their rejection reason in a cursor-following tooltip on hover, backed by an always-present
Confidence Score: 5/5Safe to merge — the change is additive (a new optional field on TagItem), the tooltip wiring is consistent with existing Tooltip usage in the same file, and all three callsites correctly apply the ?? 'Invalid email format' fallback. The internalError state removal is clean: every path that previously set it either no longer exists or now writes the reason directly to the chip item. The ChipTag root is a span that spreads ...props, so Radix Slot correctly merges the pointer/focus handlers from Tooltip.Trigger. The sr-only span ensures screen readers receive the error text without depending on hover. No data flow regressions or broken contracts identified. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant TagInput
participant ChipModalEmailsControl
participant TagItem
participant Tooltip
User->>TagInput: types email + presses Enter
TagInput->>ChipModalEmailsControl: onAdd(email)
ChipModalEmailsControl->>ChipModalEmailsControl: quickValidateEmail(email)
alt format invalid
ChipModalEmailsControl->>TagItem: isValid: false, error: reason ?? 'Invalid email format'
else validate() returns reason
ChipModalEmailsControl->>TagItem: isValid: false, error: reason
else valid
ChipModalEmailsControl->>TagItem: isValid: true
ChipModalEmailsControl->>ChipModalEmailsControl: onChange(validEmails)
end
TagItem->>TagItem: render sr-only span with error text
User->>TagItem: hover (pointerenter)
TagItem->>Tooltip: show Tooltip.Content(error)
User->>TagItem: pointer leave
TagItem->>Tooltip: hide tooltip
Reviews (2): Last reviewed commit: "improvement(emcn): fall back to generic ..." | Re-trigger Greptile |
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit fde36b4. Configure here.
Summary
TagInputnow show the rejection reason in a tooltip on hover (TagItemgains an optionalerror, with ansr-onlyfallback for screen readers)ChipModalField type='emails'attaches the reason to each rejected chip — format failures (previously a red chip with no message at all) now carryquickValidateEmail's reason, andvalidatecallback rejections (already a teammate / already in org / self-invite) show on the chip instead of the shared bannererrorprop)Type of Change
Testing
Verified in the running app via Playwright on /playground: tooltip shows on hover of an invalid chip with a reason, hides on pointer leave, and does not appear for valid chips or invalid chips without a reason. Typecheck and biome pass.
Checklist