Skip to content

fix(components): select-all draws a dash for a partial selection - #27814

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-p16aip
Oct 30, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-p16aip

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Bill · project thread

维护者速读

  • 改了什么:列表(data-table,ObjectGrid 也经它渲染)表头全选框在「部分选中」时画一条横杠,不再画对勾;全选仍是对勾,未选为空。
  • 为什么改:部分选中时表头看起来和「全部选中」一模一样,用户可能误以为整页都选上了再去跑批量操作。
  • 风险与回滚:只换了表头全选这一处的复选框组件,行内复选框与上游 Shadcn ui/checkbox.tsx 未动;回滚即还原 data-table 那一行 import 与标签。
  • 先看:ui/packages/components/src/custom/tri-state-checkbox.tsx(新的内部包装),data-table.tsx 表头全选那一处。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/components/src/renderers/complex/__tests__/data-table-selectAllMixed-27807.test.tsx,预期 3/3 通过。
  • 需要你做的:无,席位落地。

Fixes #27807

Clause-②: no
Metadata-protocol: none

What changes

  • New package-internal TriStateCheckbox in ui/packages/components/src/custom/tri-state-checkbox.tsx, built on the Radix checkbox primitive with the same classes as the Shadcn Checkbox: checked="indeterminate" draws a lucide Minus (dash) and takes the checked fill; true draws the check; false draws nothing. It is not re-exported from custom/index.ts, so the package's public surface is unchanged (Clause-②: no).
  • data-table.tsx: the header select-all (the only call site in ui/packages/** that passes 'indeterminate') uses TriStateCheckbox. Row checkboxes keep the Shadcn Checkbox.
  • ⛔ No edit under ui/packages/components/src/ui/** (ui/AGENTS.md Remove explicit pnpm version from workflows to fix version conflict #7 No-Touch zone).

Measured repro / call sites (on origin/main at 86aaff3)

  • The Tasks → Bulk Actions view is an object grid; ObjectGrid builds a type: 'data-table' schema and renders it through SchemaRenderer, so the header checkbox is the components data-table's.
  • git grep -n indeterminate over ui/packages/*/src (non-test, excluding src/ui/): exactly one checkbox call site, the data-table header select-all (somePageRowsSelected ? 'indeterminate' : false). The other hits are progress bars and comments.
  • Mechanism confirmed in ui/checkbox.tsx: the Radix Indicator renders for checked and indeterminate, and its only child is Check.

Tests

New ui/packages/components/src/renderers/complex/__tests__/data-table-selectAllMixed-27807.test.tsx:

  • one of three rows selected → header aria-checked="mixed", dash glyph present, check glyph absent;
  • control: all selected → aria-checked="true", check present, dash absent;
  • control: none selected → aria-checked="false", no glyph.

Acceptance notes

  • Ablation (via scripts/ablation-replace.mjs, the header select-all's opening tag TriStateCheckbox swapped back to Checkbox in data-table.tsx, landed 1 → 0, restored to the HEAD blob with git diff HEAD empty): the partial-selection test went red, as did the all-selected control (the upstream check carries no data-glyph marker); the none-selected control stayed green. Tests 2 failed | 1 passed.
  • The wrapper mirrors the Shadcn checkbox classes by copy. If a future shadcn sync changes ui/checkbox.tsx styling, the header select-all will not follow automatically.

Verification

See the report comment on #27807 for the gate list (dispatch-gates --commands derived, each command :: exit code) and the test runs.


Generated by Claude Code

The data table's header checkbox is driven to 'indeterminate' for a partial
page selection, but the Shadcn checkbox draws a check mark for that state too.
A package-internal TriStateCheckbox in custom/ draws a dash for the mixed
state; ui/checkbox.tsx is untouched.

Claude-Session: https://claude.ai/code/session_01Utp6CX72iRaaWgbDcBSUdZ
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Oct 30, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#4 · os-bill · session_01Utp6CbDAucNyQ4UtzCJKyh

席位核对

ACCEPT · head 2e2036722b6eae93aa67f9d99fedf7fba78cfe0a · 2026-10-30T00:46Z

  • Shape: draft → main, Fixes #27807. Clause-②: no and Metadata-protocol: none. The new TriStateCheckbox is package-internal: it is not re-exported from custom/index.ts, so the public surface does not move. The changeset is a patch on @object-ui/components.

  • Change, read:

    • New ui/packages/components/src/custom/tri-state-checkbox.tsx. It renders the Radix checkbox with the upstream classes plus an indeterminate fill. The Indicator draws Minus for 'indeterminate' and Check otherwise.
    • The data table's select-all header (the one call site that passes 'indeterminate', measured; ObjectGrid renders through data-table) now uses it.
    • ⛔ No edit under components/src/ui/**: the upstream Shadcn checkbox is unchanged, as ui/AGENTS.md Remove explicit pnpm version from workflows to fix version conflict #7 requires.
  • Evidence (report 6511905563): the new data-table-selectAllMixed-27807 test passes 3 cases:

    • a partial selection draws the dash with aria-checked="mixed";
    • all selected draws the check;
    • none selected draws no glyph.

    Switching the call site back to Checkbox turns 2 red and leaves 1 green, and the file was restored. 36 related files, 244 tests green. Components type-check green.

  • Gates (check-runs on the head): 44 success, 11 skipped, 0 failure. check-governed-merges --pr 27814: NOT governed, 4 files, 138 changed lines.

  • Landing: non-governed, all green, mergeable_state clean, so the seat lands it with pr_ready and automerge_enable.


Generated by Claude Code

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 30, 2026 00:47
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge October 30, 2026 00:47
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 30, 2026
Merged via the queue into main with commit fec60e0 Oct 30, 2026
56 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-p16aip branch October 30, 2026 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Grid header checkbox: a partial selection is announced as mixed but drawn as a check mark

1 participant