Skip to content

Commit 34036b9

Browse files
authored
Set focus and fix i18n (#4648)
1 parent f6aba04 commit 34036b9

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/js/gui.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -451,14 +451,22 @@ class GuiControl {
451451

452452
const cliPanelDialog = {
453453
title: i18n.getMessage("cliPanelTitle"),
454-
buttonCloseText: i18n.getMessage("Close"),
454+
buttonCloseText: i18n.getMessage("close"),
455455
};
456456

457-
// clear any text leftovers from previous session
458-
$("#cli-command").val("");
457+
// clear response from previous session
459458
$("#cli-response").text("");
460459

461460
this.showInteractiveDialog(cliPanelDialog);
461+
462+
// Set focus on the CLI command input when dialog opens
463+
// Use timeout to ensure dialog is fully rendered
464+
setTimeout(() => {
465+
const cliInput = $("#cli-command");
466+
if (cliInput.length > 0 && cliInput.is(":visible")) {
467+
cliInput.focus();
468+
}
469+
}, 100);
462470
}
463471
}
464472

0 commit comments

Comments
 (0)