Add keyboard undo and redo to whiteboard interviews
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
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.
- Vorherrschende Sprache
- Rust
- Sterne
- 177
- Forks
- 100
- Ø Merge
- 1 T. 11 Std.
- Gemergte PRs (30 T.)
- 182
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus sysprog21/codetrial
-
Selecting a pen color leaves Example drawing in eraser modeEvtl. vergeben @Aa99841 hat das vor 1 Tag übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
sysprog21/codetrial#437 · 4 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
Python tests lose every result when the solution returns inf or NaNEvtl. vergeben @shensyuan hat das vor 2 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 77/100
sysprog21/codetrial#419 · 3 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
Allow deselecting a chosen problem card by clicking it againEvtl. vergeben @woohsin hat das vor 3 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
sysprog21/codetrial#392 · 4 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
Audio output can be confirmed without playing a test soundEvtl. vergeben @ChenYingHan1121 hat das vor 5 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
sysprog21/codetrial#359 · 5 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
Add a Copy code button to the final reportEvtl. vergeben @yansawu hat das vor 6 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 80/100
sysprog21/codetrial#318 · 6 Kommentare · 2 Reaktionen · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in sysprog21/codetrial
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
farion1231/cc-switch#8829 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug ci good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 92/100
longbridge/gpui-kit#3677 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 68/100
ilya-zlobintsev/LACT#1235 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Bug]: Shared Sink flush/close can complete without submitting buffered tasksEvtl. vergeben @RivTian hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
apalis-dev/apalis#797 ·
Maintainer antworten meist innerhalb von 7 Tagen