The sign-up dialog decides "See alternatives" with its own copy of the rule behind "Pick another slot."
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Refactorización
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- next.js, react, typescript
Línea de trabajo
Read src/app/s/[slug]/capacity-message.ts and src/app/s/[slug]/commit-dialog.tsx, then inspect src/app/s/[slug]/capacity-message.test.ts and the server's SlotAlternative type in src/services/commitments.ts. Add a unit test for empty and missing alternatives, and confirm the shared rule drives both the suggestion and link; the issue also requires the listed lint, format, typecheck, knip, and test commands to pass. Pull request #806 is already open.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What happens
When a slot fills while someone is signing up, the dialog decides twice whether to point them at other slots:
- The words.
capacityMessageinsrc/app/s/[slug]/capacity-message.tsadds "Pick another slot." only when the error iscapacity_full,remainingandrequestedare numbers,remaining <= 0, anddetails.alternativesis a non-empty array. - The link.
CommitDialoginsrc/app/s/[slug]/commit-dialog.tsxshows its "See alternatives" link with its own inline check:error.details?.alternatives?.length && error.details.remaining === 0. That check doesn't look at the error code orrequested, and uses=== 0where the other uses<= 0.
The dialog's local ApiError type also describes the alternatives wrongly, as { id: string; title: string }[]. The server sends SlotAlternative, which is { id, ref, slotAt } (src/services/commitments.ts). Nothing reads title, so nothing renders wrong, but the type misleads the next person who does.
Today the two checks agree on every payload the server can send, because capacityFull always sends remaining and requested as numbers and clamps remaining at 0. They only disagree on payloads the server never sends. So this is drift waiting to happen, and nobody sees a difference now.
Fix, in outline
- In
capacity-message.ts, export one small function (for exampleoffersAlternatives(error)) that holds the rule:capacity_full, a finiteremaining <= 0, and a non-emptyalternativesarray. Use it incapacityMessage's join branch. - In
commit-dialog.tsx, show "See alternatives" from that same function instead of the inline condition. - Fix the
alternativestype in the dialog'sApiErrorto matchSlotAlternative(orunknown[], since only its length is used). - Add a unit test in
capacity-message.test.tsfor the new function, including an emptyalternativesarray and a payload with noalternativeskey (the change-quantity path sends none).
Watch for
- No visible change. The hint and the link must still appear together, only when the slot is full and the server found at least one open slot. The wording and the link target (
/s/<slug>) stay as they are. - Server side is done. #782 / #787 fixed which slots the server offers. Leave
src/services/commitments.tsalone. participantErrorCopyinparticipant-error.tscallscapacityMessage; it shouldn't need to change.
Done when
- The "See alternatives" link and the "Pick another slot." suggestion are decided by one function.
- The dialog's
alternativestype matches what the server sends. - A unit test pins the function.
pnpm lint && pnpm format:check && pnpm typecheck && pnpm knip && pnpm testpass.
Found by the pipeline's refactor scout in the participant pages (src/app/s/[slug]), at d1e9e14. Checked by an independent verify agent, which ran a scratch vitest of both conditions over every payload shape the server sends (19 of 19 agree) and over synthetic ones where they differ, and grepped every use of alternatives. https://claude.ai/code/session_016YZ9SSPmh7nC1k9RsPc5NE
- Lenguaje dominante
- TypeScript
- Estrellas
- 19
- Forks
- 4
- Merge medio
- 19 h 27 min
- PR fusionados (30 d)
- 199
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de richshaw/OpenSignup
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
richshaw/OpenSignup#794 ·
Los mantenedores suelen responder en 1 día
-
enhancement pipeline:proposed pipeline:ux
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
richshaw/OpenSignup#654 ·
Los mantenedores suelen responder en 1 día
-
Slot times are shown with their own copy of the HH:MM rule that saving them checksPosiblemente ocupada @novakzx la tomó hoy. Abiertoenhancement good first issue pipeline:ready
Dificultad 2/5 1-3 horas Aptitud para principiantes 25/100
richshaw/OpenSignup#805 ·
Los mantenedores suelen responder en 1 día
-
A failed database query logs its parameters, so OAuth tokens and participant details can end up in the logsPosiblemente ocupada @richshaw la tomó hace 1 día. Abiertobug pipeline:building
richshaw/OpenSignup#800 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Two breadcrumb pages belong to URLs that always redirect, so they never showPosiblemente ocupada @richshaw la tomó hace 2 días. Abiertoenhancement good first issue pipeline:stuck
richshaw/OpenSignup#793 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de richshaw/OpenSignup
Issues similares
-
The sample email preview's ResizeObserver is never disconnected and keeps raising errors after leaving SettingsPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
area:ui bug effort:S priority:P2
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Typo in WSL project description on Projects pagePosiblemente ocupada @akhil9tiet la tomó hoy. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
microsoft/opensource.microsoft.com#1066 · 1 comentario ·
-
ArcGIS Maps SDK for JavaScript c-carousel calcite-design-tokens enhancement impact - p3 - not time sensitive needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Esri/calcite-design-system#15565 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
linkwarden/linkwarden#1891 ·
Los mantenedores suelen responder en 1 día