Participant name and notes limits are typed twice, in the schemas and on the participant pages
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 83/100
- Tipo di issue
- Refactoring
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
Direzione di ricerca
Inizia da src/lib/magic-compose/limits.ts e dai file indicati nell’issue: src/schemas/common.ts, src/schemas/commitments.ts, src/app/s/[slug]/name-message.ts, src/app/s/[slug]/participant-fields.tsx, oltre alla pagina New signup e al relativo schema. Sposta i limiti dei partecipanti nel modulo indicato, privo di import, e riutilizza i limiti esistenti per signup. Mantieni zod fuori dalle pagine dei partecipanti e lascia gli input del nome senza maxLength. Il lavoro è terminato quando ogni limite ha un’unica fonte e i controlli indicati di lint, typecheck, knip, test, build e budget hanno esito positivo.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- TypeScript
- Stelle
- 19
- Fork
- 4
- Merge medio
- 22h 46m
- PR unite (30g)
- 170
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di richshaw/OpenSignup
-
bug pipeline:proposed pipeline:ux
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
richshaw/OpenSignup#711 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement pipeline:proposed pipeline:ux
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
richshaw/OpenSignup#654 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement pipeline:proposed pipeline:ux
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
richshaw/OpenSignup#652 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement pipeline:proposed pipeline:ux
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
richshaw/OpenSignup#589 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement pipeline:proposed pipeline:ux
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
richshaw/OpenSignup#588 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di richshaw/OpenSignup
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
CopilotKit/openmuse#215 ·
I maintainer di solito rispondono entro 3 giorni
-
b:minor bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
software-mansion/argent#1698 ·
I maintainer di solito rispondono entro 1 giorno
-
e2e-failure ready-to-code
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
redhat-developer/rhdh-plugin-export-overlays#4624 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno