Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Allow deselecting a chosen problem card by clicking it again

Open Beginner friendly
#392 4 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@woohsin is already working on this.

Since Oct 21, 2026.

  • #455 by @woohsin — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
frontend

Research direction

Start at the landing page code that renders the “Choose a specific problem instead” section and handles problem card clicks. Trace how the selected problem is stored and how the default recommended problem is chosen. Toggle the current selection off on a second click while keeping the section open; done when selecting a card and clicking it again restores the default.

Written by the indexing model from the issue text.

Description

Reproduction

Tested at commit 8394d54 (or current main):

  1. Navigate to the lobby page.
  2. In the problem picker, click any problem card (e.g., template-delimiter-audit). The card is marked as selected, setting manualProblem = true.
  3. Click the same problem card again.
  4. Observed: The card remains permanently locked as manually selected; clicking it again re-selects it and does not release the manual override to revert to the default recommendation engine without reloading the page or clicking random.
  5. Expected: Clicking the active card toggles off the manual selection, clearing manualProblem and keptDraw, and re-triggers recommend() if historyReady is true (or calls setProblem(null) if not), releasing the manual override.

Proposed Change

Update the problem card click handler in web/app.js (lines 246–254) to release the manual selection the way a difficulty or filter change already does (web/app.js:288-300, :1023-1033). When clicking an already selected card, clear manualProblem and keptDraw together, then invoke recommend() if history is ready and setProblem(null) if it is not:

for (const card of cards) {
  card.button.addEventListener("click", () => {
    if (manualProblem && problem === card) {
      manualProblem = false;
      keptDraw = null;
      if (historyReady) {
        recommend();
      } else {
        setProblem(null);
      }
      return;
    }
    manualProblem = true;
    setProblem(card);
    setDuration(suggestedDuration(new Set([card.difficulty])));
    nodes.recommendation.textContent = `Selected problem: ${title(card)}.`;
  });
}
Orthogonality with #394

Issue #394 refactors DOM structure by moving details.problem-picker below setup panels and adjusting .lobby .problem-grid in web/styles.css. Because card event binding in web/app.js queries [data-problem] buttons directly and operates on problem, manualProblem, and keptDraw state flags, this toggle logic is completely independent of the DOM hierarchy and layout adjustments in #394.


Test Plan

Add browser-level Playwright tests in tests/browser/lobby.test.js:

  1. Verify clicking an unselected .problem-card sets manual selection (manualProblem = true) and updates the prompt to Selected problem: ....
  2. Verify clicking the same active card releases the manual override (manualProblem = false, keptDraw = null).
  3. Verify that releasing the manual override triggers recommend() and allows the recommendation engine to choose the next problem (including the case where the recommendation lands on the same card).
  4. Verify starting an interview launches with the currently assigned problem (?problem=...), whether chosen manually or via automatic recommendation.
Dominant language
Rust
Stars
177
Forks
100
Avg merge
1d 9h
Merged PRs (30d)
209

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sysprog21/codetrial

All issues in sysprog21/codetrial

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.