Skip to content

Restore interview settings when retrying - #269

Merged
jserv merged 1 commit into
sysprog21:mainfrom
yuuka5555:remember-interview-setting
Oct 13, 2026
Merged

jserv merged 1 commit into
sysprog21:mainfrom
yuuka5555:remember-interview-setting

Conversation

@yuuka5555

@yuuka5555 yuuka5555 commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Try Again previously restored only the selected problem, requiring candidates to choose the interview settings again.

This change restores the previous attempt's:

  • Interview duration
  • Coding-only or coding + behavioral loop
  • Editor or whiteboard mode

It also remembers lobby settings across reloads, preserves current duration limits, and explains when a saved duration must be adjusted. Older attempts without saved settings use the existing defaults.

Closes #207

Validation

  • Manually confirmed that Try Again restores the attempt's problem and settings.
  • Affected test suites: 194 passed, no failures.
  • Rust library tests in a clean checkout with Unix line endings: 720 passed, 8 ignored.
  • Controlled browser comparison: the unchanged baseline had 981 passing tests and 5 failures; this branch had 993 passing tests and the same 5 failures.
  • Prettier, ESLint, Rust formatting, and Clippy passed.

The full local Windows verification gate did not pass. Investigation traced the remaining failures to Windows paths, line endings, and existing test-harness issues. No new failures appeared in the browser comparison. Some optional checks were skipped because their tools were unavailable.


Summary by cubic

Try Again now restores the previous attempt's interview settings (duration, loop, and mode) so candidates don't have to re-choose them. Lobby settings are remembered across reloads, and saved durations are adjusted when they exceed the current cap. Closes #207. Browser test editor setup now waits for delayed problem initialization before clearing the starter buffer.

Details

  • Saves interviewMode in history entries alongside duration and loop, and restores settings from account or device history.
  • Ignores Try Again, loop, and duration clicks while an interview start is pending, and falls back to defaults for older attempts without saved settings.
  • Uses the server limit and explains it when no offered duration fits the cap; only explicit duration choices are saved.
  • Invalid or blocked preference storage still leaves the lobby usable.
  • Adds delayed-response coverage for the editor initialization race.

Validation

  • 224 combined browser tests pass (including new coverage for retry settings, preference persistence, pending starts, duration limits, editor initialization, and invalid storage); Rust library tests pass (720 passed, 8 ignored).

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

View guided diff

cubic-dev-ai[bot]

This comment was marked as resolved.

Comment thread web/app.js Outdated
Comment thread web/app.js
Comment thread web/app.js

@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 include a commit body to make it easier to track for future collaboration.

@yuuka5555
yuuka5555 force-pushed the remember-interview-setting branch 2 times, most recently from aae9158 to 263db84 Compare October 10, 2026 08:12
@yuuka5555

Copy link
Copy Markdown
Contributor Author

@ColtenOuO Thanks for the feedback. I added explanatory bodies to both commits and pushed the updated history. Could you review the updated commit messages?

@jserv
jserv requested a review from ColtenOuO October 10, 2026 14:47

@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.

The code changes look good to me, but could you squash the commits into one (since the second commit just fixes an issue introduced by the first)?

Please also update the commit title or body accordingly after squashing.

@yuuka5555
yuuka5555 force-pushed the remember-interview-setting branch from 263db84 to dc801b1 Compare October 10, 2026 17:29
@yuuka5555

Copy link
Copy Markdown
Contributor Author

@ColtenOuO Thanks for reviewing. I squashed the two commits into one, updated the commit message to describe the complete change, and pushed the updated history.

@jserv jserv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Rebase latest main branch and resolve conflicts.

@yuuka5555
yuuka5555 force-pushed the remember-interview-setting branch from dc801b1 to 6abd02f Compare October 11, 2026 07:38
@yuuka5555

Copy link
Copy Markdown
Contributor Author

Rebased onto the latest main and resolved the conflict while preserving the editor-options behavior. All 203 affected tests pass.

@jserv jserv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Resolve regressions raised by CI.

@yuuka5555

Copy link
Copy Markdown
Contributor Author

@jserv Could you rerun the failed check job? It timed out while clearing the editor during setup for “a loaded grammar replaces cached fallback ranges without an edit.”

I reran the complete editor-pipeline suite locally: all 17 tests passed. This PR does not modify the editor implementation or that test. I don’t have permission to rerun the upstream workflow.

@jserv

jserv commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

I reran the complete editor-pipeline suite locally: all 17 tests passed. This PR does not modify the editor implementation or that test. I don’t have permission to rerun the upstream workflow.

Do more analysis and refinements.

@yuuka5555
yuuka5555 force-pushed the remember-interview-setting branch from 6abd02f to 1265ebb Compare October 11, 2026 08:35
@yuuka5555

Copy link
Copy Markdown
Contributor Author

I reproduced an initialization race by holding the problem response. The textarea is already enabled in the initial HTML, so the old helper could clear it before initialization later inserted starter code.

Updated the helper to wait until editor initialization completes and added a delayed-response regression test. The test fails with the old readiness check and passes with the refinement. All 221 combined tests pass locally, along with ESLint and Prettier.

@jserv
jserv requested a review from ColtenOuO October 11, 2026 08:46
Comment thread web/app.js
@yuuka5555
yuuka5555 force-pushed the remember-interview-setting branch from 1265ebb to e304940 Compare October 12, 2026 10:34
ColtenOuO

This comment was marked as 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.

Dismiss approval

There's no need to include 'All 224 combined tests pass' in the commit body.

Please focus the commit message on the changes themselves -- why they were made and what was changed.

@yuuka5555
yuuka5555 force-pushed the remember-interview-setting branch from e304940 to 7e84bcb Compare October 12, 2026 15:13
@yuuka5555

Copy link
Copy Markdown
Contributor Author

Updated the commit body to focus on the changes and their rationale, and removed the test-result statement.

Comment thread web/app.js Outdated
Comment thread web/app.js Outdated
Try Again restored only the problem, requiring candidates to choose
the duration and interview modes again. Restore the attempt's saved
duration, interview loop, and editor or whiteboard mode.

Remember lobby preferences across reloads. Keep the explicitly chosen
duration separate from the effective server limit so changing modes
under a temporary cap does not erase the original preference. Explain
adjustments when the server cannot offer the requested duration.

Treat legacy attempts without duration metadata as suggestions. Keep
any existing explicit duration choice and do not persist a suggested
length or prevent later difficulty-based suggestions.

Ignore retry, loop, and duration clicks during startup so stored
preferences stay consistent with the interview being opened. Add
regression coverage for retries, persistence, caps, and pending starts.

Wait for editor initialization before clearing starter code in browser
tests, preventing a late problem response from replacing the cleared
buffer. Add delayed-response coverage for this initialization race.
@yuuka5555
yuuka5555 force-pushed the remember-interview-setting branch from 7e84bcb to ed5b88b Compare October 13, 2026 12:34
@jserv
jserv requested a review from ColtenOuO October 13, 2026 12:50

@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.

Thanks, LGTM.

@jserv
jserv merged commit 794f4db into sysprog21:main Oct 13, 2026
6 checks passed
@jserv

jserv commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Thank @yuuka5555 for contributing!

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.

Remember interview settings and add a “Practice again with the same settings” option

3 participants