feat(frontend): added support for virtual lists and optimized explore page rendering#55
Merged
OrenZhang merged 7 commits intolinux-do:masterfrom Jul 6, 2025
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
该 PR 为前端引入虚拟列表支持并优化 Explore 页面渲染、标签选择器和图表组件。
- 在
tag-selector中集成@tanstack/react-virtual实现高性能标签滚动 - 调整 Explore 页面分页逻辑及首次渲染策略,引入客户端渲染判断
- 重构多处组件:替换 404 世界地图、优化仪表盘图表及侧边导航交互
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/package.json | 新增 @tanstack/react-virtual 依赖 |
| frontend/components/ui/tag-selector.tsx | 重构标签选择器,集成虚拟列表并移除旧 ScrollArea |
| frontend/components/common/explore/ExploreMain.tsx | 调整分页大小为 24,增加客户端渲染判断 |
| frontend/components/common/explore/ExploreContent.tsx | 支持动态 pageSize,更新分页计算和列表键名 |
| frontend/components/common/dashboard/DataCharts.tsx | 分类图表按值降序排序并截取前 10 项 |
| frontend/app/not-found.tsx | 精简 404 布局,移除冗余的世界地图组件 |
Files not reviewed (1)
- frontend/pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (2)
frontend/components/common/dashboard/DataCharts.tsx:367
- 新增了按 value 排序并截取前 10 项的逻辑,建议为 CategoryChart 添加相应单元测试以覆盖排序和截取行为,确保数据正确性。
const sortedData = [...data].sort((a, b) => b.value - a.value);
frontend/components/common/explore/ExploreContent.tsx:45
- pageSize 默认值 20 与 ExploreMain 中 PAGE_SIZE 24 不一致,可能导致分页计算混乱,建议统一默认值或使用共享常量以保持一致性。
export function ExploreContent({data, LoadingSkeleton, pageSize = 20}: ExploreContentProps) {
OrenZhang
approved these changes
Jul 4, 2025
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.
… page rendering
例行检查
变更内容