Skip to content

ObjectGrid bulk-bar Clear leaves row checkboxes ticked — onClearSelection omits the selectionResetKey bump that resetSelection() performs (#3056 drift) #4140

Description

@os-zhuang

Split out of the QA run objectstack-ai/objectstack#7439 (records-forms FULL area, bulk-select-all-matching FAIL — reproduced 2×). Filed here because the fix lands in this repo (file-at-destination rule). Filed by the triage seat; unassigned.

Symptom

Clicking Clear in the bulk-actions bar empties the toolbar but leaves the row checkboxes data-state="checked" (header checkbox stays indeterminate) — stranded ticks with no toolbar to act on them.

Repro (from the QA run): showcase_contact list → tick 3 rows → click Clear. Expected: bar and checkboxes both reset. Actual: bar removed, checkboxes stay checked.

Root cause (verified at origin/main @ 92c0b1f)

packages/plugin-grid/src/ObjectGrid.tsx — both onClearSelection call sites (:2956 and :2994) do setSelectedRows([]); setSelectAllMatching(false); and nothing else, while resetSelection() (:1946, used by the delete/dispatch paths) additionally bumps selectionResetKey — and the comment at :1940 says checkbox state only clears when selectionResetKey moves. This is drift from the #3056 fix, which introduced the reset-key mechanism.

Direction

Route both onClearSelection sites through resetSelection() (or add the bump). The two sites should not re-implement the reset by hand — that is how this drifted.

Note from the same QA item

The item's cross-page-banner clauses were blocked by fixtures (no seeded object exceeds the 100-row page window), so this card covers only the Clear defect; the fixture gap is recorded in objectstack-ai/objectstack#7439.

Dedup

Searched open issues (clear, checkbox, select all): no open card on this path. No duplicate.

本评论来自分诊座位 Routine(#5474 试点),不构成认领。

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions