Skip to content

The Build tab's field-name box has no length limit, so a name over 80 characters is refused with "Some values weren't accepted" and lost #1149

Backlog

Description

@richshaw

What happens

A field's label is limited to 80 characters by LABEL_MAX_LENGTH, a constant private to src/schemas/slot-fields.ts (LabelSchema). The Build tab doesn't know that limit:

  • No limit on the box. The field-name input in src/components/build-wysiwyg/InlineFieldForm.tsx has no maxLength, and save() only trims. The same form is used to add a field and to rename one, so both have the gap.
  • Sent as typed. addField and updateField in src/components/build-shared/useBuildState.ts send the label unchanged. The title and description are cut to their shared limits in the same file. The field label isn't.
  • A vague refusal. The field service parses with no reasons table, so the refusal has no details.reason. saveErrorMessage falls back to organizer.errors.code.invalid_input: "Some values weren't accepted."
  • The name is lost. When adding a field, FieldsPopover calls onAddField and closes the form straight away, without waiting. When the save fails, the typed name is gone.

Every other limit the Build tab enforces comes from a shared constant that needs no zod: TITLE_MAX_LENGTH and DESCRIPTION_MAX_LENGTH in src/lib/signup-limits.ts, and MAX_CHOICES and CHOICE_MAX_LENGTH in src/schemas/slot-field-basics.ts. The label limit is the one rule kept only on the server.

Fix, in outline

  • Share the constant. Move LABEL_MAX_LENGTH to src/schemas/slot-field-basics.ts and export it. slot-fields.ts imports it there, as it already does the other constants.
  • Limit the box. Put maxLength={LABEL_MAX_LENGTH} on the name input in InlineFieldForm. That covers both adding and renaming.
  • Cut as a safety net (optional). Cut the trimmed name to LABEL_MAX_LENGTH in save(), as updateSignupMeta does for the title.

Watch for

  • Client bundle. slot-field-basics.ts must stay free of zod, because the Build tab is a client bundle with a JS budget (budgets.json).
  • Other readers. src/lib/magic-compose/prompt.ts imports LabelSchema. It must keep working, with the same limit.
  • No new text. The box should simply stop at 80 characters, so no catalog change is needed. If you add any visible text, it goes through en.json and the translate skill.
  • Help pages. Check with the help-pages skill's affected-articles.mjs whether any article describes adding a field. A length limit is unlikely to need a line there.
  • Overlap. Open PR Say in a moved slot's editor that its people will be emailed, and when #1079 also touches useBuildState.ts, for something unrelated. Whichever lands second has a small merge.

Done when

  • The field-name box stops at 80 characters, both when adding a field and when renaming one, and the limit comes from the same constant the schema uses.
  • InlineFieldForm.test.tsx has a test that the name input's maxLength equals LABEL_MAX_LENGTH, in create and edit mode.
  • pnpm lint && pnpm format:check && pnpm typecheck && pnpm knip && pnpm test pass.

Found by the pipeline's refactor scout in the Build tab (src/components/build-shared, src/components/build-wysiwyg), at e80ce74. Checked by an independent verify agent. In a temporary vitest file, it showed that the create and update schemas refuse an 81-character label with no details.reason, that saveErrorMessage turns that into "Some values weren't accepted.", that the name input has no maxlength and passes 85 characters to onSave, and that FieldsPopover closes the form before the save returns. Then it deleted the file. https://claude.ai/code/session_016YZ9SUP8nmn81ZVY1pBuQU

Activity

  1. added
    bug
    pipeline:ux
    on Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpipeline:readypipeline:ux

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions