Skip to content

Feat: The dataset-level tree view supports search. - #18138

Merged
wangq8 merged 2 commits into
infiniflow:mainfrom
cike8899:fix-agent-saving
Aug 12, 2026
Merged

Feat: The dataset-level tree view supports search.#18138
wangq8 merged 2 commits into
infiniflow:mainfrom
cike8899:fix-agent-saving

Conversation

@cike8899

Copy link
Copy Markdown
Contributor

Summary

Feat: The dataset-level tree view supports search.

@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. 💞 feature Feature request, pull request that fullfill a new feature. 🧰 typescript Pull requests that update Typescript code labels Aug 12, 2026
@cike8899
cike8899 requested a review from wangq8 August 12, 2026 02:33
@cike8899 cike8899 added the ci Continue Integration label Aug 12, 2026
@cike8899
cike8899 marked this pull request as draft August 12, 2026 02:33
@cike8899
cike8899 marked this pull request as ready for review August 12, 2026 02:33
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The dataset compilation navigation now supports keyword search. The input is debounced for 500 milliseconds, passed through the navigation hooks, and sent as an optional query parameter to the dataset navigation service.

Changes

Dataset navigation keyword search

Layer / File(s) Summary
Keyword-aware navigation requests
web/src/services/dataset-nav-service.ts, web/src/hooks/use-dataset-nav-request.ts
getNav accepts optional keywords. The request hook trims keywords and includes them in the query key and request.
Debounced compilation search state
web/src/pages/dataset/compilation/hooks/use-compilation-nav.ts
The hook stores keywords, debounces them for 500 milliseconds, and exposes the search value and change handler.
Navigation search input wiring
web/src/pages/dataset/compilation/nav-tree-view.tsx, web/src/pages/dataset/compilation/nav-tree-left-panel.tsx
The navigation view passes search props to the left panel. The panel renders a controlled SearchInput above the tree.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant SearchInput
  participant useCompilationNav
  participant useFetchDatasetNav
  participant datasetNavService
  SearchInput->>useCompilationNav: input keyword change
  useCompilationNav->>useFetchDatasetNav: debounced keywords
  useFetchDatasetNav->>datasetNavService: getNav with keywords
  datasetNavService->>datasetNavService: send keywords as query parameter
Loading

Possibly related PRs

Poem

I twitch my nose; the tree can search,
With keywords sent on a trimmed march.
A debounce waits, then requests fly,
Through hooks and service, query-high.
The rabbit hops through branches bright! 🐇

🚥 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
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.
Title check ✅ Passed The title clearly and concisely describes the addition of search support to the dataset-level tree view.
Description check ✅ Passed The description includes the required Summary section and clearly states the purpose of the change.

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.

@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

🤖 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/pages/dataset/compilation/hooks/use-compilation-nav.ts`:
- Around line 132-137: Update handleKeywordsChange to clear selectedNode
whenever the search input changes, while preserving the existing keywords
update. Use the selectedNode state setter already used by the surrounding
compilation navigation flow so NavTreeView cannot retain a node excluded by the
new filter.
🪄 Autofix

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 Plus

Run ID: e8a46874-5d8b-41b8-afcd-92853b208434

📥 Commits

Reviewing files that changed from the base of the PR and between c0274ff and b111391.

📒 Files selected for processing (5)
  • web/src/hooks/use-dataset-nav-request.ts
  • web/src/pages/dataset/compilation/hooks/use-compilation-nav.ts
  • web/src/pages/dataset/compilation/nav-tree-left-panel.tsx
  • web/src/pages/dataset/compilation/nav-tree-view.tsx
  • web/src/services/dataset-nav-service.ts

Comment on lines +132 to +137
const handleKeywordsChange = useCallback(
(e: React.ChangeEvent<HTMLInputElement>) => {
setKeywords(e.target.value);
},
[],
);

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Clear the selected node when the search changes.

handleKeywordsChange updates keywords but leaves selectedNode unchanged. When the filtered request excludes the selected node, NavTreeView still renders the old details on the right.

Clear the selection here, or reconcile it with the new navList.

Proposed fix
     (e: React.ChangeEvent<HTMLInputElement>) => {
       setKeywords(e.target.value);
+      setSelectedNode(null);
     },
📝 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 handleKeywordsChange = useCallback(
(e: React.ChangeEvent<HTMLInputElement>) => {
setKeywords(e.target.value);
},
[],
);
const handleKeywordsChange = useCallback(
(e: React.ChangeEvent<HTMLInputElement>) => {
setKeywords(e.target.value);
setSelectedNode(null);
},
[],
);
🤖 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/compilation/hooks/use-compilation-nav.ts` around lines
132 - 137, Update handleKeywordsChange to clear selectedNode whenever the search
input changes, while preserving the existing keywords update. Use the
selectedNode state setter already used by the surrounding compilation navigation
flow so NavTreeView cannot retain a node excluded by the new filter.

@wangq8 wangq8 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice feature! The search implementation is clean:

  • Proper debouncing (500ms) via ahooks useDebounce
  • Query key includes keywords so cache invalidation works correctly
  • trim from lodash handles whitespace nicely
  • Props threading through the component tree is consistent

One small note: in dataset-nav-service.ts, params: { keywords: params.keywords || undefined } — make sure the backend API handles missing/empty keywords gracefully (returns unfiltered results). If it already does, this is good to go. LGTM overall.

@wangq8
wangq8 merged commit 0a7ba32 into infiniflow:main Aug 12, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration 💞 feature Feature request, pull request that fullfill a new feature. size:M This PR changes 30-99 lines, ignoring generated files. 🧰 typescript Pull requests that update Typescript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants