Skip to content

Commit df72b38

Browse files
authored
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.
1 parent ee2dc57 commit df72b38

File tree

3 files changed

+1
-17
lines changed

3 files changed

+1
-17
lines changed

app/gui2/src/bindings.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ export const graphBindings = defineKeybinds('graph-editor', {
2222
redo: ['Mod+Y', 'Mod+Shift+Z'],
2323
dragScene: ['PointerAux', 'Mod+PointerMain'],
2424
openComponentBrowser: ['Enter'],
25-
newNode: ['N'],
2625
toggleVisualization: ['Space'],
27-
toggleVisualizationFullscreen: ['Shift+Space'],
2826
deleteSelected: ['OsDelete'],
2927
zoomToSelected: ['Mod+Shift+A'],
3028
selectAll: ['Mod+A'],

app/gui2/src/components/GraphEditor.vue

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -230,12 +230,6 @@ const graphBindingsHandler = graphBindings.handler({
230230
showComponentBrowser()
231231
}
232232
},
233-
newNode() {
234-
if (keyboardBusy()) return false
235-
if (graphNavigator.sceneMousePos != null) {
236-
graphStore.createNode(graphNavigator.sceneMousePos, 'hello "world"! 123 + x')
237-
}
238-
},
239233
deleteSelected() {
240234
graphStore.transact(() => {
241235
graphStore.deleteNodes([...nodeSelection.selected])
@@ -267,14 +261,6 @@ const graphBindingsHandler = graphBindings.handler({
267261
}
268262
})
269263
},
270-
toggleVisualizationFullscreen() {
271-
if (nodeSelection.selected.size !== 1) return
272-
graphStore.transact(() => {
273-
const selected = set.first(nodeSelection.selected)
274-
const isFullscreen = graphStore.db.nodeIdToNode.get(selected)?.vis?.fullscreen
275-
graphStore.setNodeVisualization(selected, { visible: true, fullscreen: !isFullscreen })
276-
})
277-
},
278264
copyNode() {
279265
if (keyboardBusy()) return false
280266
copyNodeContent()

app/gui2/src/components/GraphEditor/GraphVisualization.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ const keydownHandler = visualizationBindings.handler({
338338
},
339339
})
340340
341-
useEvent(window, 'keydown', (event) => keydownHandler(event))
341+
useEvent(window, 'keydown', keydownHandler)
342342
343343
watch(
344344
() => props.isFullscreen,

0 commit comments

Comments
 (0)