Add keyboard shortcuts for zoom, grid, reset, and cut/copy/paste operations #10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implements 10 new keyboard shortcuts to improve productivity when creating learning maps, as requested in #[issue_number].
New Keyboard Shortcuts
Zoom Controls
Ctrl + +- Zoom inCtrl + -- Zoom outCtrl + 0- Reset zoom to 1:1 with smooth animationView Controls
Shift + 1- Fit all elements in viewShift + 2- Zoom to fit selected nodesEditing Controls
Ctrl + X- Cut selected nodes and edgesCtrl + C- Copy selected nodes and edgesCtrl + V- Paste with automatic offset and unique ID generationWorkspace Controls
Ctrl + '- Toggle background grid visibilityCtrl + Delete- Reset map (clear all nodes and edges with confirmation)Implementation Details
All shortcuts have been added to the help dialog (
Ctrl + ?) and are fully internationalized in both English and German.The cut/copy/paste functionality intelligently handles multiple nodes, preserves edges between copied nodes, generates new unique IDs, and offsets pasted nodes by 50px to prevent overlap.
Zoom controls use ReactFlow's native methods with smooth 300ms animations for a polished user experience.
Breaking Change⚠️
The Add Text Node shortcut has been changed from
Ctrl + XtoCtrl + Tto free upCtrl + Xfor the standard Cut operation. This change is documented in the updated help dialog.Testing
Closes #[issue_number]
Original prompt
Fixes #9
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.