Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Add keyboard undo and redo to whiteboard interviews

Open
#352 2 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@xuntla is already working on this.

Since Oct 18, 2026.

  • #366 by @xuntla — open

Assessment

This issue has not been assessed yet.

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

  1. 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.
  2. Focus follows the rules above without scrolling; existing buttons remain usable and advertise the correct shortcuts.
  3. 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.
  4. 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.
  5. 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.
  6. 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.

Dominant language
Rust
Stars
177
Forks
100
Avg merge
1d 13h
Merged PRs (30d)
138

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sysprog21/codetrial

All issues in sysprog21/codetrial

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.