Skip to content

Stop the Build tab's field-name box at 80 characters, the schema's limit - #1152

Open
richshaw wants to merge 2 commits into
mainfrom
claude/issue-1149-field-label-limit
Open

richshaw wants to merge 2 commits into
mainfrom
claude/issue-1149-field-label-limit

Conversation

@richshaw

Copy link
Copy Markdown
Owner

Fixes #1149.
Session: https://claude.ai/code/session_016YZ9SRqSkLjZBSL5CUnH6k

The problem

The server refuses a field name over 80 characters (LABEL_MAX_LENGTH, which was private to src/schemas/slot-fields.ts). The Build tab's field-name box had no limit. A longer name was refused with "Some values weren't accepted.", and when adding a field, the typed name was lost along with it, because the Fields popover closes the form before the save returns.

The fix

  • The constant is shared. LABEL_MAX_LENGTH moves to src/schemas/slot-field-basics.ts, which has no zod in it, beside MAX_CHOICES and CHOICE_MAX_LENGTH. slot-fields.ts imports it from there for LabelSchema, so the schema's limit is unchanged and Magic Compose's prompt.ts keeps the same LabelSchema.
  • The box stops at the limit. InlineFieldForm's name input gets maxLength={LABEL_MAX_LENGTH}. The same form both adds and renames fields, so this covers both.
  • save() cuts the name to the limit as a safety net, the way updateSignupMeta cuts the title. It covers a value set some other way, such as by a script.
  • No new text, so the catalogs don't change. affected-articles.mjs names no help article.
  • CHANGELOG entry under Fixed.

Tests

  • In InlineFieldForm.test.tsx, in both create and edit mode:

    • the name input's maxLength equals LABEL_MAX_LENGTH
    • a name set past the limit is saved cut to 80 characters

    All four tests failed before the fix.

  • Ran and passed: pnpm lint && pnpm format:check && pnpm typecheck && pnpm knip && pnpm test (3909 passed, 1 expected fail), then pnpm build && pnpm budgets with CI's NEXT_PUBLIC_* values. The Build page measures 152.0 kB against its 152 kB budget, so it is within budget.


Generated by Claude Code

The schema refuses a field name over 80 characters, but the box had no
limit, so a longer name came back as "Some values weren't accepted." and
a new field's name was lost. LABEL_MAX_LENGTH moves to slot-field-basics,
which has no zod, so the box and the schema share it; save() also cuts
the name to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SRqSkLjZBSL5CUnH6k
@richshaw richshaw added pipeline:tophat pipeline:ux Changes what a person using OpenSignup sees or does pipeline:working A session is working on it right now pipeline:fix and removed pipeline:working A session is working on it right now pipeline:tophat labels Nov 28, 2026 — with Claude
Keep both CHANGELOG entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YZ9SS5DUGFAwfk5x6sWfw

Copy link
Copy Markdown
Owner Author

Merged main into this branch in 2f5a471 to clear a conflict in CHANGELOG.md. I kept both entries under Fixed, this PR's first and then #1134's. No runtime code changed in the merge.

Ran on the merged head: pnpm lint && pnpm format:check && pnpm typecheck && pnpm knip && pnpm test passed (3930 passed, 1 expected fail). pnpm build && pnpm budgets with CI's NEXT_PUBLIC_* values also passed: the Build page is 152.4 kB against its 152.4 kB budget.

No tophat has run yet, so this goes back to tophat once CI is green.

https://claude.ai/code/session_016YZ9SS5DUGFAwfk5x6sWfw


Generated by Claude Code

@richshaw richshaw added pipeline:tophat pipeline:working A session is working on it right now and removed pipeline:fix pipeline:working A session is working on it right now labels Nov 28, 2026 — with Claude

Copy link
Copy Markdown
Owner Author

Tophat: passed

See it: https://claude.ai/artifact/YPZhuzMtgxJKtNkrNUjdmh
What changes for people: An organizer naming a field on the Build tab can no longer type past 80 characters, the most the server accepts. Before, a longer name was refused with "Some values weren't accepted." and a new field vanished along with what they typed. Now the box stops at 80 and the field saves.

Check Result What I saw
Add a field with a 103-character name (phone) ✅ Before: 400, "Some values weren't accepted.", field not added, name lost. After: the box holds 80, the field saves, Fields (3).
Rename a field past the limit (desktop) ✅ Before: refused the same way. After: real keyboard typing and a clipboard paste both stop at 80, and the rename saves.
maxLength in both forms ✅ 80 in the New field form and the Edit field form.
Build tab with an 80-character name (phone) ✅ The slot placeholder and the Fields list cut it with an ellipsis. Nothing overflows.
Fill the slot, publish, open the public page (phone) ✅ Published. The slot shows its values.
Console and server log ✅ No browser errors on the head. The server log has only the expected worker-health warning, because no worker was running.

Worth a look: the box stops silently, mid-word if it has to ("…and what time will you arrive?" became "…and wha"). It shows no count or hint, unlike the list picker's choices. That's fine for a rare case, but a counter near the limit could be a follow-up.

Not checked: a before/after screenshot pair for the rename. The base's refusal was confirmed by its message and the 400, and the add-field pair shows the same thing.

Ran 2f5a471 against 96fc00f locally, Chromium at 1280×900 and 390×844, made-up data. https://claude.ai/code/session_016YZ9SV9meXottD7XRQySLX


Generated by Claude Code

@richshaw richshaw added pipeline:review and removed pipeline:tophat pipeline:working A session is working on it right now labels Nov 28, 2026 — with Claude
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pipeline:review pipeline:ux Changes what a person using OpenSignup sees or does

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants