Repository navigation
Add whiteboard undo and redo shortcuts - #366
Merged
Merged
Conversation
xuntla
marked this pull request as ready for review
October 19, 2026 09:32
There was a problem hiding this comment.
1 issue found across 4 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="tests/browser/whiteboard-shortcuts.test.js">
<violation number="1" location="tests/browser/whiteboard-shortcuts.test.js:134">
P2: This test does not verify the advertised no-scroll behavior for an accepted drawing start. `draw()` has already scrolled the canvas and the baseline is captured afterward; record the scroll position after bringing the canvas into view but before pointer-down, then assert it is unchanged after the stroke starts.</violation>
</file>
Reply to a comment to ask cubic a question or push back. It learns from your replies.
View guided diff | Re-trigger cubic
|
|
||
| async function draw(page, offset = 0, dot = false) { | ||
| const canvas = page.locator("#board"); | ||
| await canvas.scrollIntoViewIfNeeded(); |
There was a problem hiding this comment.
P2: This test does not verify the advertised no-scroll behavior for an accepted drawing start. draw() has already scrolled the canvas and the baseline is captured afterward; record the scroll position after bringing the canvas into view but before pointer-down, then assert it is unchanged after the stroke starts.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At tests/browser/whiteboard-shortcuts.test.js, line 134:
<comment>This test does not verify the advertised no-scroll behavior for an accepted drawing start. `draw()` has already scrolled the canvas and the baseline is captured afterward; record the scroll position after bringing the canvas into view but before pointer-down, then assert it is unchanged after the stroke starts.</comment>
<file context>
@@ -0,0 +1,384 @@
+
+async function draw(page, offset = 0, dot = false) {
+ const canvas = page.locator("#board");
+ await canvas.scrollIntoViewIfNeeded();
+ const box = await canvas.boundingBox();
+ await page.mouse.move(box.x + 40 + offset, box.y + 40);
</file context>
jserv
reviewed
Oct 19, 2026
xuntla
force-pushed
the
whiteboard-undo-shortcuts
branch
from
October 19, 2026 11:00
99d1d4d to
26ea5d7
Compare
jserv
reviewed
Oct 19, 2026
xuntla
force-pushed
the
whiteboard-undo-shortcuts
branch
from
October 20, 2026 03:07
26ea5d7 to
7fc4c83
Compare
jserv
reviewed
Oct 21, 2026
xuntla
force-pushed
the
whiteboard-undo-shortcuts
branch
from
October 21, 2026 04:07
7fc4c83 to
6517b74
Compare
jserv
reviewed
Oct 21, 2026
xuntla
force-pushed
the
whiteboard-undo-shortcuts
branch
from
October 21, 2026 15:25
6517b74 to
763cff9
Compare
jserv
reviewed
Oct 22, 2026
Whiteboard corrections require returning to the toolbar. Allow undo and redo from the focused board controls while preserving text-field undo, editing restrictions, synchronization and recording behavior.
xuntla
force-pushed
the
whiteboard-undo-shortcuts
branch
from
October 22, 2026 06:35
763cff9 to
8b4ad37
Compare
Contributor
|
Thank @xuntla for contributing! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Whiteboard history actions currently require the toolbar. Add Ctrl+Z for Undo and Ctrl+Y or Ctrl+Shift+Z for Redo on Windows/Linux, and Cmd+Z/Cmd+Shift+Z on macOS while focus is in the canvas or drawing toolbar, preserving text-field undo. Printable ASCII characters follow the selected keyboard layout, so punctuation does not trigger a shortcut based on its physical key. Only a single non-ASCII character can fall back to the physical key code; named keys and empty values are ignored.
Make the canvas reachable with Tab and focus it without scrolling after an accepted drawing start. After Undo, Redo or Clear, preserve focus on a usable toolbar control and move it to the canvas only if the previously focused control becomes disabled or focus was on the page body. Keyboard and button edits share the existing
applyBoardEdit()path and editing restrictions. Document the shortcuts in the existing README row under "Whiteboard interviews".Acceptance criteria from #352
applyBoardEdit(); tests verify repainting and serialized replay operations with local sinks. After drawing uploads settle, Undo and Redo must each produce a new completed upload whose JPEG content, byte length and stroke metadata match the current board.Validation
Automated test environment: Ubuntu 26.04 LTS under WSL2, using Linux Chromium through Playwright 1.64.1, Node.js 22.22.3, Rust stable 1.99.1 and OpenJDK 21. Non-Latin key events and macOS shortcut combinations are simulated in Linux Chromium.
preventScrollfails the scroll assertion; using physical codes unconditionally fails the Latin-precedence assertions.aria-keyshortcutsand README. Guard tests exercise available Undo and Redo history, including Ctrl+Shift+Z, rather than relying on empty history to reject an event.CI=true ./scripts/test.shpassed after integration with upstream3198a99: exit 0; 1,883 Rust tests passed, all 1,385 browser tests passed with no skips, and 49 hook checks passed.Closes #352