Skip to content

Fix: Switching pagesize on a chunk page did not reset the current page. - #15401

Merged
wangq8 merged 3 commits into
infiniflow:mainfrom
dcc123456:fix/bug-0529
Jun 3, 2026
Merged

wangq8 merged 3 commits into
infiniflow:mainfrom
dcc123456:fix/bug-0529

Conversation

@dcc123456

Copy link
Copy Markdown
Collaborator

What problem does this PR solve?

Fix: Switching pagesize on a chunk page did not reset the current 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 May 29, 2026
@coderabbitai

coderabbitai Bot commented May 29, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 619dcba3-3ff3-4cb4-ae44-bbab3f907296

📥 Commits

Reviewing files that changed from the base of the PR and between a70ea31 and 3a2b652.

📒 Files selected for processing (1)
  • web/src/components/list-filter-bar/use-handle-filter-submit.ts

📝 Walkthrough

Walkthrough

Three independent frontend adjustments: pagination logic now resets to page 1 when page size changes; filter submit callbacks refactor falsy state handling; and dataset operation_status filter options are generated from RunningStatusOld instead of RunningStatus.

Changes

Frontend hook and dataset filter updates

Layer / File(s) Summary
Pagination page change logic
web/src/hooks/logic-hooks.ts
useGetPaginationWithRouter's onPageChange resets to page 1 when page size changes; otherwise preserves the selected page. Hook dependency list now includes pageSize.
Filter submit callback logic
web/src/components/list-filter-bar/use-handle-filter-submit.ts
checkValue guard checks only filters?.length. Falsy-state handling moved to setFilterValue updater (if (!preValue) return preValue) before the merge call.
Dataset operation_status filter source
web/src/pages/dataset/dataset-overview/index.tsx
Import RunningStatusOld and use its values for the operation_status filter options; row mapping continues to cast item.operation_status with RunningStatus and RunningStatusMap.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Three tweaks in harmony align,
Pagination resets, filters refine,
Old status flows through options clear,
Small changes stack—no need for fear!

🚥 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 directly addresses the main change: fixing page reset behavior when page size is switched, which aligns with the pagination logic updates in useGetPaginationWithRouter.
Description check ✅ Passed The description follows the required template with both sections completed: problem statement and type of change checkbox marked. However, it only briefly restates the title without providing additional context or explaining 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.

@dcc123456 dcc123456 added the ci Continue Integration label May 29, 2026
@dcc123456
dcc123456 marked this pull request as draft May 29, 2026 08:23
@dcc123456
dcc123456 marked this pull request as ready for review May 29, 2026 08:23
@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 May 29, 2026
@dcc123456
dcc123456 marked this pull request as draft May 29, 2026 08:34
@dcc123456
dcc123456 marked this pull request as ready for review May 29, 2026 08:34

@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/pages/dataset/dataset-overview/index.tsx (1)

189-193: 💤 Low value

Remove leftover commented-out lines.

Lines 189 and 192 are stale commented code from the previous RunningStatus mapping and add noise.

🧹 Cleanup
         list: Object.values(RunningStatusOld).map((value) => {
-          // const value = key as RunningStatus;
           return {
             id: value,
-            // label: RunningStatusMap[value].label,
             label: RunningStatusMap[value],
           };
         }),
🤖 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/dataset-overview/index.tsx` around lines 189 - 193,
Remove the stale commented lines left in the mapping block: delete the "// const
value = key as RunningStatus;" and "// label: RunningStatusMap[value].label,"
comments and leave the return object using id: value and label:
RunningStatusMap[value]; this cleans up the leftover RunningStatus-related
commented code while preserving the mapping logic in the dataset overview
component.
🤖 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/list-filter-bar/use-handle-filter-submit.ts`:
- Around line 51-68: Remove filterValue from the dependency array of the
useCallback that defines checkValue so the callback identity doesn't change on
every filterValue update; keep the callback using setFilterValue((preValue) =>
...) and depend only on stable helpers if needed (e.g., getFilterIds,
mergeFilterValue) or an empty array if those are stable, referencing checkValue,
setFilterValue, mergeFilterValue, getFilterIds, FilterCollection/FilterType and
FilterValue to locate the block to edit.

---

Nitpick comments:
In `@web/src/pages/dataset/dataset-overview/index.tsx`:
- Around line 189-193: Remove the stale commented lines left in the mapping
block: delete the "// const value = key as RunningStatus;" and "// label:
RunningStatusMap[value].label," comments and leave the return object using id:
value and label: RunningStatusMap[value]; this cleans up the leftover
RunningStatus-related commented code while preserving the mapping logic in the
dataset overview component.
🪄 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: df063b2c-dccf-437d-94ff-0d324e353775

📥 Commits

Reviewing files that changed from the base of the PR and between 8acc583 and a70ea31.

📒 Files selected for processing (2)
  • web/src/components/list-filter-bar/use-handle-filter-submit.ts
  • web/src/pages/dataset/dataset-overview/index.tsx

@codecov

codecov Bot commented May 29, 2026 •

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15401      +/-   ##
==========================================
- Coverage   94.56%   93.16%   -1.40%     
==========================================
  Files          10       10              
  Lines         717      717              
  Branches      118      118              
==========================================
- Hits          678      668      -10     
- Misses         25       29       +4     
- Partials       14       20       +6     

☔ View full report in Codecov by Sentry.
📢 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.

@dcc123456
dcc123456 marked this pull request as draft June 3, 2026 07:14
@dcc123456
dcc123456 marked this pull request as ready for review June 3, 2026 07:14
@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Jun 3, 2026
@wangq8
wangq8 merged commit a678ed7 into infiniflow:main Jun 3, 2026
1 check failed
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: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