Participant name and notes limits are typed twice, in the schemas and on the participant pages
维护者通常 1 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 83/100
- Issue 类型
- 重构
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
从 src/lib/magic-compose/limits.ts 和 issue 中列出的文件开始:src/schemas/common.ts、src/schemas/commitments.ts、src/app/s/[slug]/name-message.ts、src/app/s/[slug]/participant-fields.tsx,以及 New signup 页面和对应的 schema。将参与者限制移到指定的无 import 模块,并复用现有的 signup 限制。不要让 zod 出现在参与者页面中,名称输入框也不要设置 maxLength。每项限制都只有一个来源,并且列出的 lint、typecheck、knip、test、build 和 budget 检查全部通过后,即可完成。
由索引模型根据 Issue 内容生成。
描述
What happens
The limits on what a participant can type are literals in two places each:
- Name, 100 characters.
NameSchemainsrc/schemas/common.tshas.max(100), andNAME_INVALIDinsrc/app/s/[slug]/name-message.tstypes "Enter your name, up to 100 characters." - Notes, 500 characters. The create and update schemas in
src/schemas/commitments.tseach have.max(500), and the Notes field insrc/app/s/[slug]/participant-fields.tsxhasmaxLength={500}. The sign-up dialog and the edit page both use that field. - Quantity, 999. Typed twice inside
src/schemas/commitments.ts, and nowhere on the client.
If someone changes a limit in the schema, the participant page's message and the textarea's maxLength are left saying the old number.
The organizer's New signup form (src/app/app/(chrome)/signups/new/page.tsx) has the same kind of copies. It types minLength={2}, maxLength={120} and maxLength={2000}, while src/schemas/signups.ts already has TITLE_MAX_LENGTH and DESCRIPTION_MAX_LENGTH, plus TITLE_MIN_LENGTH, which isn't exported.
Fix, in outline
- A new limits module. Add
src/lib/participant-limits.tswith no imports at all (likesrc/lib/magic-compose/limits.ts), holdingNAME_MAX_LENGTH = 100,NOTES_MAX_LENGTH = 500andQUANTITY_MAX = 999. - Use it everywhere. Use the constants in
NameSchema, both commitment schemas,NAME_INVALID(as a template string) and the Notes field. Updatesrc/schemas/common.test.ts's 100/101 boundary test to use the constant. - The New signup form. Export
TITLE_MIN_LENGTH, then use it withTITLE_MAX_LENGTHandDESCRIPTION_MAX_LENGTHon the form. It's a server component, so it can import from@/schemas/signupsat no cost.
Watch for
- Keep zod out of the participant pages.
name-message.tsandparticipant-fields.tsxreach'use client'components on/s/[slug]. The constants must not live insrc/schemasor anywhere that imports zod, or zod lands in those pages' JavaScript andbudgets.jsonfails. - No behaviour change. Don't add a
maxLengthto the name inputs: that would change what participants see, so it's a separate decision.
Done when
- Each of these limits is a number in exactly one place: name, notes, quantity, and title and description on the New signup form.
pnpm budgetsafterpnpm buildshows/s/[slug]and/s/[slug]/c/[id]unchanged.pnpm lint && pnpm typecheck && pnpm knip && pnpm testpass.
Found by the pipeline's refactor scout in src/schemas and src/app/s/[slug], at a65d5eb. Checked by locating every copy and each participant module's imports. https://claude.ai/code/session_016YZ9SVWAFTJiB4Z8TyLWNA
- 主要语言
- TypeScript
- 星标
- 19
- 派生
- 4
- 平均合并
- 23 小时 28 分钟
- 30 天内合并 PR
- 173
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
richshaw/OpenSignup 的其他 Issue
-
bug pipeline:ready pipeline:ux
难度 2/5 1-3 小时 新手友好度 90/100
richshaw/OpenSignup#723 ·
维护者通常 1 天内回复
-
bug pipeline:ready pipeline:ux
难度 2/5 1-3 小时 新手友好度 85/100
richshaw/OpenSignup#722 ·
维护者通常 1 天内回复
-
Magic Compose calls fields "columns" on the draft banner, the drafting screen and its warnings可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭bug pipeline:ready pipeline:ux
难度 2/5 1-3 小时 新手友好度 85/100
richshaw/OpenSignup#719 ·
维护者通常 1 天内回复
-
The "You're in." confirmation doesn't say which email address it used可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭enhancement pipeline:ready pipeline:ux
难度 2/5 1-3 小时 新手友好度 85/100
richshaw/OpenSignup#715 ·
维护者通常 1 天内回复
-
The privacy and cookies pages don't mention three things the app stores可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭bug pipeline:ready pipeline:ux
难度 2/5 1-3 小时 新手友好度 75/100
richshaw/OpenSignup#711 ·
维护者通常 1 天内回复
查看 richshaw/OpenSignup 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 85/100
components-web-app/docs#311 ·
-
难度 2/5 1-3 小时 新手友好度 82/100
NEARBuilders/everything-dev#678 ·
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 90/100
formbricks/formbricks#9881 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复