mirror of
https://github.com/enso-org/enso.git
synced 2024-11-23 16:18:23 +03:00
Visualizations fixes follow-up (#9252)
Addressing review suggestions from #9130 - Removing `N` binding - Removing duplicated `Toggle fullscreen vis` binding A few important differences from the suggested implementation: 1. There is no easy way to implement `nextType` on GraphEditor – we simply don’t have the required API 2. The keydown handler in `GraphVisualization` must be defined on window level still, otherwise it won’t get keydown events unless visualization is focused, and thus `nextType` won’t work because of (1) No visual changes to the IDE.
This commit is contained in:
parent
ee2dc57d68
commit
df72b38f60
@ -22,9 +22,7 @@ export const graphBindings = defineKeybinds('graph-editor', {
|
||||
redo: ['Mod+Y', 'Mod+Shift+Z'],
|
||||
dragScene: ['PointerAux', 'Mod+PointerMain'],
|
||||
openComponentBrowser: ['Enter'],
|
||||
newNode: ['N'],
|
||||
toggleVisualization: ['Space'],
|
||||
toggleVisualizationFullscreen: ['Shift+Space'],
|
||||
deleteSelected: ['OsDelete'],
|
||||
zoomToSelected: ['Mod+Shift+A'],
|
||||
selectAll: ['Mod+A'],
|
||||
|
@ -230,12 +230,6 @@ const graphBindingsHandler = graphBindings.handler({
|
||||
showComponentBrowser()
|
||||
}
|
||||
},
|
||||
newNode() {
|
||||
if (keyboardBusy()) return false
|
||||
if (graphNavigator.sceneMousePos != null) {
|
||||
graphStore.createNode(graphNavigator.sceneMousePos, 'hello "world"! 123 + x')
|
||||
}
|
||||
},
|
||||
deleteSelected() {
|
||||
graphStore.transact(() => {
|
||||
graphStore.deleteNodes([...nodeSelection.selected])
|
||||
@ -267,14 +261,6 @@ const graphBindingsHandler = graphBindings.handler({
|
||||
}
|
||||
})
|
||||
},
|
||||
toggleVisualizationFullscreen() {
|
||||
if (nodeSelection.selected.size !== 1) return
|
||||
graphStore.transact(() => {
|
||||
const selected = set.first(nodeSelection.selected)
|
||||
const isFullscreen = graphStore.db.nodeIdToNode.get(selected)?.vis?.fullscreen
|
||||
graphStore.setNodeVisualization(selected, { visible: true, fullscreen: !isFullscreen })
|
||||
})
|
||||
},
|
||||
copyNode() {
|
||||
if (keyboardBusy()) return false
|
||||
copyNodeContent()
|
||||
|
@ -338,7 +338,7 @@ const keydownHandler = visualizationBindings.handler({
|
||||
},
|
||||
})
|
||||
|
||||
useEvent(window, 'keydown', (event) => keydownHandler(event))
|
||||
useEvent(window, 'keydown', keydownHandler)
|
||||
|
||||
watch(
|
||||
() => props.isFullscreen,
|
||||
|
Loading…
Reference in New Issue
Block a user