Skip to content

Commit 4b10544

Browse files
committed
Improve the AI Assistant user prompt to be more descriptive of the actual functionality.
1 parent a0e6da0 commit 4b10544

3 files changed

Lines changed: 16 additions & 7 deletions

File tree

docs/en_US/release_notes_9_14.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,5 @@ Bug fixes
3131
| `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.
3232
| `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.
3333
| `Issue #9721 <https://github.com/pgadmin-org/pgadmin4/issues/9721>`_ - Fixed an issue where permissions page is not completely accessible on full scroll.
34+
| `Issue #9732 <https://github.com/pgadmin-org/pgadmin4/issues/9732>`_ - Improve the AI Assistant user prompt to be more descriptive of the actual functionality.
35+

web/pgadmin/tools/sqleditor/static/js/components/sections/NLQChatPanel.jsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -719,8 +719,9 @@ export function NLQChatPanel() {
719719
>
720720
<Typography variant="body2" style={{ color: textColors.secondary }}>
721721
{gettext(
722-
'Describe what SQL you need and I\'ll generate it for you. ' +
723-
'I can help with SELECT, INSERT, UPDATE, DELETE, and DDL statements.'
722+
'Ask a question about your database or describe the SQL you need ' +
723+
'and I\'ll generate it for you. ' +
724+
'I can help with SELECT, INSERT, UPDATE, DELETE, and DDL statements.'
724725
)}
725726
</Typography>
726727
</Box>
@@ -745,7 +746,7 @@ export function NLQChatPanel() {
745746
multiline
746747
minRows={1}
747748
maxRows={4}
748-
placeholder={gettext('Describe the SQL you need...')}
749+
placeholder={gettext('Ask a question or describe the SQL you need...')}
749750
value={inputValue}
750751
onChange={(e) => setInputValue(e.target.value)}
751752
onKeyDown={handleKeyDown}

web/regression/javascript/sqleditor/NLQChatPanel.spec.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,15 @@ describe('NLQChatPanel Component', () => {
116116
it('should show empty state message when no messages', () => {
117117
renderWithContexts(<ThemedNLQChatPanel />);
118118
expect(
119-
screen.getByText(/Describe what SQL you need/i)
119+
screen.getByText(/Describe the SQL you need/i)
120120
).toBeInTheDocument();
121121
});
122122

123123
it('should have input field for typing queries', () => {
124124
renderWithContexts(<ThemedNLQChatPanel />);
125-
const input = screen.getByPlaceholderText(/Describe the SQL you need/i);
125+
const input = screen.getByPlaceholderText(
126+
/Ask a question or describe the SQL you need/i,
127+
);
126128
expect(input).toBeInTheDocument();
127129
});
128130

@@ -146,7 +148,9 @@ describe('NLQChatPanel Component', () => {
146148

147149
it('should enable send button when input has text', () => {
148150
const { container } = renderWithContexts(<ThemedNLQChatPanel />);
149-
const input = screen.getByPlaceholderText(/Describe the SQL you need/i);
151+
const input = screen.getByPlaceholderText(
152+
/Ask a question or describe the SQL you need/i,
153+
);
150154

151155
fireEvent.change(input, { target: { value: 'Find all users' } });
152156

@@ -167,7 +171,9 @@ describe('NLQChatPanel Component', () => {
167171

168172
it('should clear input after typing and clicking clear', () => {
169173
renderWithContexts(<ThemedNLQChatPanel />);
170-
const input = screen.getByPlaceholderText(/Describe the SQL you need/i);
174+
const input = screen.getByPlaceholderText(
175+
/Ask a question or describe the SQL you need/i,
176+
);
171177

172178
fireEvent.change(input, { target: { value: 'Find all users' } });
173179
expect(input.value).toBe('Find all users');

0 commit comments

Comments
 (0)