Allow deselecting chosen problem card on click
WO
12m ago+32+32+01234567890123456789-1-1-0123456789
Summary
Support deselecting an active problem card by clicking it again in the lobby problem picker.
When the currently chosen card is clicked:
- Releases the manual selection state by resetting
manualProblem = falseandkeptDraw = null. - Invokes
recommend()if history is ready to fall back to the default recommendation engine, orsetProblem(null)if it is not. - Preserves the existing
searchVisibilityExceptionstate when selecting/reselecting.
Verification
Added browser test in tests/browser/lobby.test.js to verify:
- Clicking a problem card applies manual selection (
snap.card === cardId, prompt updated). - Clicking the active card releases the manual override (
manualProblem = false,keptDraw = null) and re-triggersrecommend(), clearing the manual selection prompt.
Closes #392
Summary by cubic
Clicking the currently chosen problem card in the lobby picker now releases the manual selection and restores the default recommendation.
- Resets
manualProblemandkeptDraw, then re-triggersrecommend()when history is ready, or clears the problem and its recommendation text otherwise. - Preserves the
searchVisibilityExceptionstate when reselecting. - Adds a browser test that toggles the active card off and verifies the picker falls back to the default recommendation.
Closes #392.