The Build tab lets a list get a 21st item or one over 60 characters, then rolls it back with a cryptic error
メンテナーはふだん 1 日以内に返信
評価
この issue はまだ評価されていません。
説明
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
- 主要言語
- TypeScript
- スター
- 19
- フォーク
- 4
- 平均マージ
- 19時間 38分
- マージ済み PR(30日)
- 197
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
richshaw/OpenSignup のほかの issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
richshaw/OpenSignup#794 ·
メンテナーはふだん 1 日以内に返信
-
enhancement pipeline:proposed pipeline:ux
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
richshaw/OpenSignup#654 ·
メンテナーはふだん 1 日以内に返信
-
A failed database query logs its parameters, so OAuth tokens and participant details can end up in the logs対応中かも @richshaw が 1 日前に担当しました。 オープンbug pipeline:building
richshaw/OpenSignup#800 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Two breadcrumb pages belong to URLs that always redirect, so they never show対応中かも @richshaw が 2 日前に担当しました。 オープンenhancement good first issue pipeline:stuck
richshaw/OpenSignup#793 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
A failed "Turn reminders back on" reloads the page with no error対応中かも @ShahadatTest が 3 日前に担当しました。 オープンbug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 25/100
richshaw/OpenSignup#785 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
richshaw/OpenSignup の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
🐛 bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
LibreChat-AI/LibreChat#17875 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
category:helper tech-debt
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
LanternOps/breeze#11285 ·
メンテナーはふだん 1 日以内に返信
-
area: core area: docs good first issue help wanted lane: free-agent priority: P3 roadmap size: XS type: task
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
arminazimi/seaworthy#701 ·
メンテナーはふだん 1 日以内に返信