Repository navigation
Make document migrations position the nodes they add beside the node they replace - #4959
Conversation
There was a problem hiding this comment.
3 issues found across 17 files
Confidence score: 4/5
- In
document/migrations/runner/src/testing.rs,attribute()can create a node state that thePositiondocs say is invalid whenui::is_layeris set. Choose a valid position for layers. - In
website/content/volunteer/guide/graphene/document-migrations.md,addedis undefined in the snippet, so readers can't tell where the new node ID comes from. Show theadd_nodecall that returns it. - In
document/migrations/compiled/src/vary_nodes_from_copy_to_points.rs, the comment describes random scales and rotations, but the test uses fixed values. Update the comment to match.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="document/migrations/compiled/src/vary_nodes_from_copy_to_points.rs">
<violation number="1" location="document/migrations/compiled/src/vary_nodes_from_copy_to_points.rs:306">
P3: The doc comment says the copy uses random scales and rotations, but `placed_copies` passes fixed values (scale `2.`, rotation `90.`). Describe the fixed values so the comment matches the test.</violation>
</file>
<file name="website/content/volunteer/guide/graphene/document-migrations.md">
<violation number="1" location="website/content/volunteer/guide/graphene/document-migrations.md:212">
P3: `added` is never defined in this snippet, so readers can't tell where the new node's id comes from. Show the `add_node` call that returns it, such as `let added = upstream.add_node(NewNode { ... });`, or mention that the id comes from `add_node`.</violation>
</file>
<file name="document/migrations/runner/src/testing.rs">
<violation number="1" location="document/migrations/runner/src/testing.rs:297">
P3: `attribute()` can write `Position::Chain` to a node that also has `ui::is_layer` set, which the `Position` docs say is invalid. Make the position draw depend on the layer flag, for example by choosing `Absolute` or `Stack` for layers and `Absolute` or `Chain` otherwise, so generated histories stay within what the editor produces.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
be87462 to
50350a1
Compare
50350a1 to
fa9c36a
Compare
|
!build desktop (Run ID 43701858050) |
|
|
|
fa9c36a to
82feb81
Compare
|
This PR's title is accepted as an admin set it. The review would otherwise have noted:
Suggested titles: |
There was a problem hiding this comment.
All reported issues were addressed across 1 file (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
54e4a7b to
235b7ab
Compare
TrueDoctor
left a comment
There was a problem hiding this comment.
The first part of the pr which adds the attribute migration machinery looks good and I only made some minor changes pushed to migration-attribute-view. These can merge as is. For positions I don't think this is the right way of going about this since this forces every migration which adds nodes to use the graph which forces us use the corse grained interaction collapse migration style, as well as introducing lot's of delta churn by rewriting positions of upstream nodes. Since this migration happened before the switch to the new format, I don't think changing this past behaviour is super time critical so I'd like to try for 1 or two days to come up with a better positioning scheme which is more future ready
235b7ab to
74d096a
Compare
74d096a to
87cc0ef
Compare
|
@cubic-dev-ai review |
@Keavon I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 19 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Document migrations now position added nodes on the node graph grid using only the replaced node's stored position: nodes along its input chain form a row to its left or join its layer's chain, and other added nodes feeding that path sit below their first reader when the replaced node has coordinates. A new
&mut Attributesview, named after the document format's per-node editor data (positions, display names, layer flags, and so on, separate from node graph data attributes), lets migrations override positions or change names on the replacement and added nodes, which the 'Copy to Points' migration uses to clear its old default name while preserving other custom names.