Skip to content

Commit

Permalink
update: focus
Browse files Browse the repository at this point in the history
  • Loading branch information
liangfung committed Dec 17, 2024
1 parent df173bd commit 4c3e6b4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 9 additions & 1 deletion ee/tabby-ui/components/chat/chat-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ function ChatPanelRenderer(
}
}

const onSelectRepo = (sourceId: string | null) => {
setSelectedRepoId(sourceId)

setTimeout(() => {
chatInputRef.current?.focus()
})
}

React.useImperativeHandle(
ref,
() => {
Expand Down Expand Up @@ -230,7 +238,7 @@ function ChatPanelRenderer(
<AnimatePresence presenceAffectsLayout>
<RepoSelect
value={selectedRepoId}
onChange={setSelectedRepoId}
onChange={onSelectRepo}
repos={repos}
workspaceRepoId={indexedRepository?.sourceId}
isInitializing={fetchingRepos}
Expand Down
1 change: 0 additions & 1 deletion ee/tabby-ui/components/chat/repo-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export function RepoSelect({

const onSelectRepo = (v: string) => {
onChange(v)
// todo input focus
}

const isWorkspaceRepo = !!workspaceRepoId && workspaceRepoId === value
Expand Down

0 comments on commit 4c3e6b4

Please sign in to comment.