Exit sub-network via Escape key#3285
Conversation
|
!build |
|
|
I would remove the comment, feels like it doesn't add information. Code looks good. I'll test it later. |
|
Ok no issues |
|
I think the comment is fine and even though it does not provide extra information, it helps with skimming over the code |
|
Also fine with me. |
|
|
|
Exactly what I wanted I to do. Thanks for contributing :) |
|
Hi @Sambhram1, thanks again for this code contribution to the project! We're still hoping you will respond to the request to relicense this code. Please see #4208 ASAP, thank you! |
|
Hi @Sambhram1, we're grateful of your past code contribution to Graphite, but unless we hear from you by the end of this weekend with agreement about relicensing your code to include the MIT license, we will begin steps to remove your code contributions so that you will no longer be a Graphite code contributor. We'd much rather avoid this outcome, so please respond now. To agree, simply log into your GitHub account, visit #4208, and copy-paste this into a comment: "I license my past and future contributions to Graphite under the dual MIT/Apache-2.0 license, allowing licensees to choose either at their option." If you're hesitant because you disagree or have questions, feel free to respond with another message; we'll do our best to answer your questions or concerns. More explanation is at the top of the linked thread if you're confused. So far, 164 contributors have agreed and you are among the 11% remaining whom we are still hoping to hear from before we begin removing your code from the project starting this Monday. (If you only see this later than Monday, your future belated response will still be appreciated.) Thank you for your cooperation and support of open source, and we hope you'll help us keep your valued contributions in-tact. |
Problem
Previously, pressing the Escape key while inside a sub-network would close the entire node graph overlay, forcing users to lose their navigation context and start over from the beginning. This was frustrating when working with deeply nested networks.
Solution
Modified the DocumentMessage::Escape handler in document_message_handler.rs to check if the user is currently inside a nested network before closing the graph overlay:
If inside a sub-network (breadcrumb path is not empty): Exit one level up using ExitNestedNetwork { steps_back: 1 }
If at the root level (breadcrumb path is empty): Close the graph overlay as before
Changes
Updated document_message_handler.rs - Modified the Escape message handler to conditionally navigate up one level or close the overlay based on the current navigation depth
Testing
The fix can be tested by:
Opening the node graph
Entering a sub-network (double-clicking a node)
Pressing Escape - should return to the parent network
Pressing Escape again at the root level - should close the graph overlay
Benefits
More intuitive navigation behavior
Preserves user context when working with nested networks
Consistent with common UI patterns where Escape means "go back one step"
Closes #3283