Week 032 — Validation Is Boring Until the Form Breaks
Validation is the kind of work that's easy to defer and painful when you haven't done it.
Week of June 23, 2025
Progress
Validate.js was adopted for client-side form validation. Sign-in page validation was implemented first: the phone number field, the email field, and the logic for which one to validate depending on what the user has filled in (phone fields present, email present, or both empty).
By Wednesday, sign-in flow validation was complete and the dialog engine was integrated for showing errors and confirmations instead of browser-default behavior.
On the item page, the reward field was moved out of a dialog popup and into the page itself as an exposed input with a balance display and a "Max" button. The validation for the reward field needed to be added dynamically — only validating the field when the item is in a lost state, not when safe or found-by-someone-else.
The Hard Part
Item page validation was in place but generating no errors despite clearly invalid test input. Validate.js was confirmed to be loading. The real issue: there was a placeholder function called validate() already defined on the page — a stub from earlier development. The validation library's call to the same function name was hitting the stub instead of the library. Renamed the stub, validation worked immediately.
Next Week
The reward saving logic and balance math need to be wired up. When a user sets or changes a reward amount, the points balance should update correctly and protect against invalid states.
