Let the candidate restore the starter code
メンテナーはふだん 1 日以内に返信
@RWong04 がすでに取り組んでいます。
2026年10月18日 から。
評価
この issue はまだ評価されていません。
説明
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.
- 主要言語
- Rust
- スター
- 160
- フォーク
- 64
- 平均マージ
- 1日 10時間
- マージ済み PR(30日)
- 135
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
sysprog21/codetrial のほかの issue
-
Audio output can be confirmed without playing a test sound対応中かも @ChenYingHan1121 が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
sysprog21/codetrial#359 · コメント 3 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Add a Copy code button to the final report対応中かも @yansawu が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
sysprog21/codetrial#318 · コメント 5 件 · リアクション 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
C tests accept a wrong next pointer on the last node in Org Chart Row Navigation対応中かも @winter77777 が今日担当しました。 オープン
sysprog21/codetrial#370 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
"Let me think about it for a moment" does not start a thinking hold対応中かも @PeteChiang1211 が今日担当しました。 オープン
sysprog21/codetrial#369 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
sysprog21/codetrial#368 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
sysprog21/codetrial の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
chipsalliance/caliptra-sw#4311 ·
メンテナーはふだん 2 日以内に返信
-
`image_generation`: `max_retries` is ignored for OpenAI-compatible providers (always 2 retries)対応中かも @ericz7900 が今日担当しました。 オープンllm translation
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
メンテナーはふだん 1 日以内に返信
-
Help-Wanted Needs-Triage Package-Request
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
microsoft/winget-pkgs#456324 ·
メンテナーはふだん 1 日以内に返信
-
ai_p2
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
ClickHouse/ClickHouse#126833 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信