fix(web): fix #1058 register importer form per-field error guidance - #1168
Merged
vjuliaife merged 1 commit intoAug 27, 2026
Conversation
|
Deployment failed for project tariff-shield-web with the following error: Learn More: https://vercel.com/docs/concepts/projects/project-configuration |
|
@Owolabenjade Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Close issue #1058
Context & Issue Summary
This PR addresses issue #1058 where the
RegisterImportercomponent (apps/web/app/app/page.tsx) relied solely on native browserrequiredvalidation attributes and a single top-levelErrorBannerrendered after submission failure.Because the form provided no inline, per-field error feedback, importers submitting invalid or malformed data (such as incorrectly formatted EIN numbers or invalid annual duty estimates) had to guess which input field was causing the submission rejection.
Solution & Flow
apps/web/app/app/page.tsxto add a localfieldErrorsstate (useState<{ legalName?: string; ein?: string; annualDutyEstimate?: string }>({})) insideRegisterImporter.validate()helper function that validates:XX-XXXXXXX, e.g.12-3456789) when an EIN is provided.updateField()helper to update field state and dynamically clearfieldErrors[field]as the user edits the input.Fieldhelper component to accept anerror?: stringprop, rendering inline red text (<span className="mt-1 block text-xs text-danger">{error}</span>) and applyingborder-dangerinput styling when an error exists.<ErrorBanner error={error} />for API response errors and preserved nativerequiredattributes for browser validation compatibility.Value & Impact
This change improves importer onboarding form UX for issue #1058 by providing immediate, clear per-field validation guidance without breaking top-level server error handling.
Changed
apps/web/app/app/page.tsx: Added per-field inline error messages (text-xs text-danger) and red border highlights (border-danger) toRegisterImporterform inputs with real-time error clearing on input edit, fixing Register importer form only shows one generic error banner instead of per-field guidance #1058.Testing
The component changes were validated using the following static analysis tools: