Skip to content

Exit sub-network via Escape key#3285

Merged
timon-schelling merged 2 commits into
GraphiteEditor:masterfrom
Sambhram1:master
Oct 15, 2025
Merged

Exit sub-network via Escape key#3285
timon-schelling merged 2 commits into
GraphiteEditor:masterfrom
Sambhram1:master

Conversation

@Sambhram1

@Sambhram1 Sambhram1 commented Oct 14, 2025

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Member

!build

@github-actions

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

@timon-schelling

Copy link
Copy Markdown
Member

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

@Sambhram1

Copy link
Copy Markdown
Contributor Author

Ok no issues

@TrueDoctor

Copy link
Copy Markdown
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
Copy Markdown
Member

Also fine with me.

@j-jasz

j-jasz commented Oct 14, 2025

Copy link
Copy Markdown

This PR should also close: #3214

@timon-schelling

Copy link
Copy Markdown
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
@Keavon

Keavon commented Jun 13, 2026

Copy link
Copy Markdown
Member

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!

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

5 participants