Integrate document-format storage into the editor#4265
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new .gdd (Graphite Document) container format alongside the legacy .graphite format, integrating asynchronous working-copy persistence and a robust undo/redo cursor mechanism via graph-storage. It adds comprehensive end-to-end round-trip tests, updates the frontend to support the new extension, and includes debugging utilities for diffing networks and registries. The review feedback highlights several performance optimization opportunities, specifically recommending the removal of redundant clones of the NodeNetwork and view settings, as well as optimizing path vector allocations during transient view state traversal.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
2c52d29 to
a263180
Compare
a263180 to
92d4397
Compare
92d4397 to
337c12c
Compare
There was a problem hiding this comment.
8 issues found across 31 files
Confidence score: 2/5
editor/src/messages/portfolio/document/document_message_handler.rsselects save format from a preference instead of the current file path, so Ctrl+S can write.gddcontent into a.graphitefile (and vice versa), which can break reopen routing and effectively corrupt expected load behavior — derive format from the on-disk extension for existing files and add a regression test before merging.editor/src/messages/portfolio/portfolio_message_handler.rscan silently drop autosave writes when resource storage is unavailable while still treating the document as autosaved, creating a real data-loss/regression risk if users trust autosave state — gate autosave success on actual persistence (or surface failure/retry) before merge.editor/src/messages/portfolio/document/utility_types/network_interface.rscarriespreviewingacross revisions, which can leave stale preview root IDs after undo/redo and cause invalid root/structure resolution — clear or revalidate preview IDs when rebuilding network state and cover this path with an undo/redo test.editor/src/messages/portfolio/document/document_diff.rsandeditor/src/messages/portfolio/document/storage/round_trip_tests.rsreduce diagnosability: value-level drift is omitted from diffs and redo is called without an assertion, so breakages can be logged unclearly or pass tests silently — add per-value diff details and a concrete redo assertion (and consider theSavedDocument.gddnaming fix ineditor/src/consts.rs) before merging.
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
2 issues found across 31 files
Confidence score: 2/5
- In
editor/src/messages/portfolio/portfolio_message_handler.rs,load_documentremounts storage even for.gddfiles already mounted byOpenGddDocument, which can overwrite the active working copy and erase undo/redo history if merged as-is — gate or skip remounting when storage is already mounted before merging. - In
editor/src/messages/portfolio/document/document_diff.rs,differing_valuescompares entire attribute records instead of just values, so timestamp-only metadata changes can be flagged as value drift and confuse diff diagnostics — narrow the comparison to value fields to de-risk debugging noise.
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
3 issues found across 31 files
Confidence score: 3/5
- In
editor/src/messages/portfolio/document/document_diff.rs,diff_registriescurrently misses resource payload mismatches and also useszip-style comparison that truncates when list lengths differ, so users can see drift reports without enough per-entry detail to diagnose or fix the source of the mismatch. Before merging, make the diff length-aware and include payload/content-level mismatch diagnostics for trailing and unequal entries. - In
editor/src/messages/portfolio/portfolio_message_handler.rs, failed.gddopens are silently ignored, which makes corrupt or invalid files look like a no-op and leaves users without feedback on what happened. Add an explicit user-facing error/notification path for open failures before merging.
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
…erences, restructure tests
…, and view-settings/diff fixes
…esource diff detail
6952653 to
503249e
Compare
No description provided.