Let the candidate restore the starter code
Maintainers usually reply within 1 day
@RWong04 is already working on this.
Since Oct 18, 2026.
Assessment
This issue has not been assessed yet.
Description
Who is affected
A candidate in a coding interview who has edited the editor into a state they want to start over from. The starter is the only template they have, and nothing on the interview page puts it back.
Observed
On main at 1ba82f9, with cargo run -- web and ?problem=chargeback-pair-match, I replaced the Python buffer with my own text, clicked JavaScript and then Python again, and the buffer still held my text. Ctrl+Z at that point did not bring the starter back either. The page has no control with a reset, restore or starter label: I listed every button and summary on the interview page and found none. codeByLanguage is seeded from problem.starterCode once (web/interview.js:422), and setLanguage only swaps buffers between tabs (web/interview.js:2209).
Desired outcome
The candidate can put the starter code of the language they are in back into the editor, without leaving the interview.
Present workaround
Select all, delete, and retype the signature and the class wrapper.
Scope
The editor toolbar and the editor buffer on the interview page, in web/interview.html and web/interview.js. Not the agent, the recording contract, the judges or the problem bank. I have no data on how often candidates want this, so this issue rests on the missing path, not on a measured need.
Approaches
- A button that replaces the buffer at once. Smallest change, but one misclick discards the candidate's work with no way back.
- The same button behind a confirmation. Safe, but adds a step, and a modal competes with the Meet presentation flow.
- A button that replaces the buffer through
document.execCommand("insertText"), as the editor's own programmatic edits already do (web/interview.js:817), so Ctrl+Z restores the previous buffer. No extra step, but undo depends on the browser accepting the command, and the existing fallback assigns.value, which drops the undo history.
I prefer 3 with the fallback taking the confirmation of 2, so the case where undo is unavailable is the only one that asks.
Compatibility
No new message type or recording kind is needed. A reset is a new code_update, and the recording's editor event is already a whole-buffer snapshot that replaces the previous one (docs/recording-contract.md). On the agent side, a code change that does not arrive with a language switch is already read as the candidate editing, and the comment in src/agent/events.rs covers a candidate clearing the editor and starting over.
Open question
Interview contract version 17 records Test only while the editor still holds the code the run executed. I have not checked what happens to a Test credit that was already recorded when the buffer is reset afterwards. I will measure that before the pull request and report it here.
Acceptance criteria
- A control on the interview page replaces the editor buffer of the current language with that language's starter. The buffers of the other languages are unchanged.
- A reset cannot silently destroy work: it is either undone with Ctrl+Z or confirmed first.
- The reset reaches the interviewer and the recording through the normal code publish.
- The control is unavailable whenever the editor is disabled, including after the interview ends.
- A browser test fails if the reset leaves the buffer unchanged or discards the other languages' buffers.
Related: #252 added the editor options and states that the editor preserves native undo and redo; approach 3 keeps that.
I will work on this and can open a pull request with the test first. Please assign it to me.
- Dominant language
- Rust
- Stars
- 160
- Forks
- 64
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 132
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from sysprog21/codetrial
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Add a Copy code button to the final reportPossibly taken @yansawu claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
sysprog21/codetrial#318 · 5 comments · 2 reactions · 1 assignee ·
Maintainers usually reply within 1 day
-
Show problem difficulty in past attempt labelsPossibly taken @yuen0428 claimed this today. Open
sysprog21/codetrial#357 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
Add keyboard undo and redo to whiteboard interviewsPossibly taken @xuntla claimed this 1 day ago. Open
sysprog21/codetrial#352 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Run the live interviewer on a local speech pipelinePossibly taken @alanhc claimed this 2 days ago. Open
sysprog21/codetrial#330 · 1 assignee ·
Maintainers usually reply within 1 day
All issues in sysprog21/codetrial
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 3 days
-
Zellij doesn't validate hex colors correctly and crashesPossibly taken @ymcx claimed this today. Opensuspected bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
zellij-org/zellij#5732 ·
Maintainers usually reply within 1 day
-
bug rust
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
jonathanong/no-mistakes#2267 ·
Maintainers usually reply within 1 day
-
BASEPRI needs an ISBOpen
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
rust-embedded/cortex-m#702 · 1 comment ·
-
Make major, minor, and makedev safe on solarish targetsPossibly taken @xtqqczze claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day