Skip to content

Commit 02307d0

Browse files
committed
fix(spec): reportForm offers a joined block's dataset as the ref:dataset picker, marked required
The "Joined blocks" repeater's `dataset` row declared only a label, so Studio's report inspector drew a free-text, unmarked cell for a key the joined arm of ReportSchema now refuses when absent (#21702). The row now declares `widget: 'ref:dataset'` (registered in objectui's WIDGETS at the console pin) and `required: true`, and a pin beside the refusal's own tests holds both. Claude-Session: https://claude.ai/code/session_01T9u38rswFp5Rw8DswRUReJ Co-authored-by: Claude <noreply@anthropic.com>
1 parent 75ddcd1 commit 02307d0

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

‎packages/spec/src/ui/report-joined-block-dataset.test.ts‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import { describe, expect, it } from 'vitest';
2727
import { getMetadataTypeSchema } from '../kernel/metadata-type-schemas';
2828
import { MIGRATIONS_BY_MAJOR, RETIRED_KEYS_BY_MAJOR } from '../migrations/registry';
2929
import { ObjectStackDefinitionSchema, defineStack } from '../stack.zod';
30+
import { reportForm } from './report.form';
3031
import { JoinedReportBlockSchema, ReportSchema, defineReport } from './report.zod';
3132

3233
const ENTRY_ID = 'ui-report-joined-block-dataset-required';
@@ -245,6 +246,22 @@ describe('the joined reports measured at the census parse unchanged', () => {
245246
});
246247
});
247248

249+
describe('the report form offers a block\'s `dataset` as the dataset picker, marked required (#21714)', () => {
250+
it('the "Joined blocks" repeater\'s `dataset` row declares `widget: \'ref:dataset\'` and `required: true`', () => {
251+
// Studio's report inspector renders this row spec: the widget hint picks
252+
// the cell's control, and `required` draws the column's marker and the
253+
// cell's `aria-required`. Without both, a new block is a free-text cell the
254+
// refusal above rejects on save.
255+
const blocks = (reportForm.sections as any[])
256+
.flatMap((s) => s.fields ?? [])
257+
.find((f: any) => f?.field === 'blocks');
258+
expect(blocks?.type).toBe('repeater');
259+
const row = (blocks.fields as any[]).find((f) => f?.field === 'dataset');
260+
expect(row?.widget).toBe('ref:dataset');
261+
expect(row?.required).toBe(true);
262+
});
263+
});
264+
248265
describe('the ADR-0087 ledger', () => {
249266
it('registers one D3 entry at protocol 18, with no D2 conversion, prescribing the binding', () => {
250267
const entries = MIGRATIONS_BY_MAJOR[18]!.semantic.filter((e) => e.id === ENTRY_ID);

‎packages/spec/src/ui/report.form.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,11 @@ export const reportForm = defineForm({
8282
// A `chart` input sat here until #20161: the key was removed from
8383
// `JoinedReportBlockSchema` because no renderer ever drew a block
8484
// chart, so this control offered a setting that plotted nothing.
85-
{ field: 'dataset', label: 'Dataset' },
85+
// #21714: a joined report refuses a block that binds no `dataset`
86+
// (#21702), so this column declares the `ref:dataset` picker the
87+
// top-level binding declares, marked required: a block is bound
88+
// in the form before save.
89+
{ field: 'dataset', label: 'Dataset', widget: 'ref:dataset', required: true },
8690
{ field: 'rows', label: 'Rows' },
8791
{ field: 'columns', label: 'Columns' },
8892
{ field: 'values', label: 'Values' },

0 commit comments

Comments
 (0)