Skip to content

Fix: optimize folder data handling in MoveDialog component - #16580

Merged
wangq8 merged 3 commits into
infiniflow:mainfrom
dcc123456:fix/file-move-0703
Jul 3, 2026
Merged

wangq8 merged 3 commits into
infiniflow:mainfrom
dcc123456:fix/file-move-0703

Conversation

@dcc123456

Copy link
Copy Markdown
Collaborator

Summary

Fix: optimize folder data handling in MoveDialog component

@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jul 3, 2026
@coderabbitai

coderabbitai Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Updates the MoveDialog component's tree loading logic to deduplicate accumulated tree nodes by id using uniqBy, and to filter out folder nodes named "skills" (case-insensitive) using a new isFolderType check, alongside updated imports.

Changes

Move Dialog Tree Loading

Layer / File(s) Summary
Tree data dedup and folder filtering
web/src/pages/files/move-dialog.tsx
Imports uniqBy from lodash and isFolderType from local util; tree data merging now deduplicates by id, and folder loading excludes nodes typed as folders named "skills" (case-insensitive).

Estimated code review effort: 1 (Trivial) | ~5 minutes

Poem

A hop, a skip, a tidy tree,
No more duplicate leaves for me!
"Skills" folders hidden from the view,
Clean paths for hopping through and through 🐇
Thump thump — the code review's done too!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately describes the main MoveDialog folder data handling change.
Description check ✅ Passed The description includes the required Summary section and briefly states the PR's goal.
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.

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.

@dcc123456
dcc123456 requested a review from wangq8 July 3, 2026 02:20
@dcc123456 dcc123456 added 🐞 bug Something isn't working, pull request that fix bug. ci Continue Integration labels Jul 3, 2026
@dcc123456
dcc123456 marked this pull request as draft July 3, 2026 02:20
@dcc123456
dcc123456 marked this pull request as ready for review July 3, 2026 02:21

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

🧹 Nitpick comments (1)
web/src/pages/files/move-dialog.tsx (1)

38-44: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Redundant isFolderType check.

x.type === 'folder' on Line 40 already guarantees the node is a folder, so isFolderType(x.type) on Line 42 is always true and adds no value. Simplify the condition.

♻️ Proposed simplification
                 .filter(
                   (x: IFile) =>
                     x.type === 'folder' &&
-                    !(
-                      isFolderType(x.type) && x.name.toLowerCase() === 'skills'
-                    ),
+                    x.name.toLowerCase() !== 'skills',
                 )
🤖 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/files/move-dialog.tsx` around lines 38 - 44, The filter in
move-dialog’s folder list has a redundant `isFolderType(x.type)` check because
`x.type === 'folder'` already guarantees the same condition. Simplify the
predicate in the `.filter(...)` used for `IFile` so it only checks for folder
type and excludes entries named `skills`, and remove the unnecessary
`isFolderType` call.
🤖 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/pages/files/move-dialog.tsx`:
- Around line 38-44: The filter in move-dialog’s folder list has a redundant
`isFolderType(x.type)` check because `x.type === 'folder'` already guarantees
the same condition. Simplify the predicate in the `.filter(...)` used for
`IFile` so it only checks for folder type and excludes entries named `skills`,
and remove the unnecessary `isFolderType` call.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6b681a9f-9157-4823-b833-3aa107bd5973

📥 Commits

Reviewing files that changed from the base of the PR and between 62f94cd and 46de0ac.

📒 Files selected for processing (1)
  • web/src/pages/files/move-dialog.tsx

@wangq8
wangq8 merged commit 7951897 into infiniflow:main Jul 3, 2026
1 check passed
xugangqiang pushed a commit to xugangqiang/ragflow that referenced this pull request Jul 3, 2026
xugangqiang pushed a commit to xugangqiang/ragflow that referenced this pull request Jul 6, 2026
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