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

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