Skip to content

Fix misleading AI activity messages that could be mistaken for actual database operations.#9722

Open
dpage wants to merge 1 commit intopgadmin-org:masterfrom
dpage:ai_activity_messages
Open

Fix misleading AI activity messages that could be mistaken for actual database operations.#9722
dpage wants to merge 1 commit intopgadmin-org:masterfrom
dpage:ai_activity_messages

Conversation

@dpage
Copy link
Contributor

@dpage dpage commented Mar 10, 2026

Summary by CodeRabbit

@coderabbitai
Copy link

coderabbitai bot commented Mar 10, 2026

Walkthrough

Refactoring consolidates duplicated thinking message functionality into a new shared module. Two components that previously defined local THINKING_MESSAGES arrays and getRandomThinkingMessage functions now import these from a centralized module. Release notes are updated with a bug fix entry.

Changes

Cohort / File(s) Summary
Shared Module Creation
web/pgadmin/static/js/ai_thinking_messages.js
New module exports getRandomThinkingMessage() function and defines a THINKING_MESSAGES array of elephant-themed thinking messages with localization support.
Module Integration
web/pgadmin/static/js/Explain/AIInsights.jsx, web/pgadmin/tools/sqleditor/static/js/components/sections/NLQChatPanel.jsx
Replaced local THINKING_MESSAGES array and getRandomThinkingMessage() function with imports from the new ai_thinking_messages module. Removes duplicate definitions while maintaining existing behavior.
Documentation
docs/en_US/release_notes_9_14.rst
Added bug fix entry for Issue #9702 to the Release Notes 9.14 section.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: refactoring AI thinking messages to be clearer and less misleading, extracting shared logic into a new module to prevent confusion with database operations.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@dpage dpage force-pushed the ai_activity_messages branch from 89305ee to 5fe3be6 Compare March 10, 2026 09:44
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
web/pgadmin/static/js/Explain/AIInsights.jsx (1)

5-5: Copyright year appears outdated.

The copyright year shows "2025" while the other modified file (NLQChatPanel.jsx) shows "2026". Consider updating this to maintain consistency.

📅 Proposed fix
-// Copyright (C) 2013 - 2025, The pgAdmin Development Team
+// Copyright (C) 2013 - 2026, The pgAdmin Development Team
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/pgadmin/static/js/Explain/AIInsights.jsx` at line 5, Update the copyright
header string "Copyright (C) 2013 - 2025, The pgAdmin Development Team" to match
the other file by changing the end year to 2026; locate the header in
AIInsights.jsx (the top-of-file copyright comment) and replace 2025 with 2026 so
it is consistent with NLQChatPanel.jsx.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@web/pgadmin/tools/sqleditor/static/js/components/sections/NLQChatPanel.jsx`:
- Around line 144-177: THINKING_MESSAGES in NLQChatPanel.jsx contains hard-coded
English strings; wrap each string in gettext() so they become translatable
(matching AIInsights.jsx). Locate the THINKING_MESSAGES constant and replace
each plain string entry with gettext('...') preserving the same message text;
ensure gettext is imported/available in NLQChatPanel.jsx (add import/gettext
usage consistent with surrounding components) and run lint/format.

---

Nitpick comments:
In `@web/pgadmin/static/js/Explain/AIInsights.jsx`:
- Line 5: Update the copyright header string "Copyright (C) 2013 - 2025, The
pgAdmin Development Team" to match the other file by changing the end year to
2026; locate the header in AIInsights.jsx (the top-of-file copyright comment)
and replace 2025 with 2026 so it is consistent with NLQChatPanel.jsx.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: fb1a6248-41e5-4d18-94a8-72b1690e9393

📥 Commits

Reviewing files that changed from the base of the PR and between a0e6da0 and 89305ee.

📒 Files selected for processing (5)
  • docs/en_US/release_notes.rst
  • docs/en_US/release_notes_9_13.rst
  • docs/en_US/release_notes_9_14.rst
  • web/pgadmin/static/js/Explain/AIInsights.jsx
  • web/pgadmin/tools/sqleditor/static/js/components/sections/NLQChatPanel.jsx

@dpage dpage force-pushed the ai_activity_messages branch 2 times, most recently from 0efb595 to 26da6bc Compare March 10, 2026 09:51
The previous messages like "Vacuuming the catalog..." and "Analyzing
table statistics..." could be mistaken for actual database operations.
Replace them with clearly whimsical elephant-themed messages, expand
the pool to 32 messages, and consolidate them into a single shared
module with gettext() support.

Fixes pgadmin-org#9702

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dpage dpage force-pushed the ai_activity_messages branch from 26da6bc to c53c996 Compare March 10, 2026 10:15
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@web/pgadmin/static/js/ai_thinking_messages.js`:
- Around line 14-47: The THINKING_MESSAGES array contains DB-adjacent verbs
("Joining the herds...", "Querying the watering hole...", "Rolling back the
peanuts...", "Migrating across the plains...") that can be misinterpreted;
update the entries in the THINKING_MESSAGES constant to fully whimsical,
non-operational alternatives (e.g., replace each offending string with a playful
phrase like "Chasing butterfly clouds...", "Whistling with the wind...",
"Balancing on a sunbeam...", "Skipping over moonbeams..."), preserving the
gettext(...) wrappers and array structure so localization remains intact.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e2f9145f-5705-4325-aa97-fa478820609a

📥 Commits

Reviewing files that changed from the base of the PR and between 89305ee and c53c996.

📒 Files selected for processing (4)
  • docs/en_US/release_notes_9_14.rst
  • web/pgadmin/static/js/Explain/AIInsights.jsx
  • web/pgadmin/static/js/ai_thinking_messages.js
  • web/pgadmin/tools/sqleditor/static/js/components/sections/NLQChatPanel.jsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/en_US/release_notes_9_14.rst

Comment on lines +14 to +47
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...'),
];
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

A few shared strings still read like database activity.

This list still contains DB-adjacent verbs such as “Joining”, “Querying”, “Rolling back”, and “Migrating”. Because both UI surfaces now reuse this module, those phrases can still be interpreted as real engine work, which leaves the PR objective only partially met. Please swap those entries for wording that is fully whimsical and non-operational.

💡 Suggested wording update
 const THINKING_MESSAGES = [
   gettext('Consulting the elephant...'),
-  gettext('Joining the herds...'),
-  gettext('Querying the watering hole...'),
-  gettext('Rolling back the peanuts...'),
+  gettext('Roaming with the herd...'),
+  gettext('Peeking at the watering hole...'),
+  gettext('Juggling the peanuts...'),
   gettext('Trumpeting for answers...'),
   ...
-  gettext('Migrating across the plains...'),
+  gettext('Wandering across the plains...'),
   ...
 ];

Based on learnings, pgAdmin UI messages should stay concise and avoid technical jargon or terminology that can confuse users.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
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...'),
];
const THINKING_MESSAGES = [
gettext('Consulting the elephant...'),
gettext('Roaming with the herd...'),
gettext('Peeking at the watering hole...'),
gettext('Juggling 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('Wandering 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...'),
];
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/pgadmin/static/js/ai_thinking_messages.js` around lines 14 - 47, The
THINKING_MESSAGES array contains DB-adjacent verbs ("Joining the herds...",
"Querying the watering hole...", "Rolling back the peanuts...", "Migrating
across the plains...") that can be misinterpreted; update the entries in the
THINKING_MESSAGES constant to fully whimsical, non-operational alternatives
(e.g., replace each offending string with a playful phrase like "Chasing
butterfly clouds...", "Whistling with the wind...", "Balancing on a sunbeam...",
"Skipping over moonbeams..."), preserving the gettext(...) wrappers and array
structure so localization remains intact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant