Repository navigation
Let the candidate restore the starter code - #398
Merged
Merged
Conversation
jserv
reviewed
Oct 21, 2026
jserv
reviewed
Oct 21, 2026
jserv
reviewed
Oct 21, 2026
This was referenced Oct 21, 2026
jserv
reviewed
Oct 22, 2026
jserv
left a comment
Contributor
There was a problem hiding this comment.
Please fold the six commits into one when you address these; the folded message should drop the sentence from f3a0673 saying a browser that refuses the command asks before assigning value, since eae3bf3 reversed it.
web/interview.html:210: This comment still says the toolbar stays one row, but the PR body notes it now wraps at 750 to 780 px and 1130 to 1160 px, and the restore button sits in the display-settings group although it edits code. Either move the button next to the language tabs or update the comment.
RWong04
force-pushed
the
restore-starter-code
branch
from
October 22, 2026 05:09
628f0dc to
e52ffae
Compare
RWong04
force-pushed
the
restore-starter-code
branch
from
October 22, 2026 05:19
e52ffae to
a5c9b40
Compare
jserv
reviewed
Oct 22, 2026
jserv
reviewed
Oct 22, 2026
RWong04
force-pushed
the
restore-starter-code
branch
from
October 22, 2026 07:16
a5c9b40 to
38fc029
Compare
jserv
reviewed
Oct 22, 2026
ColtenOuO
reviewed
Oct 22, 2026
RWong04
force-pushed
the
restore-starter-code
branch
from
October 22, 2026 13:14
38fc029 to
972847b
Compare
jserv
reviewed
Oct 22, 2026
jserv
reviewed
Oct 22, 2026
RWong04
force-pushed
the
restore-starter-code
branch
2 times, most recently
from
October 22, 2026 13:51
37d0400 to
cc9500d
Compare
jserv
reviewed
Oct 22, 2026
RWong04
force-pushed
the
restore-starter-code
branch
from
October 22, 2026 14:34
cc9500d to
05e84c8
Compare
RWong04
force-pushed
the
restore-starter-code
branch
from
October 22, 2026 14:58
05e84c8 to
b9c61be
Compare
jserv
reviewed
Oct 23, 2026
RWong04
force-pushed
the
restore-starter-code
branch
from
October 23, 2026 09:00
b9c61be to
d5ba25a
Compare
jserv
reviewed
Oct 23, 2026
jserv
requested changes
Oct 23, 2026
jserv
left a comment
Contributor
There was a problem hiding this comment.
Rebase latest main branch and resolve conflicts.
ColtenOuO
reviewed
Oct 23, 2026
RWong04
force-pushed
the
restore-starter-code
branch
from
October 23, 2026 11:11
d5ba25a to
9b8f2b8
Compare
jserv
reviewed
Oct 23, 2026
Add a control beside the language picker that puts the current language's starter back through insertText, so one Ctrl+Z returns the code. A browser without that command, or one that refuses it, would drop undo, so there the first press leaves the code alone and only arms the control, and a second one confirms. The restore keeps a trailing newline out of the replaced span, because Chromium redoes that wrongly. The control is disabled while paused and once coding is closed.
RWong04
force-pushed
the
restore-starter-code
branch
from
October 23, 2026 11:35
9b8f2b8 to
07c4e56
Compare
Contributor
|
Thank @RWong04 for contributing! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a restore control beside the language picker that puts the current language's starter back, as accepted in #348.
The starter goes in through insertText over just the span that differs, so one Ctrl+Z restores the previous buffer. A browser without that command, or one that refuses it, would have to assign the buffer and leave nothing to undo; there the first press leaves the code alone and only arms the control, and a second press confirms. Chromium redoes a replaced selection that ends in a newline wrongly, so for the restore only, that newline is removed by a forward delete in the same undo step. Undo does not survive a language switch, which holds for any edit and is #365's subject. The control is disabled while paused and in the behavioral round, and does nothing once coding is closed.
The reset is an ordinary code_update, so no message type, recording kind or contract version changes. A Test credit already recorded survives it: reconcile_received_test (src/agent.rs:2776) appends a Test row only while test_recordable (src/agent.rs:2171) holds, and nothing removes a recorded row, since evict_one_observation (src/agent.rs:1515) never takes a phase's only one. A reset before the run is recorded stops it, so the candidate must write and run again.
Screenshots, from a page with no interview running: an edited buffer, the code after one press, after Ctrl+Z, the control dimmed while paused, a 390 px wide screen, and the prompt shown by a browser without insertText






Validation: restore-starter.test.js adds 52 tests, and each deliberate breakage I tried fails at least one. ./scripts/test.sh passes with 1599 browser and 1886 Rust tests; skipped locally are commentflow, actionlint and the Linux-only Clang fetch. I also restored the starter in every offered language of all 151 problems (747 cases): one press restores, and undo and redo are exact. A live LiveKit and Gemini session was run on an earlier revision, where the first press armed, and not repeated.
Limits: the toolbar wraps to a second row at 590 to 620 px, and the icon-only control relies on its tooltip and aria-label. In Playwright's WebKit a restore joins the typing before it, so one Cmd+Z undoes both. Safari's click-without-focus behaviour is modelled in a test, not tried in real Safari. Firefox could not be launched here, so it is unchecked whether it records the insert and the forward delete as one undo step.
Closes #348
Summary by cubic
Adds a Restore starter button to the editor toolbar so a candidate can put the current language's starter code back and start over. The reset goes through the browser's editing command over just the differing span, so one Ctrl+Z (Cmd+Z on Mac) restores the previous buffer; a trailing newline is handled separately to avoid a Chromium redo bug. In browsers without a working editing command, the first press only arms the control and a second press confirms, both in the toolbar. Only the current language's buffer changes, the reset sends as a normal
code_update, and the button is inert while paused, in the behavioral round, or after coding closes. Closes #348.Written for commit 07c4e56. Summary will update on new commits.