perf: refactor canvas interaction foundations#123
Merged
Conversation
Deploying vitrai with
|
| Latest commit: |
4d7eda5
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://eee990e1.vitrai.pages.dev |
| Branch Preview URL: | https://codex-interaction-performanc.vitrai.pages.dev |
dompm
commented
Jul 13, 2026
dompm
commented
Jul 13, 2026
dompm
commented
Jul 13, 2026
Owner
Author
|
Quick review of phases 0–3:
I would fix the two P1 behavior issues and close the Phase 0 fixture/coverage gap noted inline before starting phase 4. |
dompm
commented
Jul 13, 2026
dompm
left a comment
Owner
Author
There was a problem hiding this comment.
Follow-up review: the earlier compositing issue is not fully resolved.
- [P1] Preserve the debug-mask backdrop.
globalCompositeOperation="difference"only composites against pixels in the same KonvaLayer. The mask now shares the piece layer, but the paper and pattern image remain in the background layer. Before the split, background, pattern, pieces, and mask were in one canvas, so the visible Box/debug preview is still behaviorally different. Please use a combined/offscreen composition while the mask is active, or another implementation that preserves the original assembled backdrop.
The fixture and no-op transform fixes from the earlier review look good.
dompm
force-pushed
the
codex/interaction-performance
branch
from
July 16, 2026 16:19
1d00b43 to
30bc4d5
Compare
* perf: frame-limit pen and pencil interaction controllers * fix: refresh and cancel scheduled pen previews * perf: isolate pen preview from result panel * perf: isolate pen status from app state * perf: frame-limit viewport gesture publication (#126) * perf: frame-limit viewport gesture publication * perf: move viewport gestures into focused store subscribers * perf: narrow viewport subscriptions around stable canvas children * perf: keep glass pieces idle during pan * perf: index Pen snapping with reference parity (#127) * perf: index pen snapping with reference parity * perf: cache shift-alignment snap queries * fix: preserve project order in length snapping * test: randomize equal-length snap parity * fix: preserve current snapping behavior on indexed path
dompm
marked this pull request as ready for review
July 16, 2026 16:50
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.
Summary
Implements phases 0–3 of the interaction-performance plan:
Why
High-frequency pointer interactions currently rebuild project state, rerender broad React/Konva trees, and recompute polygon geometry. These foundations isolate transient work while preserving the existing project schema and editor behavior.
Validation
pnpm test:interaction: 14 tests passStatus
Draft: phases 0–3 are implemented. Review findings will be added inline before phase 4 begins.