Skip to content

Fix: When adding a chat in the main interface, a warning will automatically pop up #15685

Merged
wangq8 merged 7 commits into
infiniflow:mainfrom
cike8899:fix-search-required
Jun 5, 2026
Merged

Fix: When adding a chat in the main interface, a warning will automatically pop up #15685
wangq8 merged 7 commits into
infiniflow:mainfrom
cike8899:fix-search-required

Conversation

@cike8899
Copy link
Copy Markdown
Contributor

@cike8899 cike8899 commented Jun 5, 2026

What problem does this PR solve?

Fix: When adding a chat in the main interface, a warning will automatically pop up (even if embedding and LLM model have already been configured).

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 5, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 5, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

Adds loading-aware suppression for empty-model warnings, adjusts chunk/testing list scroll layouts and pagination spacing, reduces memory fetch page_size, and applies small UI tweaks to popover sizing and command-item keyword props.

Changes

Loading-aware empty-model warning suppression

Layer / File(s) Summary
Empty-model warning hook with loading suppression
web/src/hooks/use-warn-empty-model.tsx
Hook signature adds optional loading parameter. The warning useEffect guard adds !loading to existing checks, and dependency array includes loading.
Hook consumers passing loading state
web/src/hooks/use-llm-request.tsx, web/src/hooks/use-user-setting-request.tsx
useFetchDefaultModelDictionary destructures loading from useFetchDefaultModels and passes it to useWarnEmptyModel. useFetchTenantInfo extracts loading from useQuery and passes it to useWarnEmptyModel.

Scroll/container layout updates

Layer / File(s) Summary
Knowledge chunk scroll container refactor
web/src/pages/chunk/parsed-result/add-knowledge/components/knowledge-chunk/index.tsx
Outer wrapper switched to overflow-hidden with flex flex-col; inner chunk list becomes flex-1 overflow-y-auto min-h-0 so vertical scrolling is handled inside the inner container.
TestingResult sizing and pagination spacing
web/src/pages/dataset/testing/testing-result.tsx
Replaces fixed-height scroll wrapper with flex flex-col + min-h-0, wraps RAGFlowPagination in a padded container and moves it below the scrolling chunk list.

Memory request page size change

Layer / File(s) Summary
Memory list page_size adjustment
web/src/hooks/use-memory-request.ts
Replaces an extremely large page_size with page_size: 100 for the memory list query.

Popover and command-item UI tweaks

Layer / File(s) Summary
TreeSelect popover sizing
web/src/components/tree-select.tsx
PopoverContent switches from fixed width to w-auto with min-w-[var(--radix-popover-trigger-width)].
CommandItem keywords prop added
web/src/pages/agent/form/components/select-with-secondary-menu.tsx
CommandItem receives keywords={[option.label]} in both hover-card and plain branches to improve search/matching.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

🧰 typescript

Poem

🐰 A gentle hop beneath the code,

I hush the warning while loads unload.
Inner lists now scroll where they should,
Pagination snug, the view looks good.
Small tweaks, big calm — a rabbit nods.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is partially related to the changeset. It mentions 'adding a chat' and 'warning pop up', which align with the bug fix described in the PR, but the title lacks the key detail that the bug involves warnings appearing incorrectly even when models are already configured.
Description check ✅ Passed The PR description includes both required sections: a clear problem statement explaining the bug and the 'Bug Fix' type of change is selected, though the description could be more detailed about the technical solution.
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.

@cike8899 cike8899 added the ci Continue Integration label Jun 5, 2026
@cike8899 cike8899 marked this pull request as draft June 5, 2026 03:22
@cike8899 cike8899 marked this pull request as ready for review June 5, 2026 03:22
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.16%. Comparing base (aab01af) to head (e82ee5a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #15685   +/-   ##
=======================================
  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.

@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Jun 5, 2026
Copy link
Copy Markdown
Contributor

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
web/src/pages/dataset/testing/testing-result.tsx (1)

89-106: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Restore a constrained scroll container for chunk list.

Line 89 sets overflow-auto on the list, but this node is no longer height-constrained after removing the wrapper. In the current hierarchy (article flex-col → header + section + pagination), the section can expand with content, so internal scrolling may not engage and pagination can be pushed out of view.

Suggested fix
-      <>
+      <div className="flex-1 min-h-0 flex flex-col">
         {data.chunks?.length > 0 && !loading && (
           <>
-            <section className="px-5 pb-5 flex flex-col gap-5 overflow-auto scrollbar-thin min-h-0">
+            <section className="flex-1 min-h-0 px-5 pb-5 flex flex-col gap-5 overflow-auto scrollbar-thin">
               {data.chunks?.map((x) => (
                 <article key={x.chunk_id}>
                   <Card className="px-5 py-2.5 bg-transparent shadow-none">
                     <ChunkTitle item={x}></ChunkTitle>
                     <p className="!mt-2.5"> {x.content_with_weight}</p>
                   </Card>
                 </article>
               ))}
             </section>
             <div className="p-2">
               <RAGFlowPagination
                 total={data.total}
                 onChange={onPaginationChange}
                 current={page}
                 pageSize={pageSize}
               ></RAGFlowPagination>
             </div>
           </>
         )}
         {!data.chunks?.length && !loading && (
           <div className="size-full p-5 flex justify-center items-center">
             <div>
               <Empty type={EmptyType.SearchData} iconWidth={80}>
                 <div className="text-text-secondary text-sm">
                   {t(
                     data.isRuned
                       ? 'knowledgeDetails.noTestResultsForRuned'
                       : 'knowledgeDetails.noTestResultsForNotRuned',
                   )}
                 </div>
               </Empty>
             </div>
           </div>
         )}
-      </>
+      </div>

As per coding guidelines: “When fixing CSS/layout issues… inspect the full parent hierarchy for flex-shrink, min-width, and overflow constraints before applying fixes.”

🤖 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/pages/dataset/testing/testing-result.tsx` around lines 89 - 106, The
chunk list section can grow and push pagination out of view because its parent
flex container isn't height-constrained; make the list a constrained scrollable
area by ensuring the parent article (or the section’s immediate flex container)
is a column flex with a constrained height (e.g., flex-1 with min-h-0) and then
keep overflow-auto on the section so internal scrolling works; update the
component containing ChunkTitle and the section that maps data.chunks (the
article/Card/section hierarchy) to add those flex/min-height constraints and
preserve RAGFlowPagination placement.
🤖 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.

Outside diff comments:
In `@web/src/pages/dataset/testing/testing-result.tsx`:
- Around line 89-106: The chunk list section can grow and push pagination out of
view because its parent flex container isn't height-constrained; make the list a
constrained scrollable area by ensuring the parent article (or the section’s
immediate flex container) is a column flex with a constrained height (e.g.,
flex-1 with min-h-0) and then keep overflow-auto on the section so internal
scrolling works; update the component containing ChunkTitle and the section that
maps data.chunks (the article/Card/section hierarchy) to add those
flex/min-height constraints and preserve RAGFlowPagination placement.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 06de0bf3-5318-44cc-9da4-f2bc49d8a7c4

📥 Commits

Reviewing files that changed from the base of the PR and between 3197172 and 4b760cd.

📒 Files selected for processing (2)
  • web/src/pages/chunk/parsed-result/add-knowledge/components/knowledge-chunk/index.tsx
  • web/src/pages/dataset/testing/testing-result.tsx

Copy link
Copy Markdown
Contributor

@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.

🧹 Nitpick comments (1)
web/src/components/tree-select.tsx (1)

238-238: ⚡ Quick win

Consider adding a max-width constraint for responsive behavior.

The change from fixed width to w-auto allows the popover to expand and show full labels without truncation, which improves UX. However, without a max-width constraint, extremely long tree node labels could make the popover very wide, potentially causing layout issues in narrow containers or on mobile devices.

📐 Suggested improvement
-        className="p-0 w-auto min-w-[var(--radix-popover-trigger-width)]"
+        className="p-0 w-auto min-w-[var(--radix-popover-trigger-width)] max-w-md"

This maintains the flexible width while preventing excessive expansion. Adjust the max-width value (max-w-md, max-w-lg, max-w-xl, etc.) based on your design requirements.

🤖 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/tree-select.tsx` at line 238, The popover trigger's
className in the TreeSelect component currently uses "p-0 w-auto
min-w-[var(--radix-popover-trigger-width)]" which can grow unbounded; add a
responsive max-width class (e.g., "max-w-md" or "max-w-lg") to constrain
expansion on small screens while preserving w-auto behavior. Update the
className string on the same element in tree-select.tsx (where className="p-0
w-auto min-w-[var(--radix-popover-trigger-width)]") to include the chosen max-w
utility and adjust the breakpoint-specific max-width if needed for your design.
Ensure the new class is compatible with your tailwind config or replace with an
inline maxWidth style if utilities aren’t available.
🤖 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.

Nitpick comments:
In `@web/src/components/tree-select.tsx`:
- Line 238: The popover trigger's className in the TreeSelect component
currently uses "p-0 w-auto min-w-[var(--radix-popover-trigger-width)]" which can
grow unbounded; add a responsive max-width class (e.g., "max-w-md" or
"max-w-lg") to constrain expansion on small screens while preserving w-auto
behavior. Update the className string on the same element in tree-select.tsx
(where className="p-0 w-auto min-w-[var(--radix-popover-trigger-width)]") to
include the chosen max-w utility and adjust the breakpoint-specific max-width if
needed for your design. Ensure the new class is compatible with your tailwind
config or replace with an inline maxWidth style if utilities aren’t available.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: efababbb-399b-4faa-98c2-fcdbe4e239b7

📥 Commits

Reviewing files that changed from the base of the PR and between 8f43e1f and 9404b2e.

📒 Files selected for processing (2)
  • web/src/components/tree-select.tsx
  • web/src/pages/agent/form/components/select-with-secondary-menu.tsx

@wangq8 wangq8 merged commit 9c14e3f into infiniflow:main Jun 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 bug Something isn't working, pull request that fix bug. ci Continue Integration size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants