Make path editable for grouped graphic inputs#3901
Make path editable for grouped graphic inputs#3901krVatsal wants to merge 7 commits intoGraphiteEditor:masterfrom
Conversation
… in utility_types.rs
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the Path Tool's capabilities by allowing direct path editing for grouped graphic inputs. It achieves this by centralizing and refining the logic for determining path editability, ensuring that both menu eligibility and the Path Tool's selection process consistently recognize and handle these new editable layer types. This change improves the user experience by providing more flexible and intuitive interaction with complex graphic compositions. Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request refactors path editability checks to support grouped graphic inputs, which is a great improvement. The new helper function layer_can_be_path_editable_input correctly identifies Table<Graphic> as editable. I've found a potential issue in the PathTool's selection handling logic where a non-path-editable layer without children is kept in the list of targets. I've suggested a fix to remove such layers, which also simplifies the code.
There was a problem hiding this comment.
1 issue found across 2 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="editor/src/messages/tool/tool_messages/path_tool.rs">
<violation number="1" location="editor/src/messages/tool/tool_messages/path_tool.rs:1581">
P1: New descendant-expansion selection logic desynchronizes `shape_editor` layer targeting from document-selected nodes, but later edits still resolve layer from document selection, causing wrong-layer operations or aborted actions.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| (_, PathToolMessage::SelectionChanged) => { | ||
| // Set the newly targeted layers to visible | ||
| let target_layers = document.network_interface.selected_nodes().selected_layers(document.metadata()).collect(); | ||
| let mut target_layers = document.network_interface.selected_nodes().selected_layers(document.metadata()).collect::<Vec<_>>(); |
There was a problem hiding this comment.
P1: New descendant-expansion selection logic desynchronizes shape_editor layer targeting from document-selected nodes, but later edits still resolve layer from document selection, causing wrong-layer operations or aborted actions.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At editor/src/messages/tool/tool_messages/path_tool.rs, line 1581:
<comment>New descendant-expansion selection logic desynchronizes `shape_editor` layer targeting from document-selected nodes, but later edits still resolve layer from document selection, causing wrong-layer operations or aborted actions.</comment>
<file context>
@@ -1578,7 +1578,26 @@ impl Fsm for PathToolFsmState {
(_, PathToolMessage::SelectionChanged) => {
// Set the newly targeted layers to visible
- let target_layers = document.network_interface.selected_nodes().selected_layers(document.metadata()).collect();
+ let mut target_layers = document.network_interface.selected_nodes().selected_layers(document.metadata()).collect::<Vec<_>>();
+
+ let mut i = 0;
</file context>
Continues work from #3735 since @jsjgdh cannot continue.
Refactors path editability checks into a shared helper and applies it consistently in both menu eligibility and Path Tool selection handling. This enables grouped layers
[Table<Graphic>]to be treated as path editable while preserving existing behavior for vector inputs.