Stricter form submissions - #394
Conversation
WalkthroughThe change adds memoized form validation across authentication, account, painting, and event editor forms. Desktop submit buttons are disabled when forms are invalid and show validation tooltips. Mobile submit buttons remain enabled. Mergeability Score: 🟡 Moderate · up to The stricter submission behavior currently has cases that can permanently block retries, enable submission despite mismatched passwords, keep corrected password forms disabled, or allow a painting name with an existing availability error to proceed on mobile. These are concrete correctness and availability issues, so the PR is not merge-ready until they are addressed. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 8
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
frontend/src/app/(event)/[event-code]/painting/page-client.tsx (1)
125-135: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winUse the trimmed-name rule while editing.
validateAvailabilityDatatreats whitespace-only input as missing, buthandleNameChangechecks onlyvalue === "". For" ", the handler clearserrors.displayNameand startscheckNameAvailability. Use!value.trim()so field validation and submit validation use the same rule.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 2507e117-2dc6-4ae7-929a-0236766e56df
📒 Files selected for processing (12)
frontend/src/app/(auth)/forgot-password/page.tsxfrontend/src/app/(auth)/login/page.tsxfrontend/src/app/(auth)/register/page.tsxfrontend/src/app/(auth)/reset-password/page.tsxfrontend/src/app/(event)/[event-code]/painting/page-client.tsxfrontend/src/features/account/setting-dialogs/change-password/main-dialog.tsxfrontend/src/features/account/setting-dialogs/change-password/use-change-password.tsfrontend/src/features/account/setting-dialogs/delete-account.tsxfrontend/src/features/event/editor/editor.tsxfrontend/src/features/system-feedback/dialog/components/form.tsxfrontend/src/features/system-feedback/dialog/props.tsfrontend/src/lib/messages.ts
This PR introduces stricter form submissions to the many "forms" we have on the site.
Submission Restriction
On each "form" (listed below), the frontend will check that all the fields are filled and that there are no errors before allowing submission.
The submit button will be disabled and have a relevant tooltip on desktop. The behavior remains the same on mobile, where it shows toasts on submission if anything is wrong.
Affected forms:
Submit Disabling on Form Dialog
New props were added to allow adding tooltips and a disabled state to the submit button on form dialogs.