Skip to content

fix: fix the filter error in dataset page - #17734

Merged
wangq8 merged 1 commit into
infiniflow:mainfrom
dcc123456:fix/dataset-filter-error-0803
Aug 3, 2026
Merged

wangq8 merged 1 commit into
infiniflow:mainfrom
dcc123456:fix/dataset-filter-error-0803

Conversation

@dcc123456

Copy link
Copy Markdown
Collaborator

Summary

fix: fix the filter error in dataset page

@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. 🐞 bug Something isn't working, pull request that fix bug. 🧰 typescript Pull requests that update Typescript code labels Aug 3, 2026
@dcc123456
dcc123456 requested a review from wangq8 August 3, 2026 08:46
@dcc123456 dcc123456 added the ci Continue Integration label Aug 3, 2026
@dcc123456
dcc123456 marked this pull request as draft August 3, 2026 08:46
@dcc123456
dcc123456 marked this pull request as ready for review August 3, 2026 08:46
@coderabbitai

coderabbitai Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The list filter bar now treats missing or nullish nested filter lengths as zero during count aggregation.

Changes

Filter Count Safety

Layer / File(s) Summary
Null-safe nested filter aggregation
web/src/components/list-filter-bar/index.tsx
The filter count calculation uses the nested collection length when available and zero otherwise.

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

Poem

A rabbit checks the filter count,
No missing length can make it pout.
With zero safely in its place,
The bar now keeps a steady pace.
Hop, hop—clean counts all about!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly identifies the filter error fix on the dataset page.
Description check ✅ Passed The description includes the required Summary section and states that the dataset page filter error is fixed.

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.

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

Thanks for the fix! This is a clean, minimal defensive fix.

What the code does: Inside ListFilterBar's filterCount memo, when value is a nested object (e.g. filter groups), it counts total active filter items by summing .length on each inner value. The original code pre + cur.length would throw a TypeError if any inner value was null/undefined.

The fix: cur?.length || 0 safely returns 0 when cur is nullish, while still correctly counting array lengths otherwise.

Review:

  • ✅ Correct — optional chaining + || 0 is the right pattern here.
  • ✅ No regressions — empty arrays still yield 0 (falsy .length → 0 || 0 = 0), non-empty arrays yield correct counts.
  • ✅ Minimal scope — 1 line changed, 1 file.
  • ✅ No security concerns, no missing test concerns (purely defensive null-guard in a UI component).

LGTM 🚀

@wangq8
wangq8 merged commit fe9167a into infiniflow:main Aug 3, 2026
12 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:XS This PR changes 0-9 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