Skip to content

Commit 01131c7

Browse files
fix(app): focus input on new session (anomalyco#36077)
Co-authored-by: Victor Navarro <vn4varro@gmail.com>
1 parent ea982c3 commit 01131c7

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

packages/app/src/pages/new-session.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import { useComposerCommands } from "@/pages/session/use-composer-commands"
2626
import { NEW_SESSION_CONTENT_WIDTH } from "@/pages/session/new-session-layout"
2727
import { PromptWorkspaceSelector } from "@/components/prompt-workspace-selector"
2828
import { useTitlebarRightMount } from "@/components/titlebar"
29+
import { useCommand } from "@/context/command"
2930
import { useProviders } from "@/hooks/use-providers"
3031
import { useSettingsDialog } from "@/components/settings-dialog"
3132
import { Persist, persisted } from "@/utils/persist"
@@ -48,6 +49,7 @@ export default function NewSessionPage() {
4849
const comments = useComments()
4950
const language = useLanguage()
5051
const settings = useSettings()
52+
const command = useCommand()
5153
const providers = useProviders(() => sdk().directory)
5254
const openProviderSettings = useSettingsDialog("providers")
5355
const route = useSessionKey()
@@ -68,6 +70,16 @@ export default function NewSessionPage() {
6870
onDone: () => inputRef?.focus(),
6971
})
7072

73+
command.register("new-session", () => [
74+
{
75+
id: "input.focus",
76+
title: language.t("command.input.focus"),
77+
category: language.t("command.category.view"),
78+
keybind: "ctrl+l",
79+
onSelect: () => inputRef?.focus(),
80+
},
81+
])
82+
7183
const [store, setStore] = createStore<{ worktree?: string }>({})
7284
const rightMount = useTitlebarRightMount()
7385

0 commit comments

Comments
 (0)