diff --git a/docs/en_US/release_notes_9_14.rst b/docs/en_US/release_notes_9_14.rst index f841dcd5cd5..305c7820fd6 100644 --- a/docs/en_US/release_notes_9_14.rst +++ b/docs/en_US/release_notes_9_14.rst @@ -30,4 +30,5 @@ Bug fixes | `Issue #9279 `_ - Fixed an issue where OAuth2 authentication fails with 'object has no attribute' if OAUTH2_AUTO_CREATE_USER is False. | `Issue #9392 `_ - Ensure that the Geometry Viewer refreshes when re-running queries or switching geometry columns, preventing stale data from being displayed. + | `Issue #9702 `_ - Fixed misleading AI activity messages that could be mistaken for actual database operations. | `Issue #9721 `_ - Fixed an issue where permissions page is not completely accessible on full scroll. diff --git a/web/pgadmin/static/js/Explain/AIInsights.jsx b/web/pgadmin/static/js/Explain/AIInsights.jsx index bad14215746..f504e2be441 100644 --- a/web/pgadmin/static/js/Explain/AIInsights.jsx +++ b/web/pgadmin/static/js/Explain/AIInsights.jsx @@ -30,6 +30,7 @@ import PropTypes from 'prop-types'; import gettext from 'sources/gettext'; import url_for from 'sources/url_for'; import getApiInstance from '../api_instance'; +import { getRandomThinkingMessage } from '../ai_thinking_messages'; import Loader from '../components/Loader'; import EmptyPanelMessage from '../components/EmptyPanelMessage'; import { DefaultButton, PrimaryButton } from '../components/Buttons'; @@ -131,22 +132,6 @@ const LoadingContainer = styled(Box)({ gap: '16px', }); -// PostgreSQL/Elephant themed thinking messages -const THINKING_MESSAGES = [ - gettext('Analyzing query plan...'), - gettext('Examining node costs...'), - gettext('Looking for sequential scans...'), - gettext('Checking index usage...'), - gettext('Evaluating join strategies...'), - gettext('Identifying bottlenecks...'), - gettext('Calculating row estimates...'), - gettext('Reviewing execution times...'), -]; - -function getRandomThinkingMessage() { - return THINKING_MESSAGES[Math.floor(Math.random() * THINKING_MESSAGES.length)]; -} - function getSeverityIcon(severity) { switch (severity) { case 'high': diff --git a/web/pgadmin/static/js/ai_thinking_messages.js b/web/pgadmin/static/js/ai_thinking_messages.js new file mode 100644 index 00000000000..065aba76352 --- /dev/null +++ b/web/pgadmin/static/js/ai_thinking_messages.js @@ -0,0 +1,51 @@ +///////////////////////////////////////////////////////////// +// +// pgAdmin 4 - PostgreSQL Tools +// +// Copyright (C) 2013 - 2026, The pgAdmin Development Team +// This software is released under the PostgreSQL Licence +// +////////////////////////////////////////////////////////////// + +import gettext from 'sources/gettext'; + +// Fun elephant-themed processing messages (avoid anything that sounds +// like a real database operation, as that can be misleading). +const THINKING_MESSAGES = [ + gettext('Consulting the elephant...'), + gettext('Joining the herds...'), + gettext('Querying the watering hole...'), + gettext('Rolling back the peanuts...'), + gettext('Trumpeting for answers...'), + gettext('Herding the elephants...'), + gettext('Foraging for ideas...'), + gettext('Pondering pachyderm thoughts...'), + gettext('Charging through the tall grass...'), + gettext('Flapping those big ears...'), + gettext('Stomping through the jungle...'), + gettext('Swishing the trunk...'), + gettext('Calling the herd...'), + gettext('Splashing in the watering hole...'), + gettext('Following the elephant trail...'), + gettext('Munching on some peanuts...'), + gettext('Doing a trunk stand...'), + gettext('Remembering everything...'), + gettext('Migrating across the plains...'), + gettext('Shaking off the dust...'), + gettext('Tiptoeing through the tulips...'), + gettext('Taking a mud bath...'), + gettext('Polishing the tusks...'), + gettext('Stretching the trunk...'), + gettext('Packing the trunk...'), + gettext('Wading through the river...'), + gettext('Gathering the herd...'), + gettext('Tromping through the underbrush...'), + gettext('Listening with big ears...'), + gettext('Raising the trunk in triumph...'), + gettext('Thundering across the savanna...'), + gettext('Napping under the baobab tree...'), +]; + +export function getRandomThinkingMessage() { + return THINKING_MESSAGES[Math.floor(Math.random() * THINKING_MESSAGES.length)]; +} diff --git a/web/pgadmin/tools/sqleditor/static/js/components/sections/NLQChatPanel.jsx b/web/pgadmin/tools/sqleditor/static/js/components/sections/NLQChatPanel.jsx index 5bbd2c413bd..cef6172b1ff 100644 --- a/web/pgadmin/tools/sqleditor/static/js/components/sections/NLQChatPanel.jsx +++ b/web/pgadmin/tools/sqleditor/static/js/components/sections/NLQChatPanel.jsx @@ -26,6 +26,7 @@ import { format as formatSQL } from 'sql-formatter'; import gettext from 'sources/gettext'; import url_for from 'sources/url_for'; import getApiInstance from '../../../../../../static/js/api_instance'; +import { getRandomThinkingMessage } from '../../../../../../static/js/ai_thinking_messages'; import usePreferences from '../../../../../../preferences/static/js/store'; import { QueryToolContext, @@ -139,30 +140,6 @@ const MESSAGE_TYPES = { ERROR: 'error', }; -// Elephant/PostgreSQL-themed processing messages -const THINKING_MESSAGES = [ - 'Consulting the elephant...', - 'Traversing the B-tree...', - 'Vacuuming the catalog...', - 'Analyzing table statistics...', - 'Joining the herds...', - 'Indexing the savanna...', - 'Querying the watering hole...', - 'Optimizing the plan...', - 'Warming up the cache...', - 'Gathering the tuples...', - 'Scanning the relations...', - 'Checking constraints...', - 'Rolling back the peanuts...', - 'Committing to memory...', - 'Trumpeting the results...', -]; - -// Helper function to get a random thinking message -function getRandomThinkingMessage() { - return THINKING_MESSAGES[Math.floor(Math.random() * THINKING_MESSAGES.length)]; -} - // Single chat message component function ChatMessage({ message, onInsertSQL, onReplaceSQL, textColors, cmKey }) { if (message.type === MESSAGE_TYPES.USER) {