Skip to content

The signup page keeps its own "email required" and "reminders on" defaults, and the reminders one is the opposite of the schema's #1140

Done

Description

@richshaw

What happens

SignupViewSignup (src/app/s/[slug]/signup-view-types.ts) declares requireEmail and sendReminders as optional. SignupViewBody (src/app/s/[slug]/signup-view.tsx) fills them in when they're missing: signup.requireEmail ?? true and signup.sendReminders ?? false. The field comments say the same: "true when left out", "false when left out, so nothing promises a reminder".

Neither fallback is ever reached:

  • Live mode is the only mode that reads them. It's the branch that renders CommitDialog, and those two lines are the only reads of either field in the view.
  • Every live render sets both. src/app/s/[slug]/page.tsx builds its props with toSignupViewProps, which calls toSignupViewSignup (src/app/s/[slug]/public-signup.ts). That returns Required<SignupViewSignup>, filling the two from requiresEmail and sendsReminders in src/schemas/signups.ts.
  • The other callers don't need them. The organizer preview page also goes through toSignupViewProps, and preview never renders CommitDialog. The home page's HomeExampleCard passes a literal without either field, but it's in showcase mode, which renders a plain span, not the dialog. That literal is the only reason the fields are optional.

So the fallbacks are a second copy of the settings defaults, and the sendReminders copy disagrees with the real rule: sendsReminders returns true when the key is missing, as the reminder dispatcher does. The only thing that exercises ?? false is a test case in signup-view.test.tsx ("promises none where nothing says whether reminders are on") that passes undefined, which no real page can.

Nobody using OpenSignup notices; every page renders the same.

Fix, in outline

  • Types: make requireEmail: boolean and sendReminders: boolean required on SignupViewSignup. Replace the two "when left out" comments with one saying toSignupViewSignup fills them from the signup's settings. The Required<> on toSignupViewSignup's return type is then redundant; drop it.
  • View: pass signup.requireEmail and signup.sendReminders straight through, without ??.
  • Home card: add requireEmail: true, sendReminders: true to HomeExampleCard's SIGNUP. Showcase mode ignores them.
  • Tests: in signup-view.test.tsx, add the same two values to the shared SIGNUP constant (true matches today's ?? true, so no other test changes behaviour), make the one inline signup literal spread SIGNUP, delete the undefined reminders case, and narrow emailHelp's parameter to boolean.

Watch for

  • An open PR adds embedding to this file. It adds an embed prop beside the two fallback lines and keeps them. Whichever lands second has a small merge; its new embed page also goes through toSignupViewProps, so it sets both values too.
  • Don't add a mode-discriminated prop type to keep the fields optional in showcase. Two literal values in the home card are simpler.
  • The home page must look the same. The card's markup doesn't change.

Done when

  • grep -rn "requireEmail ??\|sendReminders ??" src finds nothing, and both fields are required on SignupViewSignup.
  • No test passes undefined for either field.
  • pnpm lint && pnpm format:check && pnpm typecheck && pnpm knip && pnpm test pass.

Found by the pipeline's refactor scout in the participant pages (src/app/s/[slug], src/app/(site)/_components), at 2c037aa. Checked by an independent verify agent. It grepped every caller of SignupView, SignupViewBody and toSignupViewProps in src, tests and scripts, confirmed showcase and preview never render CommitDialog, then made the fields required in a scratch tree: typecheck failed only in HomeExampleCard and the test file, and after adding the values, 477 of 478 tests in src/app/s and src/app/(site) passed, the one failure being the undefined case. Then it reverted. https://claude.ai/code/session_016YZ9SU4eo5cjeZjMfXY5sy

Activity

  1. added
    enhancement
    good first issue
    pipeline:working
    and removed on Nov 27, 2026
  2. self-assigned this
    on Nov 27, 2026
  3. removed
    pipeline:working
    on Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementgood first issue

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions