Repository navigation
Add basic shapes to the example drawing - #675
Open
Chuyutseng wants to merge 4 commits into
Open
Chuyutseng wants to merge 4 commits into
Chuyutseng wants to merge 4 commits into
Conversation
Contributor
Remove this statement, as it adds no value to the conversation. |
Chuyutseng
force-pushed
the
add-example-shape-tools
branch
from
November 12, 2026 12:38
80fcea8 to
6ae0eeb
Compare
LeafYeh1
reviewed
Nov 13, 2026
LeafYeh1
left a comment
Contributor
There was a problem hiding this comment.
Two points: the preview-dropping steps the collapsed-shape branch copies, and the cost of the new browser cases.
Chuyutseng
force-pushed
the
add-example-shape-tools
branch
from
November 13, 2026 06:18
6ae0eeb to
898e630
Compare
Chuyutseng
force-pushed
the
add-example-shape-tools
branch
from
November 13, 2026 07:26
898e630 to
0d8d536
Compare
Chuyutseng
force-pushed
the
add-example-shape-tools
branch
from
November 16, 2026 08:04
0d8d536 to
af34b09
Compare
Candidates need consistent diagrams while explaining coding examples. Preview each shape during dragging and commit its outline as an ordinary stroke so existing undo, recording, replay and reconnection keep working. Cover direction, color, pixels, cancellation and history in browser tests. Close sysprog21#625 Change-Id: I20c06c511222c2ebe50811ca0c4c24999ced3a05
Chuyutseng
force-pushed
the
add-example-shape-tools
branch
from
November 16, 2026 09:51
af34b09 to
6bc2a62
Compare
Ending an interview can finish a held shape before any pointer move. Cover empty boards and an existing text label so removing the unopened stroke guard is caught as a rejected finish instead of reaching users. Change-Id: I32d7801e64f53abfc24c949af77967a39af5637b
Repeated image decoding and fixed mouse scales make the shape tests harder to maintain. Decode uploads in the shared publisher, keep tool point counts in one table, and derive native mouse positions from the canvas bounds and board dimensions. Change-Id: I0d1f2eab4bdf54e1e2c7f33698f09f0c599e4743
jserv
reviewed
Nov 16, 2026
jserv
reviewed
Nov 16, 2026
Sub-pixel pointer moves rebuilt shape previews even when the stored stroke stayed on the same pixels. Reuse the board model clamp so drag comparisons and stored points share rounding and bounds. Check that reconnect flushes successfully and uploads the canvas JPEG, so a stale image cannot pass on its stroke count alone. Change-Id: I8fbf226490b25f15f674ccf5a7ea5fda2d761e43
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.
Problem and behavior
As described in #625, candidates currently need to draw basic shapes freehand when illustrating coding examples, making it difficult to create consistent diagrams.
Add Line, Rectangle and Ellipse tools to the Example drawing toolbar. Each tool previews the shape while dragging and commits it as one undoable edit when the pointer is released. Selecting a color preserves the active shape tool.
Approach
Follow the agreed approach in the issue discussion by representing each completed shape as an ordinary stroke: two endpoints for a line, a closed four-corner path for a rectangle, and a closed polyline for an ellipse.
Dragging replaces the uncommitted preview rather than adding intermediate shapes to the journal. Completed shapes reuse the existing color, undo, clear, recording, replay and reconnection paths without introducing a new operation kind.
Update the drawing-tool documentation to match the supported tools.
Validation
./scripts/test.sh browserpassed on the final head: 3,155 passed, zero failures, and one test skipped because ffmpeg is unavailable.make buildpassed. Manual checks of the local drawing preview covered all three tools, color selection, Undo and Clear. Additional browser probes checked keyboard selection, cancellation when the board becomes locked, and stroke/point capacity boundaries.Browser regression tests verify all four drag directions, shape geometry, painted pixels, preview/journal separation, color selection, undo, clear, replay, reconnection and cancellation.
The full gate was attempted but did not pass. The fork's stale
origin/maincaused Rust size-baseline findings; the fork has since been synchronized, but the full gate was not rerun. An unchanged Rust handoff test also failed with a socket fixture/handshake error, including when run in isolation. The run was stopped during desktop dependency setup, so the remaining checks were not completed.A credentialed live interview was not run. Replay and reconnection were checked through local browser regressions.
Screenshots
Closes #625
Summary by cubic
Adds Line, Rectangle, and Ellipse tools to the Example drawing toolbar so candidates can produce consistent diagrams while explaining examples. Shapes preview while dragging and commit as one ordinary, replayable stroke on release, closing #625.
full-browserinput, letting only the browser lane install full Chromium for native pointer capture; all other lanes keep the headless shell, with a matching cache key and gate coverage.Written for commit f6d54af. Summary will update on new commits.