Skip to content

feat(frontend): added support for virtual lists and optimized explore page rendering#55

Merged
OrenZhang merged 7 commits intolinux-do:masterfrom
chenyme:master
Jul 6, 2025
Merged

feat(frontend): added support for virtual lists and optimized explore page rendering#55
OrenZhang merged 7 commits intolinux-do:masterfrom
chenyme:master

Conversation

@chenyme
Copy link
Copy Markdown
Collaborator

@chenyme chenyme commented Jul 4, 2025

… page rendering

例行检查

  • 我已阅读并理解 贡献者公约
  • 我已阅读并同意 贡献者许可协议 (CLA),确认我的贡献将根据项目的 MIT 许可证进行许可,
  • 我知晓如果此 PR 并不做出实质性更改,或可被认为是为了PR被合并而提交PR的,则可能不会被合并,

变更内容

  • 优化渲染、tag选择显示
  • 移除404页面冗余背景
  • 优化标签数据溢出

@chenyme chenyme requested a review from OrenZhang July 4, 2025 09:22
@OrenZhang OrenZhang requested review from Copilot and removed request for OrenZhang July 4, 2025 09:22
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 OrenZhang merged commit 4b30c7e into linux-do:master Jul 6, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants