feat: advanced seach#2234
Conversation
| rankRange: filterState.rankRange, | ||
| scoreRange: filterState.scoreRange, | ||
| weekdays: filterState.weekdays); | ||
| if (filterState.weekdays.isNotEmpty) { |
There was a problem hiding this comment.
WARNING: Client-side weekday filtering breaks pagination.
The request uses offset: bangumiList.length (line 94), but here matching items are dropped from result after the fetch. Because bangumiList then grows by fewer than the 20 items the API returned, the next page's offset is computed from the filtered count rather than the number of records actually consumed from the server. This causes the same records to be re-requested (duplicates) and/or records to be skipped on subsequent "load more" calls.
Additionally, when a page yields zero matches, bangumiList stays empty and isTimeOut becomes true even though further pages exist, and the bangumiList.length >= 20 guard in scrollListener can prevent loading more. Consider tracking the raw fetched offset separately from the filtered list length, or relying solely on the server-side air_weekday filter.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
| ), | ||
| if (draft.scoreRange?.isValid == true) | ||
| RangeSlider( | ||
| values: RangeValues( |
There was a problem hiding this comment.
WARNING: RangeSlider can assert/crash when the score range is outside 0..10.
scoreRange is parsed directly from the query text (e.g. typing score:0..100 is accepted by _scoreRegExp) and passed unchanged into initialState. Opening the filter sheet then builds this RangeSlider with values outside its min: 0 / max: 10 bounds, which violates Flutter's assertion values.start >= min && values.end <= max and throws. Clamp draft.scoreRange values into [0, 10] before constructing RangeValues.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
| ), | ||
| if (draft.rankRange?.isValid == true) | ||
| RangeSlider( | ||
| values: RangeValues( |
There was a problem hiding this comment.
WARNING: Same out-of-bounds RangeSlider risk as the score slider.
rankRange is parsed from arbitrary user input (e.g. rank:0..50000), so min can be 0 (below the slider min: 1) and max can exceed max: 10000. Constructing RangeValues outside the slider bounds triggers a Flutter assertion failure when the sheet opens. Clamp the values into [1, 10000] before building RangeValues.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Overview
The latest commit ( Resolved Issues (from previous review)
The new Other Observations (not in diff)
Files Reviewed (incremental: 2 files)
Previous Review Summary (commit 9969fd4)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 9969fd4)Status: 3 Issues Found | Recommendation: Address before merge Overview
This PR adds an advanced search workbench (tags, sort, season/date, rank/score ranges, weekday) with a new Issue Details (click to expand)WARNING
Other Observations (not in diff)
Files Reviewed (11 files)
Reviewed by claude-4.8-opus-20260528 · 240,338 tokens |
No description provided.