Skip to content

After a settings save, the Build tab can point reminders at a field it hasn't loaded #398

Closed

Description

@richshaw

What happens

Since #360, a settings save on the Build tab shows the settings the server sends back. showSettings in src/components/build-shared/useBuildState.ts takes reminderFromFieldRef and groupByFieldRefs from the response, but the tab's field list is still the one it loaded when it opened.

So when another tab, or an AI assistant using add_field and update_signup, adds a date field and moves reminders to it, this tab's next "Group slots by" change adopts a reminder field it doesn't have. From then on, until the organizer reloads:

  • No field shows the reminder bell.
  • Every date field's reminder checkbox is disabled. Opening one shows "is already the reminder field for this signup. Turn it off there to use this one instead." with a blank where the field's name should be, because FieldsPopover passes reminderFieldLabel as null for a field it can't find, and InlineFieldForm blocks the box whenever the reminder field is another one.

Before #360 a "Group slots by" save never touched the reminder control, so this is new, and it happens in exactly the case #314 was about: someone else changing settings while the Build tab is open.

Fix, in outline

  • Catch up on fields first. When the saved settings name a field ref the tab doesn't have, fetch GET /api/signups/[id]/fields before showing them. The reorder path in the same hook already does this ("converge on server truth via refetch"), so share it.
  • Or, smaller: don't disable the box, or show the note, when the reminder field isn't in the tab's list.

Watch for

Done when

  • A useBuildState hook test: a "Group slots by" save whose response names a reminder field the tab didn't load leaves the tab's field list including that field (or the smaller fix's behaviour, pinned).
  • An InlineFieldForm test that a reminder field missing from the list doesn't disable the checkbox or print a blank name, if the smaller fix is taken.
  • pnpm lint && pnpm typecheck && pnpm knip && pnpm test pass.

Found by a pipeline review test run of #360 at f7f6cd9, and re-checked against main at 73e17bf (showSettings is unchanged). Reproduced with a hook test, since removed, where the save response named a reminder field the tab hadn't loaded. https://claude.ai/code/session_01FMEp6Vxe4H4CvdXbFxYFXZ

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions