Repository navigation
Conversation
anurag629
left a comment
There was a problem hiding this comment.
Thanks @joshuaallgaier2-cmd, the change is right. Blank and space-only name and projectDetails now fail before onCapture runs, the message names every wrong field (name: Required, email: Invalid email, projectDetails: Required), and the lead that's captured and returned has the trimmed values. typecheck-test-build, e2e and changeset pass.
Two checks are red for reasons outside the code. The claim check ran before #612 was assigned to you, and the description check wants the template's sections. Edit the description to add a "How I tested this" section (your Verification part can go there) and an "AI assistance" section, and both checks run again. I'll merge once they pass.
anurag629
left a comment
There was a problem hiding this comment.
Thanks @joshuaallgaier2-cmd. With both sections in the description, the claim and description checks pass now. Blank and space-only name and projectDetails fail before onCapture runs, the message names each wrong field, and the captured lead has the trimmed values. I updated your branch with dev. All checks pass, including e2e.
|
Merged, thanks @joshuaallgaier2-cmd. |
What does this change?
capture_leadaccepted blanknameandprojectDetailsbecause plainz.string()allows''and' ', and its error message listed only the zod messages without the field name. It now trims and requires at least one character after trimming, names the failing field, and returns the trimmed values.Closes #612
How I tested this
Red before the fix: the new blank-value and field-naming tests fail on the unmodified code. The existing suite still passes. The changeset
.changeset/lead-capture-trim.mdcovers@chatcops/core.AI assistance
OpenCode (DeepSeek) wrote the code and tests; I reviewed the diff and ran the commands above locally.
Checklist
devpnpm -r build,pnpm testandpnpm -r typecheckpass locallypnpm changeset) if this changescore,widgetorserverpnpm apirun andapi/committed if an exported type or option changed