Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion webview-ui/src/components/chat/ChatTextArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ export const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
commands,
cloudUserInfo,
enterBehavior,
experiments,
} = useExtensionState()

// Find the ID and display text for the currently selected API configuration.
Expand Down Expand Up @@ -1080,7 +1081,7 @@ export const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
placeholder={placeholderText}
minRows={3}
maxRows={15}
autoFocus={true}
autoFocus={!experiments?.preventFocusDisruption}
className={cn(
"w-full",
"text-vscode-input-foreground",
Expand Down
13 changes: 10 additions & 3 deletions webview-ui/src/components/chat/ChatView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
cloudIsAuthenticated,
messageQueue = [],
isBrowserSessionActive,
experiments,
} = useExtensionState()

const messagesRef = useRef(messages)
Expand Down Expand Up @@ -803,7 +804,12 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
case "action":
switch (message.action!) {
case "didBecomeVisible":
if (!isHidden && !sendingDisabled && !enableButtons) {
if (
!isHidden &&
!sendingDisabled &&
!enableButtons &&
!experiments?.preventFocusDisruption
) {
textAreaRef.current?.focus()
}
break
Expand Down Expand Up @@ -877,6 +883,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
isHidden,
sendingDisabled,
enableButtons,
experiments?.preventFocusDisruption,
handleChatReset,
handleSendMessage,
handleSetChatBoxMessage,
Expand Down Expand Up @@ -1003,12 +1010,12 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro

useDebounceEffect(
() => {
if (!isHidden && !sendingDisabled && !enableButtons) {
if (!isHidden && !sendingDisabled && !enableButtons && !experiments?.preventFocusDisruption) {
textAreaRef.current?.focus()
}
},
50,
[isHidden, sendingDisabled, enableButtons],
[isHidden, sendingDisabled, enableButtons, experiments?.preventFocusDisruption],
)

useEffect(() => {
Expand Down
Loading