Skip to content

Fix: Add a waiting status to the messages on the chat page. - #15773

Merged
wangq8 merged 1 commit into
infiniflow:mainfrom
cike8899:fix-search-required
Jun 8, 2026
Merged

wangq8 merged 1 commit into
infiniflow:mainfrom
cike8899:fix-search-required

Conversation

@cike8899

@cike8899 cike8899 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Fix: Add a waiting status to the messages on the chat page.

Type of change

  • Bug Fix (non-breaking change which fixes an issue)

@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. 🐞 bug Something isn't working, pull request that fix bug. labels Jun 8, 2026
@cike8899 cike8899 added ci Continue Integration and removed 🐞 bug Something isn't working, pull request that fix bug. size:S This PR changes 10-29 lines, ignoring generated files. labels Jun 8, 2026
@cike8899
cike8899 marked this pull request as draft June 8, 2026 09:36
@cike8899
cike8899 marked this pull request as ready for review June 8, 2026 09:36
@coderabbitai

coderabbitai Bot commented Jun 8, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PR updates MessageItem to display a "running..." placeholder while a message is being sent with no content yet. It imports isEmpty, expands the render guard to include sendLoading state, and adds conditional rendering that shows the placeholder or MarkdownContent based on content and loading state.

Changes

Message loading state placeholder

Layer / File(s) Summary
Loading placeholder and rendering condition
web/src/components/message-item/index.tsx
Adds isEmpty import from lodash, updates the message-body render guard to display when messageContent exists or sendLoading is true, and conditionally renders "running..." placeholder when sending without content or MarkdownContent with existing props.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • infiniflow/ragflow#14839: Introduces "wait" messages with split UI entries and empty content; this PR aligns MessageItem rendering to show "running..." placeholders for those split/wait messages during send state.

Suggested labels

size:M

Poem

A message mid-flight, yet bare as the sky,
Now shows "running..." as moments pass by—
With isEmpty checked, and guard conditions new,
The chat feels more alive, transparent and true. 🐰✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description addresses the required template sections but lacks detailed explanation of what problem is being solved and why this change is necessary. Expand the 'What problem does this PR solve?' section with specific context about the issue being fixed and the user benefit of the waiting status indicator.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a waiting status indicator to messages during the send loading state.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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


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.

@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jun 8, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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/src/components/message-item/index.tsx (1)

13-13: ⚡ Quick win

Consider a simpler empty check for strings.

Since messageContent is a string (line 71), you can use !messageContent instead of importing and calling isEmpty. This reduces the dependency on lodash for a simple check.

♻️ Simpler alternative

Remove the import:

-import { isEmpty } from 'lodash';

And update line 149:

-                {sendLoading && isEmpty(messageContent) ? (
+                {sendLoading && !messageContent ? (
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/components/message-item/index.tsx` at line 13, Remove the unnecessary
lodash dependency by deleting the import of isEmpty and replace its usage with a
simple falsy check on the string variable messageContent (e.g., use
!messageContent where isEmpty(messageContent) was used). Locate occurrences in
the MessageItem component (reference symbol: messageContent) and update them to
use the simpler boolean check, ensuring no other code relies on isEmpty; then
remove the now-unused import statement.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@web/src/components/message-item/index.tsx`:
- Around line 149-158: Hardcoded loading text 'running...' must be
internationalized: import and call the react-i18next useTranslation hook in this
component (e.g., const { t } = useTranslation()), replace the literal string in
the conditional that uses sendLoading && isEmpty(messageContent) with
t('chat.running') (or reuse an existing key like t('chat.searching') if
appropriate), and add the chat.running key to your i18n resource files for all
supported languages; ensure MarkdownContent usage and surrounding logic
(sendLoading, isEmpty, messageContent) remain unchanged.

---

Nitpick comments:
In `@web/src/components/message-item/index.tsx`:
- Line 13: Remove the unnecessary lodash dependency by deleting the import of
isEmpty and replace its usage with a simple falsy check on the string variable
messageContent (e.g., use !messageContent where isEmpty(messageContent) was
used). Locate occurrences in the MessageItem component (reference symbol:
messageContent) and update them to use the simpler boolean check, ensuring no
other code relies on isEmpty; then remove the now-unused import statement.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: dac704d2-fdae-4b0f-a534-3efc39c1e3c4

📥 Commits

Reviewing files that changed from the base of the PR and between 86b320e and b685ba4.

📒 Files selected for processing (1)
  • web/src/components/message-item/index.tsx

Comment on lines +149 to +158
{sendLoading && isEmpty(messageContent) ? (
'running...'
) : (
<MarkdownContent
loading={loading}
content={messageContent}
reference={reference}
clickDocumentButton={clickDocumentButton}
></MarkdownContent>
)}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Internationalize the loading placeholder text.

The hardcoded 'running...' string violates the project's i18n requirement. As per coding guidelines, this project uses react-i18next for internationalization supporting 17 languages, and the useTranslation hook should be used for all user-facing strings.

🌐 Recommended fix

Import the translation hook at the top of the component (around line 55):

 }: IProps) => {
+  const { t } = useTranslation();
   const { theme } = useTheme();

Then update the placeholder:

-                {sendLoading && isEmpty(messageContent) ? (
-                  'running...'
+                {sendLoading && !messageContent ? (
+                  t('chat.running')
                 ) : (

You'll also need to add the translation key chat.running to your i18n resource files for all 17 supported languages. Alternatively, check if there's an existing similar key like chat.searching (used in MarkdownContent per context) that could be reused.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/components/message-item/index.tsx` around lines 149 - 158, Hardcoded
loading text 'running...' must be internationalized: import and call the
react-i18next useTranslation hook in this component (e.g., const { t } =
useTranslation()), replace the literal string in the conditional that uses
sendLoading && isEmpty(messageContent) with t('chat.running') (or reuse an
existing key like t('chat.searching') if appropriate), and add the chat.running
key to your i18n resource files for all supported languages; ensure
MarkdownContent usage and surrounding logic (sendLoading, isEmpty,
messageContent) remain unchanged.

Source: Coding guidelines

@codecov

codecov Bot commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.16%. Comparing base (e81bca7) to head (b685ba4).
⚠️ Report is 16 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #15773   +/-   ##
=======================================
  Coverage   93.16%   93.16%           
=======================================
  Files          10       10           
  Lines         717      717           
  Branches      118      118           
=======================================
  Hits          668      668           
  Misses         29       29           
  Partials       20       20           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@wangq8
wangq8 merged commit d025e18 into infiniflow:main Jun 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants