Let the candidate restore the starter code
I maintainer di solito rispondono entro 1 giorno
@RWong04 ci sta già lavorando.
Dal 18/10/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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.
- Lingua principale
- Rust
- Stelle
- 160
- Fork
- 64
- Merge medio
- 1g 11h
- PR unite (30g)
- 132
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di sysprog21/codetrial
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
Add a Copy code button to the final reportForse già presa @yansawu l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
sysprog21/codetrial#318 · 5 commenti · 2 reazioni · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Show problem difficulty in past attempt labelsForse già presa @yuen0428 l’ha presa oggi. Aperta
sysprog21/codetrial#357 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Add keyboard undo and redo to whiteboard interviewsForse già presa @xuntla l’ha presa oggi. Aperta
sysprog21/codetrial#352 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Run the live interviewer on a local speech pipelineForse già presa @alanhc l’ha presa 1 giorno fa. Aperta
sysprog21/codetrial#330 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di sysprog21/codetrial
Issue simili
-
Make major, minor, and makedev safe on solarish targetsForse già presa @xtqqczze l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Proxy ignores l5d-retry-http and l5d-retry-grpc conditions that follow a comma and spaceForse già presa @RaphaelFakhri l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
I maintainer di solito rispondono entro 3 giorni
-
sncast panics when decoding a `u384` valueForse già presa @RaphaelFakhri l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
foundry-rs/starknet-foundry#4635 ·
I maintainer di solito rispondono entro 3 giorni
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
crmne/omastats#31 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
area:desktop priority:p2 type:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno