Repository navigation
Conversation
| undefined, | ||
| avoidedProblem, | ||
| cards, | ||
| pickerMode, |
There was a problem hiding this comment.
pickerMode is set to "random" and never goes back to "recommend", so after one click every later recommend() draws uniformly: filterSelectionChanged(), sign-in, report deletion and every settle(). Concrete case: click Random and get X, finish X, press Back. The bfcache restore refetches reports that now record X as passed, yet roll, avoidedProblem and the pool are unchanged, so settle() offers X again (and silently drops the reason keptDraw is cleared there). Reset to "recommend" wherever avoidedProblem is reset to undefined, and in settle() whenever the reports differ from the ones the random draw was made from (track them the way keptDraw does).
jserv
left a comment
There was a problem hiding this comment.
Check CONTRIBUTING.md carefully and enforce the rules. In particular, the manner for writing git commit messages.
ac3968c to
c06be4d
Compare
|
Before asking someone to review, you MUST resolve any regressions flagged by GitHub Actions. |
162d9ee to
e299d69
Compare
| // Keep the exclusion with the roll so restoring the page repeats the same draw. | ||
| let avoidedProblem; | ||
| // Preserve the draw policy as well as its roll during history/page restores. | ||
| let pickerMode = "recommend"; |
There was a problem hiding this comment.
A back/forward restore does not keep the draw: the pageshow handler clears problemTopic but leaves pickerMode, roll and avoidedProblem as they were. After Random under a topic filter, going to preflight and back re-runs the same roll over the unfiltered pool and selects a different problem. Either keeping the topic on restore, or resetting the draw there the way the topic-change handler does, would make the two agree.
Random draws previously prioritized overdue reviews, leaving unseen problems unreachable while reviews were due. Draw uniformly from the selected difficulty and topic pool so all eligible problems have an equal chance, avoiding the current problem when alternatives exist. Initial recommendations retain review priority, while random draws show the selected problem's difficulty.
Random draws previously prioritized overdue reviews, preventing unseen problems from being selected when due reviews were available. Select uniformly from the chosen difficulty and topic pool so every eligible problem has an equal chance, excluding the current problem when another is available. Preserve review priority for initial recommendations and show the drawn problem's difficulty so users can identify its level. Refs sysprog21#210 Co-authored-by: Jim Huang <jserv.tw@gmail.com>
The combined test entered random mode before changing difficulty, so it could not detect a missing mode assignment in the level handler. An independent fresh-lobby case checks the level and review note.
A cached lobby kept its random selection after the interview completed, so refreshed reports could offer the same passed problem again. Retain the draw while history is unchanged, but return to recommendations when new reports replace the history it was drawn from.
A history refresh can arrive before a draw has been shown. Compare the reports only when a snapshot exists so the pending selection survives until the history is ready. Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Only explicit random draws should bypass scheduled reviews. Filter redraws now return to recommendations, and new requests clear the previous history snapshot. This preserves review priority and prevents history refreshes from treating a new selection as an old draw. Tests cover filters after random draws and changes during restored history.
The indentation gate rejects the long picker call in the regression test. Apply the repository formatter so CI can finish its checks.
Deleting reports or merging older account history should not revoke a random choice. End the draw only for a newly graded attempt at that problem, and reset a topic-filtered draw when restoration clears its topic so the restored selection follows the same filter policy.
A completed interview should end its own random draw even when the system clock moves backward. Carry a tab-local draw identity into the interview and consume its graded completion marker on return, so old reports and older interviews cannot revoke a newer selection. Storage failures leave navigation and report saving usable.
Returning from an unfinished interview must keep its random draw even when the browser reloads the lobby or tab storage is blocked. Carry the draw identity through navigation and graded reports so only that interview's completion restores recommendations, while history changes remain independent of the candidate's selection.
3752b2b to
a6dbeba
Compare
Returning from an interview can reconstruct the lobby and discard explicit difficulty and duration choices. Restore these choices before applying suggestions so clearing a topic filter retains the candidate's preferences and later difficulty changes respect a manual duration.
jserv
left a comment
There was a problem hiding this comment.
Fold similar commits and refine git commit messages per CONTRIBUTING.md.
jserv
left a comment
There was a problem hiding this comment.
Rebase latest main branch and resolve conflicts.
Explicit random selection currently shares the spaced-review recommendation policy. When multiple problems are overdue, repeated clicks can cycle through those problems indefinitely, excluding unseen problems and selecting reviews outside the chosen difficulties.
Separate explicit random selection from automatic recommendations. Random draws uniformly sample the problems matching the selected difficulties and topic filter, excluding the current problem whenever an alternative exists. Initial recommendations retain overdue-review priority across the broader review pool. Random selections also display the problem's difficulty.
Add regression tests for unseen-problem eligibility, difficulty filtering, current-problem exclusion, single-problem and empty pools, and the distinction between filtered practice and broader review recommendations. Update the lobby's expected selection text and add browser coverage for random selection, page restoration, and difficulty changes.
Validation:
node --test tests/browser/problem-picker.test.js tests/browser/lobby.test.jscompleted with 43 tests passing, no failures, and 112 browser tests skipped because Playwright Chromium was unavailable. The JavaScript syntax check andgit diff --cached --checkpassed. The required./scripts/test.shgate has not been run, and browser interaction remains unverified locally.Closes #210
Summary by cubic
Separates explicit random selection from the spaced-review recommendation policy so random draws sample uniformly from the problems matching the selected difficulties and topic filter, show the drawn problem's difficulty, and exclude the current problem whenever an alternative exists. Recommendations keep overdue-review priority across the broader review pool.
Written for commit d6f4ca2. Summary will update on new commits.