Add keyboard undo and redo to whiteboard interviews
Les mainteneurs répondent en général sous 1 jour
Évaluation
Cette issue n'a pas encore été évaluée.
Description
Who is affected
Candidates drawing in a whiteboard interview must return to the toolbar to undo an accidental stroke. Keyboard shortcuts would let them correct a drawing and continue from the canvas.
Current behavior and initial analysis
At 5526176, initWhiteboard() in web/interview.js:3882 binds Undo and Redo buttons through applyBoardEdit(), but no keyboard handler invokes those operations. The model and operation journal already support both in web/whiteboard.js:288 and :303.
I verified this with an automated Chromium browser test. It loaded the existing interview module and used test-only setup to make the board editable without connecting to a live interview. After drawing two strokes, Ctrl+Z did nothing, while the Undo button removed one stroke. Ctrl+Y did nothing, while the Redo button restored it. Simulated Cmd-key combinations also had no effect. Drawing did not focus the canvas, and Tab could not reach it. This check did not cover a full live interview or a native macOS browser.
The toolbar buttons are the current workaround.
Proposed behavior
| Operation | Windows/Linux | macOS |
|---|---|---|
| Undo | Ctrl+Z | Cmd+Z |
| Redo | Ctrl+Y | Cmd+Shift+Z |
A page-wide listener could take undo away from text fields. Instead, scope the shortcuts to focus within the whiteboard canvas or drawing toolbar, excluding editable text targets. Make the canvas reachable with Tab, show keyboard focus, and focus it without scrolling after an accepted drawing start. After a successful Undo, Redo or Clear board action, return focus to the canvas so a newly disabled button does not lose the next keyboard operation.
Scope
Limit the change to keyboard interaction and focus handling in whiteboard interviews, with browser tests and shortcut documentation. Reuse the existing undo/redo, editing restrictions, synchronization and recording behavior. Document the shortcuts in the existing Undo/Redo row under "Whiteboard interviews" in the root README.md.
Shortcuts for the coding example drawing, new drawing tools, changes to scoring or storage, and additional AI calls are outside this proposal.
Acceptance criteria
- Each distinct keypress matches one button action. Preserve stroke/eraser undo, undoable Clear board, and the existing rule that drawing after undo discards the redo branch.
- Focus follows the rules above without scrolling; existing buttons remain usable and advertise the correct shortcuts.
- Refuse keyboard edits whenever the existing board rules prohibit editing, including before the interview starts, while paused, during the behavioral round, or after the interview ends. Also refuse them during an unfinished stroke, without queuing them.
- Preserve text-field undo and ignore input-method composition, held-key repeats, unsupported modifier combinations and key events already handled elsewhere. Focus outside the board panel is unaffected.
- Empty history does nothing, with no warning or new operation record. Suppress the browser's default key behavior only when an available whiteboard action is actually handled.
- Keyboard edits redraw, synchronize and record the board through the same process as button edits.
Validation plan
Add automated browser tests that draw strokes and exercise the shortcuts. The new tests must fail before the feature is implemented and pass afterward. Cover the acceptance criteria, including focus, editing restrictions, synchronization and operation recording. Run the relevant tests and ./scripts/test.sh, and report any skipped checks or platforms not tested.
Related: #65 and #72 introduced whiteboard mode, but keyboard shortcuts for Undo and Redo are not yet supported.
- Langage dominant
- Rust
- Étoiles
- 177
- Forks
- 100
- Merge moyen
- 1 j 13 h
- PR mergées (30 j)
- 138
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de sysprog21/codetrial
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
Les mainteneurs répondent en général sous 1 jour
-
Audio output can be confirmed without playing a test soundPeut-être pris @ChenYingHan1121 l’a pris il y a 2 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
sysprog21/codetrial#359 · 3 commentaires · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
Add a Copy code button to the final reportPeut-être pris @yansawu l’a pris il y a 3 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 80/100
sysprog21/codetrial#318 · 5 commentaires · 2 réactions · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
Use the full lobby width for the expanded problem pickerPeut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouverte
Difficulté 3/5 1-2 jours Accessibilité débutants 35/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de sysprog21/codetrial
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
longbridge/gpui-kit#3620 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 69/100
mongodb/kingfisher#564 ·
Les mainteneurs répondent en général sous 1 jour
-
[Bug] 跳转列结果排序中 tagunique 未排在首位Ouvertebug qq-feedback
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
Les mainteneurs répondent en général sous 1 jour
-
corro-client drops the last byte of a response line that has no trailing newlinePeut-être pris @RaphaelFakhri l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
-
proxy: include denial_category in the "proxy request denied" log linePeut-être pris @sreyas-endor l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 77/100
nolabs-ai/nono#2172 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour