Allow deselecting a chosen problem card by clicking it again
Los mantenedores suelen responder en 1 día
@woohsin ya está trabajando en esto.
Desde el 21/10/2026.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 68/100
Línea de trabajo
Empieza por el código de la página de inicio que muestra la sección «Elige un problema específico en su lugar» y gestiona los clics en las tarjetas de problemas. Sigue cómo se guarda el problema seleccionado y cómo se elige el problema recomendado por defecto. Desactiva la selección actual con un segundo clic y mantén abierta la sección; estará hecho cuando seleccionar una tarjeta y volver a hacer clic en ella restablezca el problema predeterminado.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Here is the detailed analysis of the current lobby selection flow and the consolidated proposal based on web/app.js.
1. Current Implementation Analysis
-
Event Listener & State (
web/app.js:246-254):
Inweb/app.js, cards are derived from[data-problem]buttons and initialized withmark(card.button, false). Clicking a card executes:for (const card of cards) { card.button.addEventListener("click", () => { manualProblem = true; setProblem(card); setDuration(suggestedDuration(new Set([card.difficulty]))); nodes.recommendation.textContent = `Selected problem: ${title(card)}.`; }); } -
The Issue:
The listener unconditionally setsmanualProblem = true, updatesproblem = card, marks the button viamark(card.button, true)insidesetProblem(), and updates the recommendation prompt. It does not check whethermanualProblem && problem === card. Clicking the active card re-applies the manual override. -
Fallback Behavior:
recommend(note = "", mode = "recommend")returns early without updating recommendation elements whenevermanualProblemis active. Currently, the only way a candidate can revert to the automatic recommendation engine is by clicking#random-problem(nodes.randomProblem), which resetsmanualProblem = falseand callsrecommend("", "random"), or by reloading the page.
2. Consolidated Proposal
-
Toggle Selection on Card Click:
Update the click handler inweb/app.jsto inspect whether the clicked card is already active (manualProblem && problem === card):-
When selecting a new card: Preserve the current behavior (
manualProblem = true,setProblem(card), update duration, and setnodes.recommendation.textContent). -
When clicking the currently selected card: Toggle it off by resetting
manualProblem = false, clearing the card mark viamark(card.button, false), clearing or resettingproblem = null, and invokingrecommend()to restore the default overdue/unseen recommendation and lobby controls.
for (const card of cards) { card.button.addEventListener("click", () => { if (manualProblem && problem === card) { manualProblem = false; mark(card.button, false); problem = null; recommend(); return; } manualProblem = true; setProblem(card); setDuration(suggestedDuration(new Set([card.difficulty]))); nodes.recommendation.textContent = `Selected problem: ${title(card)}.`; }); } -
-
Orthogonality with #394:
Issue #394 movesdetails.problem-pickerbelow the setup panels and adjusts.lobby .problem-gridinweb/styles.css. Because card event binding inweb/app.jsqueries[data-problem]buttons directly and operates onproblemandmanualProblemstate flags, this toggle logic does not depend on DOM hierarchy or CSS layout, making it completely orthogonal to and forward-compatible with #394.
3. Test Plan
Add browser-level Playwright tests in tests/browser/lobby.test.js:
-
Verify clicking a
.problem-cardapplies.selected, setsaria-pressed="true", and displays"Selected problem: ..."innodes.recommendation. -
Verify clicking the same active card removes
.selected, resetsaria-pressed="false", clearsmanualProblem, and restores the default recommendation prompt. -
Verify launching an interview after deselecting proceeds with the recommended practice problem without an explicit
?problem=query parameter.
- Lenguaje dominante
- Rust
- Estrellas
- 177
- Forks
- 100
- Merge medio
- 1 d 9 h
- PR fusionados (30 d)
- 151
Preparar el entorno
- Sin Dockerfile ni 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 sysprog21/codetrial
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 1 día
-
Audio output can be confirmed without playing a test soundPosiblemente ocupada @ChenYingHan1121 la tomó hace 3 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
sysprog21/codetrial#359 · 4 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Add a Copy code button to the final reportPosiblemente ocupada @yansawu la tomó hace 3 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
sysprog21/codetrial#318 · 5 comentarios · 2 reacciones · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Outline Snapshot Duplicator question accept a copied random list that loops back into itselfPosiblemente ocupada @papaya0112 la tomó hoy. Abierto
sysprog21/codetrial#417 · 3 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Add a live camera preview during the media preflightPosiblemente ocupada @ChenYingHan1121 la tomó hoy. Abierto
sysprog21/codetrial#414 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de sysprog21/codetrial
Issues similares
-
area: config effort: S good first issue P3 type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
ferenyl/azuredevopstui#63 ·
-
needs-triage O-Arm T-libs
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
bug CLI config mcp
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
documentation good first issue
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
yunaremaia/sandbox-ffi-layers#56 ·
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
git-ai-project/git-ai#2434 ·
Los mantenedores suelen responder en 1 día