The Build tab lets a list get a 21st item or one over 60 characters, then rolls it back with a cryptic error
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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
- Ngôn ngữ chính
- TypeScript
- Star
- 19
- Fork
- 4
- Merge trung bình
- 19 giờ 46 phút
- Pull request đã merge (30 ngày)
- 194
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của richshaw/OpenSignup
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
richshaw/OpenSignup#794 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement pipeline:proposed pipeline:ux
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
richshaw/OpenSignup#654 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Two breadcrumb pages belong to URLs that always redirect, so they never showCó thể đã có người làm @richshaw đã nhận 1 ngày trước. Đang mởenhancement good first issue pipeline:stuck
richshaw/OpenSignup#793 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
A failed "Turn reminders back on" reloads the page with no errorCó thể đã có người làm @ShahadatTest đã nhận 2 ngày trước. Đang mởbug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 25/100
richshaw/OpenSignup#785 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug pipeline:proposed pipeline:ux
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
richshaw/OpenSignup#783 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của richshaw/OpenSignup
Issue tương tự
-
unwrapDatabaseError masks real DB errors with TypeError: Cannot convert object to primitive valueĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
NEARBuilders/everything-dev#798 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
vercel-labs/durable-harness#53 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: Redesign tab bars ignore clicks on Linux: hidden chat layers keep window drag regionsCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
experiência: a doc manda subir para o Micro do Supabase, mas não diz que exige plano pago nem quanto custaCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởarea/docs area/ui enhancement
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
melgarafael/DeskcommCRM#4098 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
dependencies platform: ios
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 78/100
software-mansion/react-native-executorch#1617 ·
Maintainer thường phản hồi trong vòng 1 ngày