Browse Source

Merge pull request #128 from RooVetGit/enter_to_add_auto_approved_commands

Enter to add auto approved commands
Matt Rubens 1 year ago
parent
commit
5fcf6f0821

+ 1 - 1
.github/workflows/code-qa.yml

@@ -42,4 +42,4 @@ jobs:
         run: npm run install:all
         run: npm run install:all
 
 
       - name: Run unit tests
       - name: Run unit tests
-        run: npx jest
+        run: npm test

+ 6 - 0
webview-ui/src/components/settings/SettingsView.tsx

@@ -245,6 +245,12 @@ const SettingsView = ({ onDone }: SettingsViewProps) => {
 									<VSCodeTextField
 									<VSCodeTextField
 										value={commandInput}
 										value={commandInput}
 										onInput={(e: any) => setCommandInput(e.target.value)}
 										onInput={(e: any) => setCommandInput(e.target.value)}
+										onKeyDown={(e: any) => {
+											if (e.key === 'Enter') {
+												e.preventDefault()
+												handleAddCommand()
+											}
+										}}
 										placeholder="Enter command prefix (e.g., 'git ')"
 										placeholder="Enter command prefix (e.g., 'git ')"
 										style={{ flexGrow: 1 }}
 										style={{ flexGrow: 1 }}
 									/>
 									/>