Skip to content

Commit 7f4970a

Browse files
fix(plugin-dashboard): a compare widget dated on a related record's field is served through the declared date dimension over that path (#36103)
<!-- claude-projects-attribution: {"github_login":"os-tesla"} --> _Requested by **Tesla** · [project thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6JaoH1SLb7yGpZj1NnaFvhbT6W)_ Fixes #34350 Clause-②: no Metadata-protocol: none ## 维护者速读 - 仪表板作者:按关联记录的日期(例如客户的签约日期)做同期对比的比较型小组件,以前被数据集查询直接拒绝;现在只要数据集在那条关联路径上声明了一个日期维度,对比就能正常算出并显示。 - 属于仪表板数据集组件的同期对比,补上数据集只认已声明成员之后留下的缺口(替仪表板作者解决)。 - 出错时:没有覆盖该路径的日期维度,或有两个以上时,小组件照旧显示数据集查询的拒绝信息,不会显示猜出来的数字;拒绝信息现在会告诉作者在该关联字段上声明一个日期维度。本改动可直接撤回,撤回后回到原来的拒绝。 - 无 ## What changes Seat ruling 6911721875 on #34005 keeps the dataset door's refusal of an undeclared member and leaves one thing open: the renderer mapping a dotted date key to a declared dimension over that path. This PR is that mapping, in the dashboard renderer, plus the one door refusal sentence the mapping makes false (L1 REWORK R1). Nothing under `packages/spec` and nothing in the door's or the executor's behaviour changes. - `DatasetWidget` (dataset-bound widget with `compareTo`): when a closed date window in the widget's resolved filter is keyed on a field that cannot be a dimension name (judged by the spec's own `SnakeCaseIdentifierSchema`, so a dotted `relationship.field`), the widget reads the dataset definition (`GET /api/v1/meta/dataset/NAME`, through the host's `apiFetch`, with `callerPackage` when the dashboard has a served package, the same read the dataset chart and the report date range make) and sends that window under the declared dimension's name. The query waits for the read. - `mapCompareWindowKeys` decides the rename: - mapped: exactly one declared dimension with `type: 'date'` whose `field` equals the key, spelled exactly; - left as authored (so the door's existing `400 INVALID_FIELD` answers): zero such dimensions; two or more (no guess between two declarations); a dimension over the path without `type: 'date'`; a declared name another window already uses or two keys would share; a failed definition read. - A key that can be a dimension name (`close_date`) is never renamed, and a widget with no such key reads nothing; its query is byte-identical to before. - `compareTo.dimension` naming the window by the path or by the declared name is sent as the declared name, so the executor's dimension resolution sees the same name the window carries. - `@objectstack/service-analytics`, `compareWindowRemedy` (message text only): the sentence for a comparison-window key that cannot be a dimension name keeps "cannot be a dimension name (... no dot ...)" and now names the remedy that exists, one date dimension declared over that field (`type: 'date'`, `field` set to it, any snake_case name, the relationship in `include`) named in `timeDimensions` (and in `compareTo.dimension`, if set), which a dashboard compare widget does itself. It replaces "this comparison cannot run on a dataset query unless ... a field of the dataset's own object ...". The refusal's code, status, member, param and when it fires are unchanged; the identifier-key sentence and the intro are unchanged. Pins quoting it are updated and two test titles that became false are retitled. - `content/docs/ui/dashboards.mdx`, "The Date Key of a Compare Widget": its paragraph said declaring a dimension over the path "does not help"; that became false with this change, so it now states the declaration that serves the window and when the key is still refused. This file is outside the claim's file surface and is declared here. ### Keys the mapping serves (for the compare-widget date-key save gate, #34308) A compare window's date key reaches the dataset query as a declared name when either holds: 1. the key is itself a declared dimension name (unchanged; no read, no rename); or 2. the key cannot be a dimension name and the dataset declares exactly one dimension with `type: 'date'` and `field` equal to the key. Every other key goes out as authored and is refused by the door. A save gate that accepts exactly these two cases accepts exactly what the renderer can serve. ## Tests New pin `ui/packages/plugin-dashboard/src/__tests__/DatasetWidget.compareWindowPathKey-34350.test.tsx` (13 tests), against a stand-in for the door's declared-member rule: - the dotted window served through the one declared date dimension over the path (definition read once, as the reader, before the only query; window moved out of `runtimeFilter`; tile renders the value); - `compareTo.dimension` written as the path or as the declared name both go out as the declared name; - the refusal when no declared date dimension covers the path: key sent as authored, `code` `INVALID_FIELD` and `status` 400, refusal shown on the tile; the same for two covering dimensions and for a failed definition read; - no definition read for an own-object key or a widget without `compareTo`; - `mapCompareWindowKeys` unit cases for every branch above. <details><summary>Readings (head ffebb0e)</summary> - `vitest run` on the new pin plus `DatasetWidget.compareTo.test.tsx` and `DashboardRenderer.compareToAllTime-25970.test.tsx`: Test Files 3 passed, Tests 52 passed, lock VERDICT command-exit 0. - `vitest run packages/plugin-dashboard/` (whole package): Test Files 207 passed (207), Tests 2023 passed, 6 skipped, lock VERDICT command-exit 0. - `pnpm --filter @object-ui/plugin-dashboard run type-check` (`tsc --noEmit && tsc -p tsconfig.test.json`): exit 0; the test project's file list includes the new pin (1 hit). - Ablation 1, mapping disabled (`over.length === 1` to `over.length === -1`, via `scripts/ablation-replace.mjs`, anchor 1 to 0, blob c40bc3e to 986c24cc): 3 failed (the unit map case, the served window, the `compareTo.dimension` rename), 10 passed; restored, blob equals HEAD, `git diff HEAD` empty. - Ablation 2, ambiguity guessed (`over.length >= 1`): 2 failed (both two-declarations cases), 11 passed; restored, blob equals HEAD. - The test imports the widget from source, not through a package `dist`, so no rebuild leg applies. </details> <details><summary>R1 readings (head 3f41ce4)</summary> - service-analytics pins `dataset-query-declared-members.test.ts` + `dotted-path-preview-parity.test.ts`: Test Files 2 passed (2), Tests 49 passed (49), lock VERDICT command-exit 0. - `pnpm --filter @objectstack/service-analytics test`: Test Files 221 passed (221), Tests 5651 passed, 345 skipped; `typecheck` (`tsc --noEmit`, both pin files in its file list) exit 0. - plugin-dashboard compare pins again: Test Files 3 passed, Tests 52 passed. - Ablation, the old sentence restored through `scripts/ablation-replace.mjs` (anchor 1 to 0, blob f49134b to 8f1b94d5): 8 failed, 41 passed (both refusal pins, the five table cases with an unnameable key, the preview-parity CONTROL); restored, blob equals HEAD f49134b, `git diff HEAD` empty. The pins import the source module, so no rebuild leg applies. </details> ## Acceptance notes - Dimensions over the path that omit `type` are not mapped: the rule reads only what the dataset declares, as the card asks for the declared date dimension. - An identifier key that is a field of the base object but not a declared dimension name (for example `close_date` under a dimension named `closed_on`) stays as authored. That case has a declare-it remedy at the door and is outside this card. - The definition read is one extra request per widget only for a compare widget whose window is keyed on a path. It is not cached across widgets; the dataset chart and the report make the same uncached read. - The door's refusal wording for a key no dimension can be named used to say the comparison needs a date field of the dataset's own object; this mapping made that false, so the sentence is corrected here (L1 REWORK R1, claim amendment 2). The ADR-0087 markers and shipped changesets that quote the old "no in-dataset remedy" wording are history and are not edited. ## Verification Read first, by risk: 1. `DatasetWidget.tsx`, the compare-window block in the component (`pathWindowKeys`, `useCompareWindowKeyMap`, `comparedKey`, the signature and the early return in the fetch effect): the query must not go out while the read is pending, and must not refetch in a loop. 2. `DatasetWidget.tsx`, `mapCompareWindowKeys`: the zero / two-or-more / collision branches. 3. `packages/services/service-analytics/src/dataset-declared-members.ts`, `compareWindowRemedy`: the unnameable-key sentence, singular and plural. Two-minute check: `cd ui && pnpm exec vitest run packages/plugin-dashboard/src/__tests__/DatasetWidget.compareWindowPathKey-34350.test.tsx`, expect 13 passed. --- _Generated by [Claude Code](https://claude.ai/code/session_01L9qibxWPiQYXSf1jxGbN3W)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L9qibxWPiQYXSf1jxGbN3W <!-- signed: repo:objectstack#7 · os-tesla · session_01L9qibxWPiQYXSf1jxGbN3W --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 30b0987 commit 7f4970a

7 files changed

Lines changed: 459 additions & 43 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
'@object-ui/plugin-dashboard': patch
3+
'@objectstack/service-analytics': patch
4+
---
5+
6+
fix(plugin-dashboard): a compare widget dated on a related record's field is served through the dataset's declared date dimension over that path
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
A dataset-bound compare widget (`compareTo`) sends its date window to the dataset query under the filtered field's name. The dataset query answers only declared dimensions, and a dimension name has no dot, so a window on a related record's field, such as `account.founded_at`, was refused with `400 INVALID_FIELD`.
12+
13+
When such a key is in the window, the widget now reads the dataset definition and sends the window under the one declared dimension with `type: 'date'` and `field` equal to that path (for example `{ name: 'account_founded', field: 'account.founded_at', type: 'date' }`). A `compareTo.dimension` that names the window by the path or by that declared name is sent as the declared name. When no declared date dimension covers the path, or two or more do, the key is sent as authored and the dataset query still refuses it. Keys that can be dimension names, such as `close_date`, are never renamed, and widgets whose window has no such key read nothing extra.
14+
15+
To serve a compare widget dated on a related record's field, declare one date dimension over that path on the dataset.
16+
17+
The dataset query's `400 INVALID_FIELD` refusal for a comparison-window date key that cannot be a dimension name no longer says the comparison cannot run unless the date field is a field of the dataset's own object; it names the remedy that exists: declare one date dimension over that field (`type: 'date'`, `field` set to it, any snake_case name, the relationship in the dataset's `include`) and name it in `timeDimensions`, which a dashboard compare widget then does itself. The refusal's code, status and when it fires are unchanged.

‎content/docs/ui/dashboards.mdx‎

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -541,14 +541,26 @@ names the remedy: declare a date dimension named after the date-range field.
541541
A date field of a related record — a dotted `relationship.field` such as
542542
`account.signed_at`, which a dashboard filter may otherwise name (see
543543
[Filtering on a Related Record's Field](#filtering-on-a-related-records-field)) —
544-
has no such remedy. A dimension name is a snake_case identifier with no dot, so
545-
no dimension can carry that key, and the dataset query refuses the comparison
546-
with `400 INVALID_FIELD`; the message offers no declaration for that key and
547-
says the comparison needs a date field of the dataset's own object that a
548-
declared date dimension names. Declaring a
549-
dimension over the path under another name does not help, because the widget
550-
still sends the window under the dotted field's name. A compare widget's date
551-
window must therefore be a field of the dataset's own object.
544+
cannot be a dimension name, because a dimension name is a snake_case identifier
545+
with no dot. Declare a date dimension **over** the path instead, under any name
546+
(the relationship is listed in the dataset's `include`, as for any dimension over
547+
a path):
548+
549+
```typescript
550+
dimensions: [
551+
// The dashboard's dateRange filters `account.signed_at`; the compare widget
552+
// reads the dataset and sends its window as the dimension "account_signed".
553+
{ name: 'account_signed', label: 'Account signed', field: 'account.signed_at', type: 'date' },
554+
],
555+
```
556+
557+
When the window's key is such a path, the widget reads the dataset definition
558+
and sends the window under the one declared dimension with `type: 'date'` and
559+
`field` equal to the path. A widget `compareTo.dimension` may name it by either
560+
spelling, the path or the declared name. When no declared date dimension covers
561+
the path, or two or more do, the widget sends the dotted key as it is, and the
562+
dataset query refuses the comparison with `400 INVALID_FIELD`. A key that can be
563+
a dimension name, such as `close_date`, is always sent as it is.
552564

553565
No author-time rule checks a compare widget's date key yet.
554566

‎packages/services/service-analytics/src/__tests__/dataset-query-declared-members.test.ts‎

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -291,9 +291,10 @@ describe('queryDataset refuses a selection member the dataset does not declare',
291291
expect(reads).toEqual([]);
292292
});
293293

294-
it('mixed comparison date keys: a related record\'s field gets the own-object requirement, a nameable key keeps its declare-it remedy', async () => {
294+
it('mixed comparison date keys: a related record\'s field gets the declare-over-it remedy, a nameable key keeps its declare-it remedy', async () => {
295295
// Seat ruling (option A): a dotted key cannot be a dimension name, so no
296-
// sentence tells the author to declare a dimension named after it.
296+
// sentence tells the author to declare a dimension named after it; the
297+
// remedy is a date dimension declared over it (objectstack#34350).
297298
const { service, reads } = await boot();
298299
const e = await service
299300
.queryDataset(
@@ -315,7 +316,9 @@ describe('queryDataset refuses a selection member the dataset does not declare',
315316
);
316317
expect(messageOf(e)).toContain('"account.signed_at" cannot be a dimension name');
317318
expect(messageOf(e)).toContain(
318-
'this comparison cannot run on a dataset query unless that date field is a field of the dataset\'s own object that a declared date dimension names.',
319+
'so no date dimension can be declared under it. Declare one date dimension over it instead, with `type: \'date\'` and `field` set to that field, '
320+
+ 'under any snake_case name (a related record\'s field needs its relationship in the dataset\'s `include`), and name that dimension in '
321+
+ '`timeDimensions` (and in `compareTo.dimension`, if set): a dashboard compare widget sends its window under that declared name itself.',
319322
);
320323
expect(messageOf(e)).toContain(
321324
'For the key that can be a dimension name, declare a date dimension named "closed_on" on the dataset (over that field).',
@@ -328,11 +331,12 @@ describe('queryDataset refuses a selection member the dataset does not declare',
328331
expect(reads).toEqual([]);
329332
});
330333

331-
it('a related record\'s field as the only undeclared member: the refusal tells the author to declare nothing', async () => {
334+
it('a related record\'s field as the only undeclared member: the refusal names no member to declare under the key, only a date dimension over it', async () => {
332335
// Seat ruling (option A): the message must be true for that class. The
333336
// select-or-declare sentence would name the dotted key, which no
334337
// declaration can carry, so it is left out; the compare-window sentence is
335-
// the whole remedy.
338+
// the whole remedy, a date dimension declared over the field
339+
// (objectstack#34350).
336340
const { service, reads } = await boot();
337341
const e = await service
338342
.queryDataset(
@@ -351,8 +355,9 @@ describe('queryDataset refuses a selection member the dataset does not declare',
351355
expect(messageOf(e)).not.toContain('Use one of these');
352356
expect(messageOf(e)).toContain(
353357
'"account.signed_at" cannot be a dimension name (a dimension name is a snake_case identifier, with no dot, so a related record\'s field is never one), '
354-
+ 'so no date dimension can be declared under it: this comparison cannot run on a dataset query unless the dashboard\'s date field '
355-
+ 'is a field of the dataset\'s own object that a declared date dimension names.',
358+
+ 'so no date dimension can be declared under it. Declare one date dimension over it instead, with `type: \'date\'` and `field` set to that field, '
359+
+ 'under any snake_case name (a related record\'s field needs its relationship in the dataset\'s `include`), and name that dimension in '
360+
+ '`timeDimensions` (and in `compareTo.dimension`, if set): a dashboard compare widget sends its window under that declared name itself.',
356361
);
357362
expect(reads).toEqual([]);
358363
});
@@ -484,17 +489,19 @@ describe('the source-field gates word their remedy for the door that asked', ()
484489
describe('compareWindowRemedy — a true sentence for every key, in every mix', () => {
485490
const windows = (...keys: string[]) =>
486491
keys.map((member) => ({ member, param: 'timeDimensions' as const, compareWindow: true }));
487-
const ownObject = 'is a field of the dataset\'s own object that a declared date dimension names.';
492+
const include = 'under any snake_case name (a related record\'s field needs its relationship in the dataset\'s `include`)';
493+
const overIt = `so no date dimension can be declared under it. Declare one date dimension over it instead, with \`type: 'date'\` and \`field\` set to that field, ${include}, and name that dimension in \`timeDimensions\` (and in \`compareTo.dimension\`, if set): a dashboard compare widget sends its window under that declared name itself.`;
494+
const overEach = `so no date dimension can be declared under them. Declare one date dimension over each instead, with \`type: 'date'\` and \`field\` set to that field, ${include}, and name those dimensions in \`timeDimensions\` (and in \`compareTo.dimension\`, if set): a dashboard compare widget sends each window under its declared name itself.`;
488495

489496
// [nameable keys, unnameable keys, the sentences after the intro]
490497
for (const [nameable, unnameable, tail] of [
491498
[['closed_on'], [], 'Declare a date dimension named "closed_on" on the dataset (over that field).'],
492499
[['closed_on', 'created_at'], [], 'Declare a date dimension for each on the dataset, named "closed_on" and "created_at", each over the field of the same name.'],
493-
[[], ['account.founded_at'], `"account.founded_at" cannot be a dimension name (a dimension name is a snake_case identifier, with no dot, so a related record's field is never one), so no date dimension can be declared under it: this comparison cannot run on a dataset query unless the dashboard's date field ${ownObject}`],
494-
[[], ['CloseDate'], `"CloseDate" cannot be a dimension name (a dimension name is a snake_case identifier, with no dot, so a related record's field is never one), so no date dimension can be declared under it: this comparison cannot run on a dataset query unless the dashboard's date field ${ownObject}`],
495-
[[], ['account.founded_at', 'owner.hired_at'], `"account.founded_at" and "owner.hired_at" cannot be dimension names (a dimension name is a snake_case identifier, with no dot, so a related record's field is never one), so no date dimension can be declared under them: this comparison cannot run on a dataset query unless each of those date fields ${ownObject}`],
496-
[['closed_on'], ['account.founded_at', 'owner.hired_at'], `"account.founded_at" and "owner.hired_at" cannot be dimension names (a dimension name is a snake_case identifier, with no dot, so a related record's field is never one), so no date dimension can be declared under them: this comparison cannot run on a dataset query unless each of those date fields ${ownObject} For the key that can be a dimension name, declare a date dimension named "closed_on" on the dataset (over that field).`],
497-
[['closed_on', 'created_at'], ['account.founded_at'], `"account.founded_at" cannot be a dimension name (a dimension name is a snake_case identifier, with no dot, so a related record's field is never one), so no date dimension can be declared under it: this comparison cannot run on a dataset query unless that date field ${ownObject} For the keys that can be dimension names, declare a date dimension for each on the dataset, named "closed_on" and "created_at", each over the field of the same name.`],
500+
[[], ['account.founded_at'], `"account.founded_at" cannot be a dimension name (a dimension name is a snake_case identifier, with no dot, so a related record's field is never one), ${overIt}`],
501+
[[], ['CloseDate'], `"CloseDate" cannot be a dimension name (a dimension name is a snake_case identifier, with no dot, so a related record's field is never one), ${overIt}`],
502+
[[], ['account.founded_at', 'owner.hired_at'], `"account.founded_at" and "owner.hired_at" cannot be dimension names (a dimension name is a snake_case identifier, with no dot, so a related record's field is never one), ${overEach}`],
503+
[['closed_on'], ['account.founded_at', 'owner.hired_at'], `"account.founded_at" and "owner.hired_at" cannot be dimension names (a dimension name is a snake_case identifier, with no dot, so a related record's field is never one), ${overEach} For the key that can be a dimension name, declare a date dimension named "closed_on" on the dataset (over that field).`],
504+
[['closed_on', 'created_at'], ['account.founded_at'], `"account.founded_at" cannot be a dimension name (a dimension name is a snake_case identifier, with no dot, so a related record's field is never one), ${overIt} For the keys that can be dimension names, declare a date dimension for each on the dataset, named "closed_on" and "created_at", each over the field of the same name.`],
498505
] as Array<[string[], string[], string]>) {
499506
it(`${nameable.length} nameable, ${unnameable.length} unnameable`, () => {
500507
const keys = [...nameable, ...unnameable];

‎packages/services/service-analytics/src/__tests__/dotted-path-preview-parity.test.ts‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -240,11 +240,12 @@ describe('[#28555–#28558] members read through a relationship path, on the nat
240240
);
241241
});
242242

243-
it('CONTROL, in place of the served windowed key: a compare window over the backed \'account.founded_at\' is refused on every face, naming no declare-it remedy', async () => {
243+
it('CONTROL, in place of the served windowed key: a compare window over the backed \'account.founded_at\' is refused on every face, naming a date dimension over it, never one named after it', async () => {
244244
// A dashboard compare widget lowers a dotted date filter into this very
245-
// key. No dimension can be named `account.founded_at` (the dimension
246-
// name grammar has no dot), so the refusal states what the comparison
247-
// needs instead: a date field of the dataset's own object.
245+
// key when the dataset declares no date dimension over it. No dimension
246+
// can be named `account.founded_at` (the dimension name grammar has no
247+
// dot), so the refusal names the remedy that exists: a date dimension
248+
// declared over the field, under another name (objectstack#34350).
248249
const err = await undeclaredAlike(
249250
BACKED,
250251
{
@@ -261,7 +262,9 @@ describe('[#28555–#28558] members read through a relationship path, on the nat
261262
expect(err.message).not.toContain('declare the member on the dataset');
262263
expect(err.message).toContain('"account.founded_at" cannot be a dimension name');
263264
expect(err.message).toContain(
264-
'this comparison cannot run on a dataset query unless the dashboard\'s date field is a field of the dataset\'s own object that a declared date dimension names.',
265+
'so no date dimension can be declared under it. Declare one date dimension over it instead, with `type: \'date\'` and `field` set to that field, '
266+
+ 'under any snake_case name (a related record\'s field needs its relationship in the dataset\'s `include`), and name that dimension in '
267+
+ '`timeDimensions` (and in `compareTo.dimension`, if set): a dashboard compare widget sends its window under that declared name itself.',
265268
);
266269
});
267270

‎packages/services/service-analytics/src/dataset-declared-members.ts‎

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,11 @@ function canBeDimensionName(key: string): boolean {
119119
* comparison is either dropped or refused again.
120120
*
121121
* A key that cannot be a dimension name (a dotted `relationship.field`, or any
122-
* key the dimension-name grammar refuses) gets no declare-it remedy, because
123-
* no declaration can carry that name. Its sentence says what the comparison
124-
* needs instead: the dashboard's date field must be a field of the dataset's
125-
* own object that a declared date dimension names. When the keys are mixed,
122+
* key the dimension-name grammar refuses) gets no declare-it-named-so remedy,
123+
* because no declaration can carry that name. Its sentence names the remedy
124+
* that does exist: one date dimension declared OVER that field, under any
125+
* name, named in the query. A dashboard compare widget sends its window under
126+
* that declared name itself (objectstack#34350). When the keys are mixed,
126127
* each kind gets its own sentence, scoped to the keys it is true for.
127128
*/
128129
export function compareWindowRemedy(undeclared: readonly UndeclaredSelectionMember[]): string {
@@ -145,9 +146,12 @@ export function compareWindowRemedy(undeclared: readonly UndeclaredSelectionMemb
145146
? `${quotedList(unnameable)} cannot be a dimension name`
146147
: `${quotedList(unnameable)} cannot be dimension names`)
147148
+ ' (a dimension name is a snake_case identifier, with no dot, so a related record\'s field is never one), '
148-
+ `so no date dimension can be declared under ${single ? 'it' : 'them'}: this comparison cannot run on a dataset query `
149-
+ `unless ${!single ? 'each of those date fields' : one ? 'the dashboard\'s date field' : 'that date field'} `
150-
+ 'is a field of the dataset\'s own object that a declared date dimension names.',
149+
+ `so no date dimension can be declared under ${single ? 'it' : 'them'}. `
150+
+ `Declare one date dimension over ${single ? 'it' : 'each'} instead, with \`type: 'date'\` and \`field\` set to `
151+
+ 'that field, under any snake_case name (a related record\'s field needs its relationship '
152+
+ 'in the dataset\'s `include`), and name '
153+
+ `${single ? 'that dimension' : 'those dimensions'} in \`timeDimensions\` (and in \`compareTo.dimension\`, if set): `
154+
+ `a dashboard compare widget sends ${single ? 'its window under that declared name' : 'each window under its declared name'} itself.`,
151155
);
152156
}
153157
if (nameable.length > 0) {
@@ -192,7 +196,7 @@ export function listMemberNames(names: readonly string[]): string {
192196
* comparison window's date key ({@link compareWindowRemedy}), the refusal also
193197
* says what the compare widget needs: a date dimension named after the key,
194198
* or, for a key no dimension can be named (a related record's field), a date
195-
* field of the dataset's own object.
199+
* dimension declared over that field under another name.
196200
*
197201
* The select-or-declare sentence covers only the members it can fix. A
198202
* comparison window's date key that cannot be a dimension name is never

0 commit comments

Comments
 (0)