Skip to content

[P0] ListView Grouping — 分组渲染在全视图类型中生效 #748

Closed

Description

@hotlong

背景

Parent Issue: #736

useGroupedData hook 和 Group Popover 选择器已实现,但分组渲染仅在 Grid 视图中部分生效。Kanban/Gallery/Calendar/Timeline 等视图无分组渲染支持。

目标

  • 分组配置通过 schema.grouping 驱动 所有视图类型 的分组渲染
  • Grid 视图:分组行头可展开/折叠,显示分组汇总
  • Kanban 视图:按分组字段自动生成泳道
  • Gallery 视图:按分组字段分区显示卡片

技术要点

  • packages/plugin-grid/src/useGroupedData.ts — 已有 hook,需验证 fields[].collapsed 状态管理
  • packages/plugin-grid/src/ObjectGrid.tsx L348 — 已调用 useGroupedData,需实现分组行渲染(GroupRow 组件)
  • packages/plugin-list/src/ListView.tsx L328 — 已有 groupingConfig state,需传递到非 Grid 视图
  • Spec 协议:GroupingConfigSchema → fields[].field, fields[].order, fields[].collapsed

改动范围

  • packages/plugin-grid/src/ObjectGrid.tsx — 添加 GroupRow 渲染组件
  • packages/plugin-list/src/ListView.tsx — 传递 groupingConfig 到所有 viewComponent
  • packages/plugin-kanban/src/ObjectKanban.tsx — 支持分组配置
  • packages/plugin-gallery/src/ObjectGallery.tsx — 支持分组配置

验收标准

  • Grid 视图分组行可展开/折叠
  • 分组行显示字段值 + 记录数
  • Kanban 视图按分组字段分区
  • Gallery 视图按分组字段分区
  • schema.grouping.fields[].collapsed 初始折叠状态生效
  • 所有新增代码有对应单元测试
  • pnpm test 全部通过
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions