📌 Description
AnchorForm and SettlementForm (src/components/AnchorForm.tsx, src/components/SettlementForm.tsx) validate inline per the README ("missing or invalid fields are flagged next to the input before the request is sent"). If a field's error clears as soon as it becomes non-empty — without re-checking format/range — a user could type a valid amount, get the error cleared, then edit it to an invalid value (e.g. negative) and not see the error return until they hit submit.
🧩 Requirements and context
- Once a field has been touched (blurred or previously shown an error), re-run its validation on every subsequent change, not just "is it non-empty."
- Keep the existing "don't show errors before first interaction" behavior for untouched fields.
- Apply consistently across
AnchorForm, SettlementForm, and QuoteForm if it shares the same validation pattern.
🛠️ Suggested execution
- Update the validation-state logic in
AnchorForm.tsx/SettlementForm.tsx (and QuoteForm.tsx if applicable) to re-validate touched fields on every onChange.
- Extend the corresponding
.test.tsx files with a "valid then invalid" edit sequence per field, asserting the error reappears without requiring a submit attempt.
✅ Acceptance criteria
🔒 Security notes
No new attack surface; server-side validation on the backend remains the actual enforcement boundary.
📋 Guidelines
- Minimum 95% test coverage
- Clear documentation
- Timeframe: 96 hours
📌 Description
AnchorFormandSettlementForm(src/components/AnchorForm.tsx,src/components/SettlementForm.tsx) validate inline per the README ("missing or invalid fields are flagged next to the input before the request is sent"). If a field's error clears as soon as it becomes non-empty — without re-checking format/range — a user could type a valid amount, get the error cleared, then edit it to an invalid value (e.g. negative) and not see the error return until they hit submit.🧩 Requirements and context
AnchorForm,SettlementForm, andQuoteFormif it shares the same validation pattern.🛠️ Suggested execution
AnchorForm.tsx/SettlementForm.tsx(andQuoteForm.tsxif applicable) to re-validate touched fields on everyonChange..test.tsxfiles with a "valid then invalid" edit sequence per field, asserting the error reappears without requiring a submit attempt.✅ Acceptance criteria
🔒 Security notes
No new attack surface; server-side validation on the backend remains the actual enforcement boundary.
📋 Guidelines