Skip to content

[P0] ListView RowColor — 行着色在全视图类型中生效 #758

@hotlong

Description

@hotlong

背景

Parent Issue: #736

useRowColor hook 已实现(packages/plugin-grid/src/useRowColor.ts),Color Popover 字段选择器已实现。但行着色仅在 Grid 视图生效,Kanban 卡片、Gallery 卡片、Calendar 事件等无着色支持。

目标

  • RowColor 配置驱动 所有视图类型 的着色渲染
  • Grid 行背景色、Kanban 卡片边框色、Gallery 卡片边框色、Calendar 事件背景色

技术要点

  • packages/plugin-grid/src/useRowColor.ts — 已有 colorToClass() + useRowColor() hook
  • packages/plugin-grid/src/ObjectGrid.tsx L348 — 已调用 getRowClassName = useRowColor(schema.rowColor)
  • 需在 Kanban/Gallery/Calendar/Timeline 中接入同一 hook

改动范围

  • packages/plugin-kanban/src/ObjectKanban.tsx — 卡片级着色
  • packages/plugin-gallery/src/ObjectGallery.tsx — 卡片级着色
  • packages/plugin-calendar/src/ObjectCalendar.tsx — 事件着色
  • packages/plugin-timeline/src/ObjectTimeline.tsx — 条目着色
  • packages/plugin-list/src/ListView.tsx — 确保 rowColorConfig 传递到所有子视图

验收标准

  • Grid 行背景色正常(已有)
  • Kanban 卡片按字段值着色
  • Gallery 卡片按字段值着色
  • Calendar 事件按字段值着色
  • Timeline 条目按字段值着色
  • 着色配色对比度满足 WCAG AA
  • 所有新增代码有对应单元测试
  • pnpm test 全部通过

Metadata

Metadata

Assignees

No one assigned

    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