Skip to content

按照 Airtable 风格对 ListView 进行优化,修复两个 UI 问题: #887

@hotlong

Description

@hotlong

1. 顶部次要工具栏按钮默认不应显示

现状: Hide fieldsColorComfortable(密度)按钮默认始终显示在工具栏中,占用空间。
期望: 参考 Airtable,这些次要控件默认隐藏,仅在 schema 中显式启用时才显示。

根因: ListView.tsxtoolbarFlags 的默认值使用 !== false(opt-out),应改为 === true(opt-in):

// 当前(默认显示)
showHideFields: schema.showHideFields !== false,
showColor: schema.showColor !== false,
showDensity: ... schema.showDensity !== false,

// 期望(默认隐藏)
showHideFields: schema.showHideFields === true,
showColor: schema.showColor === true,
showDensity: ... schema.showDensity === true,

涉及文件: packages/plugin-list/src/ListView.tsx (lines 278-280)

2. 底部记录数文字重复

现状: 页面底部出现两行 "10 条记录" 文字。
期望: 只显示一次记录数。是否应该保留外层的因为除了表格视图还有日历试图甘特图试图等等等等。

根因: 两个组件各自独立渲染了记录数:

  • ListView.tsxrecord-count-bar(line 1526)
  • Console ObjectView.tsxrecord-count-footer(line 593)

涉及文件:

  • packages/plugin-list/src/ListView.tsx
  • apps/console/src/components/ObjectView.tsx

截图

image1

验收标准

  • showHideFieldsshowColorshowDensity 默认值改为 false(opt-in)
  • 底部记录数只显示一次(移除 ObjectView 中的重复 footer,或在 ListView 已显示时不重复)
  • 运行 test 确保相关测试通过(更新默认行为变更的测试用例)
  • 更新 ROADMAP.md 记录此优化
  • 现有 schema 中显式设置 showHideFields: true 等的场景不受影响

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