Repository navigation
fix(web): remount chunk virtual list when result set changes - #19940
Merged
wangq8 merged 1 commit intoSep 20, 2026
Merged
Conversation
Extract the virtualizer into a `ChunkVirtualList` component remounted through a key derived from the rendered chunk-id sequence, replacing the previous `dataUpdatedAt`-based remount. This fixes two issues: - Background refetches that return the same chunks no longer reset scroll position, since the list key is unchanged. - New search/filter/page results get a fresh virtualizer, so stale per-index measured heights from the previous result set no longer make cards overlap. Also bump the item size estimate from 120 to 180, key virtual items by `chunk_id` via `getItemKey`, and drop the unused `dataUpdatedAt` prop passed into `ChunkCard`.
dcc123456
marked this pull request as draft
September 20, 2026 11:11
dcc123456
marked this pull request as ready for review
September 20, 2026 11:11
Contributor
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
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. Comment |
jay77721
added a commit
to jay77721/ragflow
that referenced
this pull request
Sep 23, 2026
Uploading or replacing an image in the chunk edit dialog only invalidated the chunk list, so the previous picture stayed on screen until the page was reloaded: - Image caches fetched bytes in a module-level map keyed by the request URL, and a chunk keeps its img_id when its image is changed in place, so that URL never changed. - The chunk card still takes a cache-busting `t` prop (forwarded to the image URL as `_t`), but the virtual list rendering it stopped passing one when it was extracted (infiniflow#19940). The list's `dataUpdatedAt` reaches the card again, so cards re-fetch the new bytes after an update. - The edit dialog preview is served by the same cache, so a successful update now evicts the cached bytes of the chunk it touched (evictDocumentImage), which also revokes the stale blob URL. Tests: image-cache.test.tsx pins cache reuse, eviction and the `_t` keying; use-chunk-request-image-eviction.test.tsx pins that a successful update drops the cached image (it expects a second fetch and gets one without the eviction call). Verified: oxfmt/oxlint clean, tsc --noEmit reports no error in the touched files, both new suites pass. Co-authored-by: CommandCodeBot <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extract the virtualizer into a
ChunkVirtualListcomponent remounted through a key derived from the rendered chunk-id sequence, replacing the previousdataUpdatedAt-based remount. This fixes two issues:Also bump the item size estimate from 120 to 180, key virtual items by
chunk_idviagetItemKey, and drop the unuseddataUpdatedAtprop passed intoChunkCard.