Persist Graph View layout and exact arrangements - #2145
Draft
mjuarros wants to merge 3 commits into
Draft
Conversation
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.
Description
Persist the selected Graph View layout in exported graph files and per-connection previous sessions. The second commit extends that foundation with exact node positions and viewport pan/zoom because the algorithm alone cannot reproduce randomized, order-sensitive, or manually adjusted arrangements.
The commits intentionally separate the owner decision:
eaede47fprovides layout-only persistence.65d4478cadds exact arrangements, lifecycle/race hardening, and the restoration fixes discovered during browser validation.Note
This draft depends on #2144. Until that PR merges, GitHub temporarily shows its already-reviewed Schema View commit in this PR. The #890 changes begin at
eaede47f; the prerequisite diff will disappear after #2144 merges intomain.How to read
Performance impact
Median measurements on an Apple M3 Pro with Node 24.16, using the project’s capture, serialization, validation, export, and import functions:
Arrangement-only capture/application measured 1.02/0.45 ms at 10,000 nodes, 5.51/2.14 ms at 50,000, and 11.00/4.71 ms at 100,000. Storage grows by approximately 65 bytes per node.
All measured operations remain below 10 ms at 10,000 nodes. At 50,000 nodes and above, serialization and import become noticeable. Measurements exclude IndexedDB transaction latency, network fetches, actual Cytoscape rendering/layout, and browser/device variability.
Validation
pnpm checkspnpm test— 226 files, 2,741 testsRelated Issues
Check List
pnpm checkspasses with no errors.pnpm testpasses with no failures.