Skip to content

Conversation

@Sambhram1
Copy link
Contributor

@Sambhram1 Sambhram1 commented Oct 14, 2025

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

@Sambhram1 Sambhram1 changed the title Fix: Escape key in sub-network now exits one level instead of closing entire node graph Fix: Escape key in sub-network now exits one level instead of closing entire node graph to fix #3283 Oct 14, 2025
@timon-schelling
Copy link
Member

!build

@github-actions
Copy link

📦 Build Complete for c29b426
https://5b1eee74.graphite.pages.dev

@timon-schelling
Copy link
Member

I would remove the comment, feels like it doesn't add information. Code looks good. I'll test it later.

@Sambhram1
Copy link
Contributor Author

Ok no issues

@TrueDoctor
Copy link
Member

I think the comment is fine and even though it does not provide extra information, it helps with skimming over the code

@timon-schelling
Copy link
Member

Also fine with me.

@j-jasz
Copy link

j-jasz commented Oct 14, 2025

This PR should also close: #3214

@timon-schelling
Copy link
Member

Exactly what I wanted I to do. Thanks for contributing :)

@timon-schelling timon-schelling changed the title Fix: Escape key in sub-network now exits one level instead of closing entire node graph to fix #3283 Escape exits sub-network, not full graph Oct 14, 2025
@timon-schelling timon-schelling changed the title Escape exits sub-network, not full graph Exit sub-network via Escape key Oct 14, 2025
@timon-schelling timon-schelling enabled auto-merge (squash) October 14, 2025 23:55
@timon-schelling timon-schelling merged commit 591096a into GraphiteEditor:master Oct 15, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exit sub network with escape

4 participants