From 654d62118cdad7a0cb13e260ef8cc24f1b549291 Mon Sep 17 00:00:00 2001 From: yuri <1969yuri1969@gmail.com> Date: Fri, 9 Aug 2024 09:21:51 +0200 Subject: [PATCH] feat(ui): add shortcut to Output Debugger (#4612) Use Ctrl+Enter to run the debug expression. --- ui/src/components/executions/outputs/Wrapper.vue | 1 + ui/src/components/inputs/Editor.vue | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ui/src/components/executions/outputs/Wrapper.vue b/ui/src/components/executions/outputs/Wrapper.vue index 5be4bff0eb..403e90d03f 100644 --- a/ui/src/components/executions/outputs/Wrapper.vue +++ b/ui/src/components/executions/outputs/Wrapper.vue @@ -65,6 +65,7 @@ :input="true" :navbar="false" :model-value="computedDebugValue" + @confirm="onDebugExpression($event)" class="w-100" /> diff --git a/ui/src/components/inputs/Editor.vue b/ui/src/components/inputs/Editor.vue index 9383eaf902..1e558f3d7b 100644 --- a/ui/src/components/inputs/Editor.vue +++ b/ui/src/components/inputs/Editor.vue @@ -96,7 +96,7 @@ components: { MonacoEditor, }, - emits: ["save", "execute", "focusout", "tab", "update:modelValue", "cursor"], + emits: ["save", "execute", "focusout", "tab", "update:modelValue", "cursor", "confirm"], editor: undefined, data() { return { @@ -262,6 +262,19 @@ } }); + this.editor.addAction({ + id: "confirm", + label: "Confirm", + keybindings: [ + KeyMod.CtrlCmd | KeyCode.Enter, + ], + contextMenuGroupId: "navigation", + contextMenuOrder: 1.5, + run: (ed) => { + this.$emit("confirm", ed.getValue()) + } + }); + // TabFocus is global to all editor so revert the behavior on non inputs this.editor.onDidFocusEditorText?.(() => { TabFocus.setTabFocusMode(this.input);