perf: frame-limit viewport gesture publication#126
Merged
Conversation
dompm
commented
Jul 13, 2026
dompm
left a comment
Owner
Author
There was a problem hiding this comment.
This coalesces raw viewport events, but it is only the first half of the planned viewport phase.
- [P1] Do not publish high-frequency viewport state through the owning panel.
scheduleViewportstill callssetZoomandsetPan, soResultPanelorSheetPanelrerenders in full on every display frame during pan/zoom. That is better than one render per raw event, but it leaves the project-size-dependent React work that phase 5 was intended to remove. Move high-frequency pan/zoom into a stable store/controller and let small viewport groups and DOM-overlay positioners subscribe directly. - Add an executable render/publication-count check. The current 25-test suite has no viewport test, so “at most one React publication per frame” is structurally plausible from the code but not currently a scripted acceptance check.
dompm
force-pushed
the
codex/interaction-pen-pencil
branch
from
July 13, 2026 17:33
0e3a6ce to
7ddd236
Compare
dompm
force-pushed
the
codex/interaction-viewport
branch
from
July 13, 2026 19:22
83635dd to
a5d83ce
Compare
Deploying vitrai with
|
| Latest commit: |
138e0a3
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://741f1548.vitrai.pages.dev |
| Branch Preview URL: | https://codex-interaction-viewport.vitrai.pages.dev |
dompm
commented
Jul 13, 2026
dompm
left a comment
Owner
Author
There was a problem hiding this comment.
The store correctly coalesces publication and prevents the ResultPanel/SheetPanel function itself from rerunning. The subscriber is still much broader than the requested architecture:
- [P1] Subscribe only the viewport transform and positioned overlays. The single
ViewportSubscribercurrently wraps the completeStage, every layer, everypieces.map(...), Pen/Pencil overlays, crop/measure UI, and DOM properties UI. Each pan publication therefore recreates and reconciles the full canvas element tree; with hundreds of pieces this retains the project-size-dependent per-frame React work the viewport phase was meant to remove. Use focused subscriber components around each Konva viewportGroupand small DOM positioners, with stable children created by the owning panel. - The current count test proves that a synthetic parent function is not called, but its subscriber child is only a
<span>. Add a regression check with an expensive/stable canvas child (or instrumentation around the real panel subtree) proving pan updates do not recreate/reconcile piece elements.
The browser smoke test confirms pan and overlays remain visually synchronized; this is a performance-architecture blocker, not a visible coordinate regression.
dompm
force-pushed
the
codex/interaction-viewport
branch
from
July 13, 2026 20:00
54ca1ee to
aae8e12
Compare
dompm
force-pushed
the
codex/interaction-viewport
branch
from
July 16, 2026 16:19
d4f3d28 to
289779c
Compare
dompm
force-pushed
the
codex/interaction-pen-pencil
branch
from
July 16, 2026 16:19
8d9481f to
e06506d
Compare
* 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:48
dompm
added a commit
that referenced
this pull request
Jul 16, 2026
* 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
added a commit
that referenced
this pull request
Jul 16, 2026
* perf: add interaction fixtures and behavior baselines * perf: cache piece geometry and memoize canvas pieces * perf: isolate stable and interaction canvas layers * perf: preview piece transforms outside project state * fix: address interaction foundation review feedback * fix: preserve debug mask composition backdrop * perf: frame-limit Pen and Pencil interactions (#125) * 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
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
Why
Trackpads and touch devices can emit multiple viewport events per display frame. Coalescing their React publication reduces redundant panel work.
Stack
Depends on #125 (
codex/interaction-pen-pencil).Verification
This is a draft pending performance review and browser regression testing.