Skip to content

Commit 08d77c0

Browse files
committed
Merge remote-tracking branch 'origin/main' into the thread branch
Keeps both catalog lines in finding-user-text.ts: the automation catalogs from this branch and the dashboard binding catalogs from main. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibymXZPShrjayTXHyCg
2 parents 8b347e5 + 5c005e0 commit 08d77c0

7 files changed

Lines changed: 1041 additions & 0 deletions
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/lint': patch
3+
---
4+
5+
Clause-②: no
6+
Metadata-protocol: none
7+
8+
The dashboard and report advisories now carry a user-facing sentence in all 11 platform locales, for the save door's `userMessage` (the pattern the security-posture advisories already follow). Nine advisory rule ids gain one: the widget-binding rule's `widget-legacy-analytics-shape`, `dashboard-filter-field-unprovisioned`, `chart-field-unknown`, `chart-measures-missing`, `widget-measures-missing`, `chart-dimensions-missing` and `table-count-only`, and the chart-binding rule's `chart-measure-unknown` and `chart-axis-not-selected` on a report chart's `series[]` entry. Their findings carry the names the sentence interpolates as `userTextParams`, and `findingUserMessage` renders the sentence in the request's locale, else the workspace default, else English.
9+
10+
Rule ids, `message` and `hint` are unchanged, so `os validate`, `os lint` and every save response read exactly as before. `measure-aggregate-incoherent` and `page/visualization-without-binding` have no sentence: the publish door never returns them (the first is judged on a dataset that a dashboard write carries as context, the second on pages no per-write snapshot carries), so they stay on the English `message`.

‎packages/lint/src/finding-user-text.dashboards.test.ts‎

Lines changed: 348 additions & 0 deletions
Large diffs are not rendered by default.

‎packages/lint/src/finding-user-text.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ import { FLOW_TEMPLATE_PATHS_USER_TEXT } from './validate-flow-template-paths.us
6060
import { FLOW_NODE_WRITES_USER_TEXT } from './validate-flow-node-writes.user-text.js';
6161
import { READONLY_FLOW_WRITES_USER_TEXT } from './validate-readonly-flow-writes.user-text.js';
6262
import { FLOW_CREDENTIAL_LITERALS_USER_TEXT } from './lint-flow-credential-literals.user-text.js';
63+
import { WIDGET_BINDINGS_USER_TEXT } from './validate-widget-bindings.user-text.js';
64+
import { CHART_BINDINGS_USER_TEXT } from './validate-chart-bindings.user-text.js';
6365

6466
/**
6567
* The names a finding's user sentence interpolates — object, field and
@@ -168,6 +170,9 @@ export const FINDING_USER_TEXT_CATALOG: UserTextCatalog = mergeUserTextCatalogs(
168170
FLOW_NODE_WRITES_USER_TEXT,
169171
READONLY_FLOW_WRITES_USER_TEXT,
170172
FLOW_CREDENTIAL_LITERALS_USER_TEXT,
173+
// The dashboard writes: widget and chart binding advisories.
174+
WIDGET_BINDINGS_USER_TEXT,
175+
CHART_BINDINGS_USER_TEXT,
171176
);
172177

173178
/**

‎packages/lint/src/validate-chart-bindings.ts‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,13 @@ export interface ChartBindingFinding {
200200
message: string;
201201
/** How to fix it. */
202202
hint: string;
203+
/**
204+
* The names this finding's user-facing sentence interpolates, set where the
205+
* finding is advice the publish door can return (a report chart's
206+
* `series[]` entry); its sentence is in `validate-chart-bindings.user-text.ts`
207+
* (`AuthoringFinding.userTextParams`).
208+
*/
209+
userTextParams?: UserTextParams;
203210
}
204211

205212
// `recordsOf` — the ONE collection reader (`object-graph.ts`), not the
@@ -211,6 +218,7 @@ export interface ChartBindingFinding {
211218
// it with; see that function's header for why the seam reports nothing itself.
212219
import { recordsOf, suggestName } from './object-graph.js';
213220
import { walkPageComponents, type AnyRec } from './page-walk.js';
221+
import type { UserTextParams } from './finding-user-text.js';
214222

215223
function strName(v: unknown): string | undefined {
216224
return typeof v === 'string' && v.length > 0 ? v : undefined;
@@ -308,6 +316,13 @@ interface ChartBinding {
308316
* and resolve against `values`, which on them IS the query's measure set.
309317
*/
310318
ownSelection?: string[];
319+
/**
320+
* The report a report CHART binding belongs to, for the user sentence of its
321+
* advisory `series[]` findings (`validate-chart-bindings.user-text.ts`). Set
322+
* on the report chart binding and nowhere else: that is the one advisory
323+
* position the publish door reaches.
324+
*/
325+
report?: string;
311326
where: string;
312327
/** Path of the binding's container, for the dataset-level finding. */
313328
path: string;
@@ -463,6 +478,11 @@ export function validateChartBindings(stack: AnyRec): ChartBindingFinding[] {
463478
? `Bind a measure that dataset "${dsName}" declares, or declare "${name}" on it.`
464479
: `Correct the name to a measure that dataset "${dsName}" declares, or drop the entry.`) +
465480
suggestName(name, ds.measures),
481+
// The user sentence (`validate-chart-bindings.user-text.ts`): only a
482+
// report chart's series entry is advice the publish door returns.
483+
...(position === 'report-series' && binding.report !== undefined
484+
? { userTextParams: { report: binding.report, measure: name, dataset: dsName } }
485+
: {}),
466486
});
467487
return;
468488
}
@@ -486,6 +506,13 @@ export function validateChartBindings(stack: AnyRec): ChartBindingFinding[] {
486506
: `Add "${name}" to \`values\`, or point the ${
487507
position === 'query' ? 'axis' : 'entry'
488508
} at a selected measure.`,
509+
...(position === 'report-series' && binding.report !== undefined
510+
? {
511+
userTextParams: {
512+
report: binding.report, measure: name, dataset: dsName, plotted: [...selected].sort().join(', '),
513+
},
514+
}
515+
: {}),
489516
});
490517
}
491518
};
@@ -610,6 +637,7 @@ export function validateChartBindings(stack: AnyRec): ChartBindingFinding[] {
610637
.filter((s): s is { name: string; path: string; kind: 'report-series' } => !!s.name),
611638
where: `${where} · chart`,
612639
path: `${path}.chart`,
640+
report: reportName,
613641
});
614642
};
615643

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
2+
3+
/**
4+
* The user-facing sentences of `validate-chart-bindings.ts`'s advisory
5+
* findings, in every platform locale (`PLATFORM_LOCALE_TAGS`,
6+
* `@objectstack/spec/system`). The finding mechanism and the locale ladder are
7+
* `finding-user-text.ts`'s; this file is the rule's own half of it, kept beside
8+
* the rule so its wording and its translations change together.
9+
*
10+
* Who reads these: the person who saved a report in Studio, in their own
11+
* language, once the save door composes `RuntimeAuthoringIssueSchema.userMessage`
12+
* from them. So each sentence names the report's chart series entry, what it
13+
* does (nothing) and the one change that fixes it, in the console's words
14+
* (report, chart, series, dataset, measure).
15+
*
16+
* Both ids are advisory only at a PRESENTATION position, and the publish door
17+
* reaches exactly one of those: a report chart's `series[]` entry, on a
18+
* `report` write. The page-chart positions (`page-series`, `page-axis`) are
19+
* judged on pages, which no per-write snapshot carries, so those findings carry
20+
* no `userTextParams` and keep the English `message`. At a query position
21+
* `chart-measure-unknown` is an error, not advice, and carries none either.
22+
*
23+
* Each entry reads the `userTextParams` its finding carries, set at the push
24+
* site in `validate-chart-bindings.ts`:
25+
*
26+
* | rule id | params |
27+
* |---|---|
28+
* | `chart-measure-unknown` | `report`, `measure`, `dataset` |
29+
* | `chart-axis-not-selected` | `report`, `measure`, `dataset`, `plotted` (the measure the chart plots) |
30+
*
31+
* Names are the API names the rule saw, for the reason
32+
* `validate-security-posture.user-text.ts` gives.
33+
*
34+
* `finding-user-text.dashboards.test.ts` renders every entry from the rule's
35+
* real findings in every platform locale.
36+
*/
37+
38+
import type { UserTextCatalog } from './finding-user-text.js';
39+
import { CHART_AXIS_NOT_SELECTED, CHART_MEASURE_UNKNOWN } from './validate-chart-bindings.js';
40+
41+
export const CHART_BINDINGS_USER_TEXT: UserTextCatalog = Object.freeze({
42+
[CHART_MEASURE_UNKNOWN]: {
43+
en: (p) =>
44+
`In report "${p.report}", the chart series entry "${p.measure}" names no measure of dataset "${p.dataset}", ` +
45+
`so it changes nothing and the series is still drawn. Correct the name to a measure the dataset declares, or ` +
46+
`remove the entry.`,
47+
'zh-Hans': (p) =>
48+
`在报表“${p.report}”中,图表系列条目“${p.measure}”并非数据集“${p.dataset}”的度量,因此不起任何作用,该系列仍会` +
49+
`照常绘制。请把名称改为该数据集声明的度量,或删除该条目。`,
50+
'zh-Hant': (p) =>
51+
`在報表「${p.report}」中,圖表系列項目「${p.measure}」並非資料集「${p.dataset}」的度量,因此不起任何作用,該系列仍會` +
52+
`照常繪製。請把名稱改為該資料集宣告的度量,或刪除該項目。`,
53+
es: (p) =>
54+
`En el informe "${p.report}", la entrada de serie del gráfico "${p.measure}" no corresponde a ninguna medida ` +
55+
`del conjunto de datos "${p.dataset}", por lo que no cambia nada y la serie se sigue dibujando. Corrija el ` +
56+
`nombre por una medida que declare el conjunto de datos o elimine la entrada.`,
57+
ar: (p) =>
58+
`في التقرير "${p.report}"، لا يطابق إدخال سلسلة المخطط "${p.measure}" أي مقياس في مجموعة البيانات ` +
59+
`"${p.dataset}"، لذا لا يغيّر شيئًا وتظل السلسلة مرسومة. صحّح الاسم إلى مقياس تعلنه مجموعة البيانات، أو ` +
60+
`احذف الإدخال.`,
61+
fr: (p) =>
62+
`Dans le rapport « ${p.report} », l’entrée de série du graphique « ${p.measure} » ne désigne aucune mesure du ` +
63+
`jeu de données « ${p.dataset} » : elle ne change donc rien et la série est quand même tracée. Corrigez le nom ` +
64+
`pour indiquer une mesure déclarée par le jeu de données, ou supprimez l’entrée.`,
65+
'pt-BR': (p) =>
66+
`No relatório "${p.report}", a entrada de série do gráfico "${p.measure}" não corresponde a nenhuma medida do ` +
67+
`conjunto de dados "${p.dataset}"; por isso, não muda nada e a série continua sendo desenhada. Corrija o nome ` +
68+
`para uma medida declarada pelo conjunto de dados ou remova a entrada.`,
69+
ru: (p) =>
70+
`В отчёте «${p.report}» элемент ряда диаграммы «${p.measure}» не соответствует ни одной мере набора данных ` +
71+
`«${p.dataset}», поэтому ничего не меняет, а ряд всё равно строится. Исправьте имя на меру, объявленную в ` +
72+
`наборе данных, или удалите элемент.`,
73+
de: (p) =>
74+
`Im Bericht „${p.report}“ nennt der Reiheneintrag „${p.measure}“ des Diagramms keine Kennzahl des Datensatzes ` +
75+
`„${p.dataset}“. Er bewirkt daher nichts, und die Reihe wird trotzdem gezeichnet. Ändern Sie den Namen in eine ` +
76+
`Kennzahl, die der Datensatz deklariert, oder entfernen Sie den Eintrag.`,
77+
ja: (p) =>
78+
`レポート「${p.report}」で、グラフの系列エントリ「${p.measure}」はデータセット「${p.dataset}」のどの指標にも` +
79+
`当たらないため何も変わらず、系列はそのまま描画されます。名前をデータセットが宣言している指標に修正するか、` +
80+
`このエントリを削除してください。`,
81+
ko: (p) =>
82+
`보고서 "${p.report}"에서 차트 계열 항목 "${p.measure}"은(는) 데이터 세트 "${p.dataset}"의 어떤 측정값과도 ` +
83+
`일치하지 않으므로 아무것도 바뀌지 않으며 계열은 그대로 그려집니다. 이름을 데이터 세트에 선언된 측정값으로 ` +
84+
`고치거나 항목을 삭제하세요.`,
85+
},
86+
[CHART_AXIS_NOT_SELECTED]: {
87+
en: (p) =>
88+
`In report "${p.report}", the chart series entry "${p.measure}" names a measure of dataset "${p.dataset}" that ` +
89+
`the chart does not plot (it plots "${p.plotted}"), so it changes nothing. Point the entry at ` +
90+
`"${p.plotted}", or remove it.`,
91+
'zh-Hans': (p) =>
92+
`在报表“${p.report}”中,图表系列条目“${p.measure}”是数据集“${p.dataset}”的度量,但图表并不绘制它(图表绘制的是` +
93+
`“${p.plotted}”),因此不起任何作用。请将该条目指向“${p.plotted}”,或将其删除。`,
94+
'zh-Hant': (p) =>
95+
`在報表「${p.report}」中,圖表系列項目「${p.measure}」是資料集「${p.dataset}」的度量,但圖表並不繪製它(圖表繪製的是` +
96+
`「${p.plotted}」),因此不起任何作用。請將該項目指向「${p.plotted}」,或將其刪除。`,
97+
es: (p) =>
98+
`En el informe "${p.report}", la entrada de serie del gráfico "${p.measure}" es una medida del conjunto de ` +
99+
`datos "${p.dataset}" que el gráfico no traza (traza "${p.plotted}"), por lo que no cambia nada. Haga que la ` +
100+
`entrada apunte a "${p.plotted}" o elimínela.`,
101+
ar: (p) =>
102+
`في التقرير "${p.report}"، يشير إدخال سلسلة المخطط "${p.measure}" إلى مقياس في مجموعة البيانات ` +
103+
`"${p.dataset}" لا يرسمه المخطط (فهو يرسم "${p.plotted}")، لذا لا يغيّر شيئًا. اجعل الإدخال يشير إلى ` +
104+
`"${p.plotted}"، أو احذفه.`,
105+
fr: (p) =>
106+
`Dans le rapport « ${p.report} », l’entrée de série du graphique « ${p.measure} » désigne une mesure du jeu de ` +
107+
`données « ${p.dataset} » que le graphique ne trace pas (il trace « ${p.plotted} ») : elle ne change donc ` +
108+
`rien. Faites pointer l’entrée vers « ${p.plotted} », ou supprimez-la.`,
109+
'pt-BR': (p) =>
110+
`No relatório "${p.report}", a entrada de série do gráfico "${p.measure}" é uma medida do conjunto de dados ` +
111+
`"${p.dataset}" que o gráfico não traça (ele traça "${p.plotted}"); por isso, não muda nada. Aponte a entrada ` +
112+
`para "${p.plotted}" ou remova-a.`,
113+
ru: (p) =>
114+
`В отчёте «${p.report}» элемент ряда диаграммы «${p.measure}» указывает на меру набора данных ` +
115+
`«${p.dataset}», которую диаграмма не строит (она строит «${p.plotted}»), поэтому ничего не меняет. Укажите в ` +
116+
`элементе «${p.plotted}» или удалите его.`,
117+
de: (p) =>
118+
`Im Bericht „${p.report}“ nennt der Reiheneintrag „${p.measure}“ des Diagramms eine Kennzahl des Datensatzes ` +
119+
`„${p.dataset}“, die das Diagramm nicht darstellt (es stellt „${p.plotted}“ dar). Er bewirkt daher nichts. ` +
120+
`Richten Sie den Eintrag auf „${p.plotted}“ aus, oder entfernen Sie ihn.`,
121+
ja: (p) =>
122+
`レポート「${p.report}」で、グラフの系列エントリ「${p.measure}」はデータセット「${p.dataset}」の指標ですが、` +
123+
`グラフはこれを描画しない(描画するのは「${p.plotted}」)ため、何も変わりません。エントリを「${p.plotted}」に` +
124+
`向けるか、削除してください。`,
125+
ko: (p) =>
126+
`보고서 "${p.report}"에서 차트 계열 항목 "${p.measure}"은(는) 데이터 세트 "${p.dataset}"의 측정값이지만 ` +
127+
`차트가 이를 그리지 않으므로(차트는 "${p.plotted}"을(를) 그립니다) 아무것도 바뀌지 않습니다. 항목이 ` +
128+
`"${p.plotted}"을(를) 가리키게 하거나 삭제하세요.`,
129+
},
130+
});

‎packages/lint/src/validate-widget-bindings.ts‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import {
2222
unprovisionedAnchorFix,
2323
unprovisionedAnchorVerdict,
2424
} from './system-fields.js';
25+
import type { UserTextParams } from './finding-user-text.js';
2526

2627
/**
2728
* Build-time dashboard widget binding diagnostics (issues #1719, #1721).
@@ -505,6 +506,12 @@ export interface WidgetBindingFinding {
505506
message: string;
506507
/** How to fix (or deliberately suppress) it. */
507508
hint: string;
509+
/**
510+
* The names this finding's user-facing sentence interpolates, set by the
511+
* advisory push sites whose rule has a sentence in
512+
* `validate-widget-bindings.user-text.ts` (`AuthoringFinding.userTextParams`).
513+
*/
514+
userTextParams?: UserTextParams;
508515
}
509516

510517
type AnyRec = Record<string, unknown>;
@@ -1014,6 +1021,7 @@ export function validateWidgetBindings(stack: AnyRec): WidgetBindingFinding[] {
10141021
push({
10151022
severity: 'warning',
10161023
rule: WIDGET_LEGACY_ANALYTICS_SHAPE,
1024+
userTextParams: { dashboard: dashName, widget: widgetId, keys: legacyUsed.join(', ') },
10171025
message:
10181026
`sets legacy analytics key${plural ? 's' : ''} ${keyList} that the ADR-0021 ` +
10191027
`single-form cutover removed — the dashboard renderer ignores ${plural ? 'them' : 'it'}.`,
@@ -1227,6 +1235,9 @@ export function validateWidgetBindings(stack: AnyRec): WidgetBindingFinding[] {
12271235
push({
12281236
severity: 'warning',
12291237
rule: DASHBOARD_FILTER_FIELD_UNPROVISIONED,
1238+
userTextParams: {
1239+
dashboard: dashName, widget: widgetId, filter: def.name, field: leafField, object: leafObject,
1240+
},
12301241
message: `${provenance}${unprovisionedAnchorVerdict(leafObject, leafField)}, so the widget renders empty`,
12311242
// [#22161] The shared one-line anchor fix; how to vouch for or
12321243
// opt out of the anchor, the widget's `filterBindings` opt-out
@@ -1406,6 +1417,7 @@ export function validateWidgetBindings(stack: AnyRec): WidgetBindingFinding[] {
14061417
push({
14071418
severity: 'warning',
14081419
rule: CHART_FIELD_UNKNOWN,
1420+
userTextParams: { dashboard: dashName, widget: widgetId, dataset: dsName, field: xAxis.field, axis: 'x' },
14091421
message:
14101422
`chartConfig.xAxis.field "${xAxis.field}" is not a dimension of dataset "${dsName}" ` +
14111423
`and is ignored anyway: the x-axis stays bound to this widget's first dimension (${list(dims)})`,
@@ -1444,6 +1456,9 @@ export function validateWidgetBindings(stack: AnyRec): WidgetBindingFinding[] {
14441456
push({
14451457
severity: 'warning',
14461458
rule: CHART_FIELD_UNKNOWN,
1459+
userTextParams: {
1460+
dashboard: dashName, widget: widgetId, dataset: dsName, field, axis: kind === 'series' ? 'series' : 'y',
1461+
},
14471462
message: `${nameClause}, ${consequence}`,
14481463
hint: `Delete the key: \`${key}\` is refused on a dataset-bound widget${instead}`,
14491464
});
@@ -1508,6 +1523,7 @@ export function validateWidgetBindings(stack: AnyRec): WidgetBindingFinding[] {
15081523
push({
15091524
severity: 'warning',
15101525
rule: CHART_MEASURES_MISSING,
1526+
userTextParams: { dashboard: dashName, widget: widgetId, dataset: dsName },
15111527
message:
15121528
`'${w.type}' widget selects no measures (\`values\` is empty), so the renderer ` +
15131529
`shows the "Pick measures (values) for this dataset widget." placeholder and no chart is drawn at all`,
@@ -1529,6 +1545,10 @@ export function validateWidgetBindings(stack: AnyRec): WidgetBindingFinding[] {
15291545
push({
15301546
severity: 'warning',
15311547
rule: WIDGET_MEASURES_MISSING,
1548+
userTextParams: {
1549+
dashboard: dashName, widget: widgetId, dataset: dsName,
1550+
shows: METRIC_WIDGET_TYPES.has(w.type as string) ? 'number' : 'table',
1551+
},
15321552
message:
15331553
`'${w.type}' widget selects no measures (\`values\` is empty), so the renderer ` +
15341554
`shows the "Pick measures (values) for this dataset widget." placeholder and ${drawn}`,
@@ -1544,6 +1564,7 @@ export function validateWidgetBindings(stack: AnyRec): WidgetBindingFinding[] {
15441564
push({
15451565
severity: 'warning',
15461566
rule: CHART_DIMENSIONS_MISSING,
1567+
userTextParams: { dashboard: dashName, widget: widgetId, dataset: dsName },
15471568
message:
15481569
`'${w.type}' widget selects no dimensions, so the renderer draws a single KPI ` +
15491570
`number instead of a '${w.type}' chart`,
@@ -1575,6 +1596,7 @@ export function validateWidgetBindings(stack: AnyRec): WidgetBindingFinding[] {
15751596
push({
15761597
severity: 'warning',
15771598
rule: TABLE_COUNT_ONLY,
1599+
userTextParams: { dashboard: dashName, widget: widgetId, dataset: dsName },
15781600
message:
15791601
`a '${w.type}' widget bound to dataset "${dsName}" selects only count ` +
15801602
`measure(s) (${values.join(', ')}) and no dimensions, so it renders a ` +

0 commit comments

Comments
 (0)