The Build tab lets a list get a 21st item or one over 60 characters, then rolls it back with a cryptic error
Los mantenedores suelen responder en 1 día
Evaluación
Este issue todavía no se ha evaluado.
Descripción
What happens
A List field allows at most MAX_CHOICES (20) items, each at most CHOICE_MAX_LENGTH (60) characters (ChoiceSchema and the enum config in src/schemas/slot-fields.ts). The Build tab's list picker doesn't enforce either limit:
EnumPicker(src/components/build-wysiwyg/EnumPicker.tsx): "Add to list" is always shown, the "New option name" input has nomaxLength, andcommitNewonly trims the text and checks it isn't empty.onAddEnumOptioninBuildWysiwyg.tsx(also used byWysiwygGroup.tsx) skips duplicates only, and sends[...choices, value]with no count check.
Example: an organizer running a potluck with 20 dishes types "Dish 21" and adds it.
- The cell shows "Dish 21" straight away.
- The field save is refused ("Array must contain at most 20 element(s)").
- The slot save behind it goes out anyway and is refused too.
- The cell rolls back.
What stays on the save rail is the slot refusal, "dish" must be one of: Dish 1, Dish 2, … Dish 20. Nothing says a list holds 20 items. A 61-character item goes the same way.
sanitizeEnumChoices caps the list at 20, but only when a field is first created.
Fix, in outline
- Export
CHOICE_MAX_LENGTH(andMAX_CHOICES, if it isn't already) fromsrc/schemas/slot-fields.tsand import them on the client. Don't type the numbers. - In
EnumPicker:- put
maxLength={CHOICE_MAX_LENGTH}on the new-item input; - when the list already has
MAX_CHOICESitems, hide the "Add to list" footer and show a short line in its place, such as "A list holds up to 20 items."
- put
- In
onAddEnumOption, return early at the cap as a backstop.
Watch for
- Both pickers. The slot editor and the group header use the same component and handler. Check both.
- Existing tests.
BuildWysiwyg.test.tsxcovers Enter and blur-to-add (#656, #692). Keep those passing. - Help pages. Run the
help-pagesskill'saffected-articles.mjs. If an article describes adding list items, mention the limit and update itsUIlist if a control's name changes. - Out of scope: the slot save still runs after a failed field save. That's a separate change.
Done when
- An
EnumPickertest: with 20 options, there is no "Add to list" and the limit line shows. With 19, "Add to list" is there. - A test that the new-item input caps at 60 characters.
pnpm lint && pnpm typecheck && pnpm knip && pnpm testpass.
Found by the pipeline's bugs scout in the Build tab's list picker (src/components/build-wysiwyg), at 8e63fab. Checked by an independent verifier with a scratch component test: "Add to list" stayed enabled at 20 items, both saves were refused, and the rail ended on the "must be one of" message. https://claude.ai/code/session_016YZ9SUw2vvaNxfSUsArR5B
- Lenguaje dominante
- TypeScript
- Estrellas
- 19
- Forks
- 4
- Merge medio
- 19 h 38 min
- PR fusionados (30 d)
- 197
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de richshaw/OpenSignup
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
richshaw/OpenSignup#794 ·
Los mantenedores suelen responder en 1 día
-
enhancement pipeline:proposed pipeline:ux
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
richshaw/OpenSignup#654 ·
Los mantenedores suelen responder en 1 día
-
A failed database query logs its parameters, so OAuth tokens and participant details can end up in the logsPosiblemente ocupada @richshaw la tomó hoy. Abiertobug pipeline:building
richshaw/OpenSignup#800 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Two breadcrumb pages belong to URLs that always redirect, so they never showPosiblemente ocupada @richshaw la tomó hace 1 día. Abiertoenhancement good first issue pipeline:stuck
richshaw/OpenSignup#793 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
A failed "Turn reminders back on" reloads the page with no errorPosiblemente ocupada @ShahadatTest la tomó hace 2 días. Abiertobug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 25/100
richshaw/OpenSignup#785 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de richshaw/OpenSignup
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
hugomrdias/playwright-test#753 ·
Los mantenedores suelen responder en 1 día
-
Review view: Daily/Weekly Review header buttons use the app-wide toolbar control stylePosiblemente ocupada @colherdesopa la tomó hoy. Abierto
Dificultad 1/5 1-3 horas Aptitud para principiantes 90/100
dongdongbh/Mindwtr#1515 ·
Los mantenedores suelen responder en 1 día
-
pending-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
kirodotdev/Kiro#12301 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100