feat(app): add web input focus shortcut (#12493)

This commit is contained in:
ChangeHow
2026-02-08 03:35:46 +08:00
committed by GitHub
parent 0e1f543646
commit 805207e096
20 changed files with 28 additions and 2 deletions

View File

@@ -917,6 +917,8 @@ export default function Page() {
setFileTreeTab("all")
}
const focusInput = () => inputRef?.focus()
useSessionCommands({
command,
dialog,
@@ -943,6 +945,7 @@ export default function Page() {
setExpanded: (id, fn) => setStore("expanded", id, fn),
setActiveMessage,
addSelectionToContext,
focusInput,
})
const openReviewFile = createOpenReviewFile({

View File

@@ -48,6 +48,7 @@ export const useSessionCommands = (input: {
setExpanded: (id: string, fn: (open: boolean | undefined) => boolean) => void
setActiveMessage: (message: UserMessage | undefined) => void
addSelectionToContext: (path: string, selection: FileSelection) => void
focusInput: () => void
}) => {
const sessionCommands = createMemo(() => [
{
@@ -142,6 +143,13 @@ export const useSessionCommands = (input: {
keybind: "mod+\\",
onSelect: () => input.layout.fileTree.toggle(),
},
{
id: "input.focus",
title: input.language.t("command.input.focus"),
category: input.language.t("command.category.view"),
keybind: "ctrl+l",
onSelect: () => input.focusInput(),
},
{
id: "terminal.new",
title: input.language.t("command.terminal.new"),