Participant name and notes limits are typed twice, in the schemas and on the participant pages
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 83/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
Hướng nghiên cứu
Bắt đầu với src/lib/magic-compose/limits.ts và các tệp được nêu trong issue: src/schemas/common.ts, src/schemas/commitments.ts, src/app/s/[slug]/name-message.ts, src/app/s/[slug]/participant-fields.tsx, cùng trang New signup và schema của trang đó. Chuyển các giới hạn của người tham gia vào mô-đun được chỉ định, không có import, và tái sử dụng các giới hạn signup hiện có. Không đưa zod vào các trang người tham gia và để các ô nhập tên không có maxLength. Hoàn tất khi mỗi giới hạn chỉ có một nguồn và các bước kiểm tra lint, typecheck, knip, test, build và budget được liệt kê đều đạt.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- TypeScript
- Star
- 19
- Fork
- 4
- Merge trung bình
- 22 giờ 46 phút
- Pull request đã merge (30 ngày)
- 170
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
-
bug pipeline:proposed pipeline:ux
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
richshaw/OpenSignup#711 ·
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
-
enhancement pipeline:proposed pipeline:ux
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
richshaw/OpenSignup#652 ·
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 76/100
richshaw/OpenSignup#589 ·
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 78/100
richshaw/OpenSignup#588 ·
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ự
-
bug ready-for-agent
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
PhyberApex/kuroshiro#1687 ·
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 73/100
microsoft/monaco-editor#5563 ·
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
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
awslabs/visual-asset-management-system#937 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100