fix(app): focus input on new session (#36077)
Co-authored-by: Victor Navarro <vn4varro@gmail.com>
This commit is contained in:
co-authored by
Victor Navarro
parent
ea982c3832
commit
01131c75d8
@@ -26,6 +26,7 @@ import { useComposerCommands } from "@/pages/session/use-composer-commands"
|
|||||||
import { NEW_SESSION_CONTENT_WIDTH } from "@/pages/session/new-session-layout"
|
import { NEW_SESSION_CONTENT_WIDTH } from "@/pages/session/new-session-layout"
|
||||||
import { PromptWorkspaceSelector } from "@/components/prompt-workspace-selector"
|
import { PromptWorkspaceSelector } from "@/components/prompt-workspace-selector"
|
||||||
import { useTitlebarRightMount } from "@/components/titlebar"
|
import { useTitlebarRightMount } from "@/components/titlebar"
|
||||||
|
import { useCommand } from "@/context/command"
|
||||||
import { useProviders } from "@/hooks/use-providers"
|
import { useProviders } from "@/hooks/use-providers"
|
||||||
import { useSettingsDialog } from "@/components/settings-dialog"
|
import { useSettingsDialog } from "@/components/settings-dialog"
|
||||||
import { Persist, persisted } from "@/utils/persist"
|
import { Persist, persisted } from "@/utils/persist"
|
||||||
@@ -48,6 +49,7 @@ export default function NewSessionPage() {
|
|||||||
const comments = useComments()
|
const comments = useComments()
|
||||||
const language = useLanguage()
|
const language = useLanguage()
|
||||||
const settings = useSettings()
|
const settings = useSettings()
|
||||||
|
const command = useCommand()
|
||||||
const providers = useProviders(() => sdk().directory)
|
const providers = useProviders(() => sdk().directory)
|
||||||
const openProviderSettings = useSettingsDialog("providers")
|
const openProviderSettings = useSettingsDialog("providers")
|
||||||
const route = useSessionKey()
|
const route = useSessionKey()
|
||||||
@@ -68,6 +70,16 @@ export default function NewSessionPage() {
|
|||||||
onDone: () => inputRef?.focus(),
|
onDone: () => inputRef?.focus(),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
command.register("new-session", () => [
|
||||||
|
{
|
||||||
|
id: "input.focus",
|
||||||
|
title: language.t("command.input.focus"),
|
||||||
|
category: language.t("command.category.view"),
|
||||||
|
keybind: "ctrl+l",
|
||||||
|
onSelect: () => inputRef?.focus(),
|
||||||
|
},
|
||||||
|
])
|
||||||
|
|
||||||
const [store, setStore] = createStore<{ worktree?: string }>({})
|
const [store, setStore] = createStore<{ worktree?: string }>({})
|
||||||
const rightMount = useTitlebarRightMount()
|
const rightMount = useTitlebarRightMount()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user