Allow deselecting chosen problem card on click

WO
12m ago
+32-1

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 = false and keptDraw = null.
  • Invokes recommend() if history is ready to fall back to the default recommendation engine, or setProblem(null) if it is not.
  • Preserves the existing searchVisibilityException state when selecting/reselecting.

Verification

Added browser test in tests/browser/lobby.test.js to verify:

  1. Clicking a problem card applies manual selection (snap.card === cardId, prompt updated).
  2. Clicking the active card releases the manual override (manualProblem = false, keptDraw = null) and re-triggers recommend(), 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 manualProblem and keptDraw, then re-triggers recommend() when history is ready, or clears the problem and its recommendation text otherwise.
  • Preserves the searchVisibilityException state when reselecting.
  • Adds a browser test that toggles the active card off and verifies the picker falls back to the default recommendation.

Closes #392.