Skip to content

Commit 2811bbb

Browse files
committed
Cmd-Enter to run
Signed-off-by: Vincent Fiduccia <[email protected]>
1 parent 7403431 commit 2811bbb

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

ui/pages/gpt/[...gpt].vue

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script lang="ts" setup>
22
import { usePrefs } from '@/stores/prefs';
3+
const { metaSymbol } = useShortcuts()
34
45
const TOOL = 'tool'
56
@@ -65,6 +66,15 @@
6566
const obj = await useRuns().create(fileName, toolName.value, input, prefs.cache)
6667
navigateTo({name: 'run-run', params: {run: obj.id}} )
6768
}
69+
70+
defineShortcuts({
71+
'meta_enter': {
72+
usingInput: true,
73+
handler: () => {
74+
run()
75+
}
76+
}
77+
})
6878
</script>
6979

7080
<template>
@@ -97,14 +107,24 @@
97107
/>
98108
<UTextarea
99109
v-else
110+
:autofocus="true"
111+
name="stringArg"
100112
v-model="stringArg"
101113
placeholder="Optional free-form input"
102114
class="mb-2"
103115
/>
104116

105117
<div class="clearfix">
106118
<div class="float-left mt-2">
107-
<UButton icon="i-heroicons-play-circle" label="Run GPTScript" @click="run" :disabled="argsForm && !argsForm.valid" />
119+
<UTooltip>
120+
<template #text>
121+
{{metaSymbol}} + Enter
122+
</template>
123+
124+
<UButton icon="i-heroicons-play-circle" @click="run" :disabled="argsForm && !argsForm.valid">
125+
Run
126+
</UButton>
127+
</UTooltip>
108128
</div>
109129
<div class="float-right">
110130
<UFormGroup label="Cache" size="xs">

0 commit comments

Comments
 (0)