Skip to content

fix: ListView toolbar buttons opt-in by default, remove duplicate record count#889

Merged
hotlong merged 2 commits intomainfrom
copilot/optimize-listview-ui-again
Feb 27, 2026
Merged

fix: ListView toolbar buttons opt-in by default, remove duplicate record count#889
hotlong merged 2 commits intomainfrom
copilot/optimize-listview-ui-again

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 27, 2026

showHideFields, showColor, showDensity toolbar buttons were visible by default (opt-out), and record count rendered twice—once in ListView's record-count-bar and again in ObjectView's record-count-footer.

Toolbar defaults: opt-out → opt-in

// Before (always visible unless explicitly disabled)
showHideFields: schema.showHideFields !== false,
showColor: schema.showColor !== false,
showDensity: ... schema.showDensity !== false,

// After (hidden unless explicitly enabled)
showHideFields: schema.showHideFields === true,
showColor: schema.showColor === true,
showDensity: ... schema.showDensity === true,
  • packages/plugin-list/src/ListView.tsx — toolbarFlags computation
  • packages/types/src/objectql.ts@default JSDoc updated to false on both NamedListView and ListViewSchema

Duplicate record count

  • Removed record-count-footer from apps/console/src/components/ObjectView.tsx — ListView's record-count-bar is the single source of truth

Tests

  • 3 "show by default" tests flipped to "hide by default"
  • 8 tests that relied on implicit visibility now set explicit showX: true
  • ObjectView footer test updated to assert absence
Original prompt

This section details on the original issue you should resolve

<issue_title>按照 Airtable 风格对 ListView 进行优化,修复两个 UI 问题:</issue_title>
<issue_description>

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 等的场景不受影响</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
objectui Ready Ready Preview, Comment Feb 27, 2026 5:44am
objectui-demo Ready Ready Preview, Comment Feb 27, 2026 5:44am
objectui-storybook Ready Ready Preview, Comment Feb 27, 2026 5:44am

Request Review

… count

- Change showHideFields/showColor/showDensity from opt-out (!== false) to opt-in (=== true)
- Remove duplicate record-count-footer from ObjectView.tsx
- Update @default JSDoc in NamedListView and ListViewSchema types
- Update 11 tests to match new default behavior
- Document fix in ROADMAP.md

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI changed the title [WIP] Optimize ListView UI following Airtable style fix: ListView toolbar buttons opt-in by default, remove duplicate record count Feb 27, 2026
@hotlong hotlong marked this pull request as ready for review February 27, 2026 06:10
Copilot AI review requested due to automatic review settings February 27, 2026 06:10
@hotlong hotlong merged commit b0dfbda into main Feb 27, 2026
6 checks passed
Copy link
Copy Markdown
Contributor

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

This PR adjusts ListView toolbar defaults to match an Airtable-style “opt-in” behavior for secondary controls and removes a duplicate record count display in the Console ObjectView.

Changes:

  • Switched showHideFields, showColor, and showDensity toolbar flags from opt-out (!== false) to opt-in (=== true) in ListView.
  • Updated @object-ui/types JSDoc @default annotations for the same flags to false.
  • Removed Console ObjectView’s record-count-footer to avoid duplicate record count UI (ListView’s record-count-bar remains).

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/plugin-list/src/ListView.tsx Makes Hide Fields/Color/Density toolbar buttons opt-in (hidden unless explicitly enabled).
packages/types/src/objectql.ts Updates schema docs to reflect the new opt-in defaults (@default false).
packages/plugin-list/src/tests/ListView.test.tsx Updates tests for the new default toolbar visibility and explicitly enables affected buttons where needed.
apps/console/src/components/ObjectView.tsx Removes duplicate record count footer from ObjectView UI.
apps/console/src/tests/ObjectView.test.tsx Updates test to assert ObjectView no longer renders the footer.
ROADMAP.md Records the change and its rationale/tests in the roadmap.

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.

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

3 participants