Skip to content

Improve major/minor form fields - #229

Open
En-Natalie wants to merge 38 commits into
developfrom
warn-invalid-major-minor
Open

En-Natalie wants to merge 38 commits into
developfrom
warn-invalid-major-minor

Conversation

@En-Natalie

@En-Natalie En-Natalie commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Description

Improves visual warnings for invalid input of major and minor on the settings and onboarding pages.

  • The user is now warned for an empty major, a major that does not match one of the dropdown options, or a non-empty minor that does not match one of the dropdown options.
  • Validation is now checked after each keystroke instead of after a dropdown option is selected or enter is pressed.

Also resolves #224 and #228.

Testing

The following can be done from both the onboarding and settings pages. While doing so, notice that the the validation updates when text is changed.

  • Enter "Evil" into the major field. "Invalid major" warning.
  • Enter "Evil" into the minor field. "Invalid minor" warning.
  • (Settings only) Delete all text from the major field. "Major required" warning.
  • Delete all text from the minor field. No warning.
  • Enter "Finance" into the major field. No warning.
  • Enter "Dance" into the minor field. No warning.

Input can be entered through only typing, typing then selecting a dropdown, or only selecting a dropdown. Text can be deleted by manually backspacing or by pressing the x.

I probably missed testing something because I haven't tested all ~27ish combinations (depending on what you count to be a distinct combination) systematically, but surely everything works.

AI Disclosure

Not used.

Checklist

  • Create this PR
  • Perform final self-review

@En-Natalie
En-Natalie requested review from a team as code owners September 12, 2026 08:34
@vercel

vercel Bot commented Sep 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
utd-notebook Ready Ready Preview Sep 20, 2026 6:56am UTC

Request Review

@ZeyadAbbas ZeyadAbbas left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this change, but I hate that there is 2 functions for practically the same schema(not your fault), and different requirements. I assume these are the inconsistencies you were referring to. So if you would like, you can combine them into a single accountSchema, with all requirements from the settings schema. Then fix any code that called the old functions. This way we can get done with it all in one PR. Another option is to open another issue for this specifically.

@ZeyadAbbas ZeyadAbbas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have left 3 comments on 3 different files, please check them and make the necessary fixes.

Comment thread src/lib/schemas/note.ts

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This account-specific block duplicates src/lib/schemas/account.ts. Delete lines 7–51 and keep the account contract only in the account schema. This duplication was caused by the refactor changes, so not your fault.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is a duplicate of src/systems/account/data/utdDegrees.ts. Delete the entire file. Caused by refactor.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new enum validation is only consumed by client forms. userMetadata.updateById still validates with insertUserMetadata.partial(), so a caller can submit any major or minor directly to /api/trpc. Reuse field-level major/minor schemas in the router input while preserving partial updates for username-only changes.

@En-Natalie En-Natalie linked an issue Sep 20, 2026 that may be closed by this pull request

This branch was successfully deployed

1 active deployment
Preview — acd4141b Deployed Sep 20, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent account information requirements Warn for invalid major/minor selection

4 participants