Skip to content

Allow deselecting chosen problem card on click - #455

Open
woohsin wants to merge 1 commit into
sysprog21:mainfrom
woohsin:deselect-problem-card-392
Open

woohsin wants to merge 1 commit into
sysprog21:mainfrom
woohsin:deselect-problem-card-392

Conversation

@woohsin

@woohsin woohsin commented Oct 23, 2026 •

Copy link
Copy Markdown

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.

Written for commit d798e17. Summary will update on new commits.

View guided diff

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 2 files

You’re at about 98% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.

Reply to a comment to ask cubic a question or push back. It learns from your replies.

View guided diff | Re-trigger cubic

Comment thread tests/browser/lobby.test.js Outdated
Comment thread web/app.js
Comment thread tests/browser/lobby.test.js Outdated

@ColtenOuO ColtenOuO left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please squash your commit.

@ColtenOuO ColtenOuO changed the title web: allow deselecting chosen problem card on click Allow deselecting chosen problem card on click Oct 23, 2026
Support toggling off a manually selected problem card by clicking it again. Clicking the active card clears manualProblem and keptDraw, and re-triggers recommend() if history is ready (or setProblem(null) and clears recommendation note if not) to restore the default recommendation state.

Closes sysprog21#392
@woohsin
woohsin force-pushed the deselect-problem-card-392 branch from 5d21671 to d798e17 Compare October 23, 2026 20:15
@woohsin

woohsin commented Oct 23, 2026

Copy link
Copy Markdown
Author

Squashed into a single commit. Thanks for the guidance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow deselecting a chosen problem card by clicking it again

2 participants