fix(web): kb document chunk total size#1299
Merged
Merged
Conversation
Contributor
审阅者指南(在较小的 PR 上默认折叠)审阅者指南将后端返回的知识库文档分块总数传递到 RecallTestResult 视图中,这样结果数量就能反映完整总数,而不仅仅是当前已加载页面的数量。 将分块总数传递到 RecallTestResult 的流程图flowchart LR
subgraph DocumentDetails
loadMoreChunks[loadMoreChunks]
totalState[total state]
end
Backend[Backend API
get_document_chunks]
subgraph RecallTestResult
totalProp[total prop]
resultsDisplay["display (total || data.length)"]
end
loadMoreChunks --> Backend
Backend -->|response.page.total| totalState
totalState -->|pass as prop| totalProp
totalProp --> resultsDisplay
按文件划分的改动
技巧与命令与 Sourcery 交互
自定义你的使用体验访问你的 控制面板 以:
获取帮助Original review guide in EnglishReviewer's guide (collapsed on small PRs)Reviewer's GuidePropagate the backend-reported total number of knowledge base document chunks into the RecallTestResult view so the result count reflects the full total instead of just the currently loaded page. Flow diagram for propagating total chunk count to RecallTestResultflowchart LR
subgraph DocumentDetails
loadMoreChunks[loadMoreChunks]
totalState[total state]
end
Backend[Backend API
get_document_chunks]
subgraph RecallTestResult
totalProp[total prop]
resultsDisplay["display (total || data.length)"]
end
loadMoreChunks --> Backend
Backend -->|response.page.total| totalState
totalState -->|pass as prop| totalProp
totalProp --> resultsDisplay
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - 我在这里给出一些整体反馈:
- 在
RecallTestResult中,建议使用空值合并运算符(total ?? data.length)来代替total || data.length,这样在total合法地为0时,就不会被data.length覆盖。
给 AI 代理的提示
Please address the comments from this code review:
## Overall Comments
- In `RecallTestResult`, consider using nullish coalescing (`total ?? data.length`) instead of `total || data.length` so that a legitimate total of `0` is not overridden by `data.length`.帮我变得更有用!请在每条评论上点击 👍 或 👎,我会根据你的反馈改进后续的 Review。
Original comment in English
Hey - I've left some high level feedback:
- In
RecallTestResult, consider using nullish coalescing (total ?? data.length) instead oftotal || data.lengthso that a legitimate total of0is not overridden bydata.length.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `RecallTestResult`, consider using nullish coalescing (`total ?? data.length`) instead of `total || data.length` so that a legitimate total of `0` is not overridden by `data.length`.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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 by Sourcery
在知识库文档详情和召回测试结果中,跟踪并展示后端返回的文档分片(chunks)总数。
New Features:
Bug Fixes:
Enhancements:
Original summary in English
Summary by Sourcery
Track and display the total number of document chunks returned by the backend in knowledge base document details and recall test results.
New Features:
Bug Fixes:
Enhancements: