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
1 change: 1 addition & 0 deletions docs/en_US/release_notes_9_14.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ Bug fixes
| `Issue #9279 <https://github.com/pgadmin-org/pgadmin4/issues/9279>`_ - Fixed an issue where OAuth2 authentication fails with 'object has no attribute' if OAUTH2_AUTO_CREATE_USER is False.
| `Issue #9392 <https://github.com/pgadmin-org/pgadmin4/issues/9392>`_ - Ensure that the Geometry Viewer refreshes when re-running queries or switching geometry columns, preventing stale data from being displayed.
| `Issue #9721 <https://github.com/pgadmin-org/pgadmin4/issues/9721>`_ - Fixed an issue where permissions page is not completely accessible on full scroll.
| `Issue #9740 <https://github.com/pgadmin-org/pgadmin4/issues/9740>`_ - Fixed an issue where the AI Assistant input textbox sometimes swallows the first character of input.
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ export function NLQChatPanel() {
});

const messagesEndRef = useRef(null);
const inputRef = useRef(null);
const abortControllerRef = useRef(null);
const readerRef = useRef(null);
const stoppedRef = useRef(false);
Expand Down Expand Up @@ -366,6 +367,16 @@ export function NLQChatPanel() {
messagesEndRef.current?.scrollIntoView({ behavior: 'smooth' });
}, [messages]);

// Auto-focus the input when loading completes
useEffect(() => {
if (!isLoading) {
// Defer focus to ensure the DOM has updated (disabled=false)
setTimeout(() => {
inputRef.current?.focus();
}, 0);
}
}, [isLoading]);

// Force CodeMirror re-render when panel becomes visible (fixes tab switching issue)
const [cmKey, setCmKey] = useState(0);
useEffect(() => {
Expand Down Expand Up @@ -741,6 +752,7 @@ export function NLQChatPanel() {

<InputArea>
<TextField
inputRef={inputRef}
fullWidth
multiline
minRows={1}
Expand Down
Loading