mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2026-11-02 20:30:17 -06:00
Fix an issue where the AI Assistant input textbox sometimes swallows the first character of input. #9740
This commit is contained in:
1 parent
c8bd75c9a8
commit
78e3b67eb1
2 files changed
+13
No files matched your search
@@ -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 #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 #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 #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.
|
||||||
@@ -288,6 +288,7 @@ export function NLQChatPanel() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const messagesEndRef = useRef(null);
|
const messagesEndRef = useRef(null);
|
||||||
|
const inputRef = useRef(null);
|
||||||
const abortControllerRef = useRef(null);
|
const abortControllerRef = useRef(null);
|
||||||
const readerRef = useRef(null);
|
const readerRef = useRef(null);
|
||||||
const stoppedRef = useRef(false);
|
const stoppedRef = useRef(false);
|
||||||
@@ -366,6 +367,16 @@ export function NLQChatPanel() {
|
|||||||
messagesEndRef.current?.scrollIntoView({ behavior: 'smooth' });
|
messagesEndRef.current?.scrollIntoView({ behavior: 'smooth' });
|
||||||
}, [messages]);
|
}, [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)
|
// Force CodeMirror re-render when panel becomes visible (fixes tab switching issue)
|
||||||
const [cmKey, setCmKey] = useState(0);
|
const [cmKey, setCmKey] = useState(0);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -741,6 +752,7 @@ export function NLQChatPanel() {
|
|||||||
|
|
||||||
<InputArea>
|
<InputArea>
|
||||||
<TextField
|
<TextField
|
||||||
|
inputRef={inputRef}
|
||||||
fullWidth
|
fullWidth
|
||||||
multiline
|
multiline
|
||||||
minRows={1}
|
minRows={1}
|
||||||
|
|||||||
Reference in new issue
Block a user