Skip to content

Commit fbecf33

Browse files
committed
chore(changeset): state the ADR-0087 disposition and type the new test's warn spy
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgVzvtWN68zb2r9z2zy
1 parent 85a0312 commit fbecf33

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

‎.changeset/30394-non-grid-bulk-bar-declared-actions.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Clause-②: yes (widening) — `@object-ui/plugin-grid` exports `resolveBulkActi
99
Metadata-protocol: narrowed
1010
Skills-docs: no move — `skills/**` teaches no handler-only bulk action name (searched for `bulkActions` examples); `content/docs/ui/**` already names only declared actions.
1111

12+
<!-- adr-0087: not-required (no-migration-prescription) No key of any schema, export or stored row changes shape: `bulkActions` keeps its `string[]` form and meaning, and plugin-grid's new exports add, never retire. What narrows is the non-grid bar's draw set, back to the spec's own sentence (a bare name names an action the object declares). Whether an undeclared name was a misspelling or an action still to declare is a judgement about the view, so no rewrite derives the fix; the development warning names each name. -->
13+
1214
- **Before.** The bar ListView draws itself for every view but the grid mapped each `bulkActions` member straight to a button, labelled by the humanized name, whether or not the object declared it. A name the object does not declare (a misspelling, or an action a disabled package withholds from the served object) showed a button that toasted "not executable" on click. The grid stopped drawing such names in #30169.
1315
- **Now.** The bar folds the names through the grid's `resolveBulkActions`: a name the object declares draws under that action's label (through the app's i18n bundle), the built-in `delete` keeps its own path and gate, and any other name draws nothing. In development the console logs one warning per list naming the key, the view and each name (`[ObjectUI] ListView bulkActions: kanban (objectName: …) — …`), the grid's own message. A bar with nothing left to draw is not shown.
1416
- **Remedy.** Declare the named action on the object, or remove the name from `bulkActions`. An action withheld by a disabled package needs nothing: it draws again when the package is enabled.

‎ui/packages/plugin-list/src/__tests__/ListView.nonGridBulkDeclared-30394.test.tsx‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,15 @@ function renderGallery(objectName: string, bulkActions: string[], ds: Record<str
7979
}
8080

8181
/** The ListView warnings logged so far (the grid's own say `ObjectGrid`). */
82-
function listViewWarnings(warn: ReturnType<typeof vi.spyOn>): string[] {
82+
function listViewWarnings(warn: { mock: { calls: unknown[][] } }): string[] {
8383
return warn.mock.calls
84-
.map(c => String(c[0]))
85-
.filter(m => m.startsWith('[ObjectUI] ListView bulkActions:'));
84+
.map((c: unknown[]) => String(c[0]))
85+
.filter((m: string) => m.startsWith('[ObjectUI] ListView bulkActions:'));
8686
}
8787

8888
describe('ListView non-grid bulk bar draws only actions the object declares (objectstack#30394)', () => {
8989
let prevGallery: ReturnType<typeof ComponentRegistry.get>;
90-
let warn: ReturnType<typeof vi.spyOn>;
90+
let warn: { mock: { calls: unknown[][] }; mockRestore: () => void };
9191

9292
beforeEach(() => {
9393
prevGallery = ComponentRegistry.get('object-gallery');

0 commit comments

Comments
 (0)