Remember the canvas viewport per document across net switches and reloads - #9510
Draft
kube wants to merge 1 commit into
Draft
Remember the canvas viewport per document across net switches and reloads#9510kube wants to merge 1 commit into
kube wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
kube
force-pushed
the
claude/canvas-viewport-persistence
branch
from
September 3, 2026 23:16
c08b2dd to
5903e85
Compare
kube
force-pushed
the
claude/canvas-viewport-persistence
branch
from
September 3, 2026 23:32
5903e85 to
808cd87
Compare
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
Before this PR, the canvas opened every net fitted to the screen. Switching to another net and back, or reloading the app, lost the position and zoom the user had set.
Remembers the viewport per net in the user settings. Both renderers start from the saved viewport when one exists and report their moves through one context, so a net reopens where it was left.
Links
Changes
CanvasViewportContextexposessavedViewportandrememberViewportcanvasViewportsuser setting keeps the most recently moved netsCanvasViewporttype moves to the React layerKnown issues
Test coverage
remember-canvas-viewport.test.ts:How to test