Skip to content

Commit 60e79ed

Browse files
feat(app-shell): report and widget panels speak business wording, and opening the report editor keeps the page in the session language (#36420)
<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Steedos** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbCxiFE11rsKwyNffJZKYqJs)_ repo:objectstack#7 · zhuangjianguo · session_01QsR2jUP9hxdL4RzdzTs9eK Fixes #36373 Clause-②: yes (widening) — the report and widget panels accept an edit of a translated name or title in the session's language, stored as the inline locale map `{ default: SOURCE, LANG: EDIT }` that `I18nLabel` already allows; for an item with a packaged base the server no longer lets the base's translation replace that entry on report `label`/`description` and widget `title`. Nothing is removed or renamed. Metadata-protocol: semantic — `translateReport` and `translateDashboard` now treat a report `label`/`description` or a widget `title` as changed when its inline locale-map entry for the requested locale (the entry the panel writes: exact tag, then the locale's own script, else base tag or a sibling region; never `default`) differs from the packaged base's own, so the base's translation no longer replaces it; a translation the paired `.custom` package ships still answers first (ruling record 6631250894), and with none the entry is served; dataset members (`translateDataset`, ADR-0149) are unchanged Skills-docs: none — no `skills/` file names these panels, their wording or the report/widget label precedence (`git grep` over `skills/` for `translateReport`, `translateDashboard`, `inline locale map`, `ReportDefaultInspector`, `DashboardWidgetInspector`: 0 hits). ## 维护者速读 - **改了什么**:运行界面报表的「编辑」面板、仪表盘卡片属性栏、Studio 里同一套面板,一律显示字段/指标/数据来源的标签(悬停才看到内部名);用词改成「数据来源」「分组」「指标 · 合计」「跟着页面顶部的筛选变」,图表类型是中文名加图标;数据来源下面是一句人话。名称、标题框显示当前语言的文字,改动只写当前语言(`{ default: 原文, zh-CN: 新文字 }`);对已安装应用的报表/仪表盘,服务端不再用应用包的翻译盖掉这一条(定制包自己带的翻译仍然优先)。另修:打开编辑面板时页面标题和副标题不再变成英文。 - **为什么改**:维护者要求对照 Attio 把面板换成业务用词;中文管理员原来看到 `total_amount`、`bar`、「维度」「度量」「受治理…RLS」,页面标题一开编辑就变英文。 - **风险与回滚**:服务端 `i18n-resolver.ts` 改了报表名称/描述和卡片标题的取值顺序(只在有打包基线、且内联条目与基线不同的时候才生效;三仓源码普查 0 个内联 map;部署里已存的定制行若带这种 map,该语言会改读定制自己的文字);数据集成员不变。回滚即 revert 本 PR。 - **先看**:`servedLabel.ts`(显示与写回规则)、`i18n-resolver.ts` 的 `slotRead` / `inlineEntryFor`、`ReportView.tsx` 的 `previewWithServedText`,以及 PR 里的前后截图说明。 ## What changes **Wording and names (both panels).** `ReportDefaultInspector` (runtime 「编辑」 and Studio) and `DashboardWidgetInspector` (Studio's widget property bar, which #36372 reuses at runtime): - The data-source picker lists each dataset by its label alone (`datasetLabelOptions`); the machine name is the option's `title`. No `(name)`, no description. - Bound measure and dimension rows, the add-member popover and the chart-axis selects show labels; the machine name moves to a `title` (`nameOnHover` on `FieldListRow`, `AddFieldPopover` and `InspectorComboField`). A measure reads `LABEL · AGGREGATE`, the aggregate in words from the new `engine.inspector.report.aggregate.*` keys (「金额 · 合计」, "Amount · Sum"). - Catalogue wording (`studio/{en,zh}.ts`): 数据来源 / Data source, 分组 / Group by, 指标 / Metrics, 列分组 / Group columns by, 横轴(分组)/ 纵轴(指标), 不显示图表(只看表格); the widget's section heading is 数据 / Data; the filter section is 跟着页面顶部的筛选变 / Follows the filters at the top of the page; the data-source hint is one plain sentence (no 受治理 or RLS), on the report panel too (`report-dataset-hint`). - The chart-type select shows each type's catalogue name and its icon (`InspectorSelectField` options take an `icon`). - A filter binding row names the filter: its label, 时间 / Date for the date range, else the label of the dimension whose column (`columnIdentity()`) it filters; the empty field face reads 默认(LABEL) or 默认字段. - The report form rows below the curated fields (`metadata-form-zh-cn.ts`, the zh-CN overlay this console renders the bundled report form with) use the same words; those leaves are marked ⟨36373⟩. **Current-language name and title.** `servedLabel.ts`: the name box (report) and title box (widget) show the served translation while the buffer still equals the published value it was translated from; an edit writes the session language's entry only (`writtenLabel`). The report's served text reaches the panel through the new `ServedReportTextContext`, provided by `ReportView` (paired at editor open) and `StudioDesignSurface`; the widget's through the existing `ServedWidgetTextContext`, now also wrapped around Studio's selection inspector and, after #36405, around the dashboard page's edit panel (`DashboardEditPanel` pairs the page's served dashboard with the stored document the edit opened; `useDashboardInPageEdit` keeps that opened document as `published`). **Heading fix.** `ReportView` drew the authored edit buffer (objectstack#35008) as the page, so opening the editor turned 「各阶段商机」 into "Opportunities by Stage". `previewWithServedText` now draws the served value of every translated key (`title`, `label`, `description`, `blocks`) the edit has not changed. **Server precedence (spec).** `packages/spec/src/system/i18n-resolver.ts`: `valueOverridesPackagedBase` (a re-authored string, as before) and `inlineEntryOverridesPackagedBase` (an inline map whose entry for the requested locale differs from the base's) decide what `slotRead` hands the lookup. `translateReport` (label, description) and `translateDashboard` (widget title) read through `slotRead`: a re-authored string reads the pair's translations along the locale chain, as before (`catalogFor(catalogs, true)`); a slot changed through its map entry reads the pair's translation for the requested language only (the same tag, case aside, or another spelling of the same platform-table tag: a `zh-CN` request reads a row under `zh-Hans`, `ja-JP` one under `ja`; no fallback chain, no base-language or regional-variant step), so rank 1 of ruling record 6631250894 (the paired `.custom` package's translation) still answers first for that locale, the base's translation never, and with no pair answer for that locale the map is served and the reader picks its entry (L2 7079950960 S3 and 7080413623 S4, seat ruling: way 1, the requested language). `inlineEntryFor` picks the entry the panel's writer (`localeWriteKey`) replaces: exact tag, then, where the platform table splits the language by script, only an entry of the locale's own script (bare base, then sibling), else the bare base, then the first sibling. ⛔ never `default`. The jsdoc of `labelCatalogs`, `translateReport` and `translateDashboard` names the rule; `inlineEntryOverridesPackagedBase` says why it is a separate twin of `valueOverridesPackagedBase` (the exported `scalarOverridesPackagedBase` and the object fold stay string-only). Docs: `content/docs/protocol/kernel/i18n-standard.mdx` (the precedence), `content/docs/ui/reports.mdx` (new "Editing a report beside it"), `content/docs/ui/dashboards.mdx` (filter bindings wording). ## Tests - New `packages/spec/src/system/i18n-report.test.ts` describe (14 cases): zh entry served; the en `default` byte-identical; ja still reads its bundle text (ステージ別商談); a base-tag `zh` entry answers `zh-CN`; control, a map equal to the base's map reads the bundle; control, no base reads the bundle (the panel gap below); the widget title follows the same rule; scope control, a dataset member's map still loses to the bundle (ADR-0149). L2 rework: with `pairBundle`, the pair's translation answers ahead of the zh entry on a report label and on a widget title, and a pair with no entry for the slot leaves the map (the base's translation never answers); a `zh-TW` request over `{ default, zh }` reads its Traditional bundle text; a `zh-TW` request over `{ default, zh, zh-HK }` gates on the `zh-HK` entry `resolveI18nLabel` shows; a bare-`zh` session reads the `zh-CN` entry its own edit replaced. L2 S3: a pair translation for `en` down a `fallbackChain` does not outrank the `zh-CN` entry (report and widget title), a `zh-TW` pair does not answer a `zh-CN` request over the `zh-CN` entry, and a re-authored plain string still reads the pair along the chain (control). L2 S4: a `zh-CN` request reads a pair row stored under `zh-Hans`, the `zh-Hans` mirror over `zh-CN`, and `ja-JP` over `ja`; the `zh-TW` pin stays the control. 19 cases in the describe. - New `servedLabel.test.ts` (11 cases): show/write rules, the `{ default, zh-CN }` write with the source byte-identical, a map keeps every other language, clears, a second edit. - New `panelBusinessWording-36373.test.tsx` (8 cases), on the HotCRM `opportunity_metrics` shape: the zh panel reads 数据来源 商机指标, 金额 · 合计, 平均赢单概率 · 平均, 分组 阶段, 柱状图 and the served 各阶段商机; a sweep of both panels' visible text finds none of `total_amount`, `avg_probability`, `account_industry`, `opportunity_metrics`, `stage`, `bar`, `RLS`, 维度, 度量, 受治理 (and on the widget `dateRange`, `owner_id`, `lead_source`); machine names are present as `title`; the chart-type options are Chinese names, each with an `svg`; en reads English labels with no machine name; an edit of the served name sends `{ default: SOURCE, 'zh-CN': EDIT }`. The sweep caught the residual report form rows still saying 维度/度量, fixed here. - New `ReportView.headingStaysServed-36373.test.tsx` (3 cases) on the real `ReportView` and `ReportConfigPanel`: heading and subtitle stay served with the editor open; an edited key shows the edit; the panel receives the served/authored pair. - `DashboardView.inPageEdit-36372.test.tsx`: new case, through the real `DashboardView`: the card panel on the dashboard page reads the served title beside the stored one (`Total (served) ← Total (stored)`); ablation (provider value `null`) → that case red, 10 others green. - Moved to the new wording: `ReportDefaultInspector.test.tsx`, `DashboardWidgetInspector.test.tsx`, `datasetPickers.authorText-11161.test.tsx` (restated for #36373), `InterfacesPillar.componentListServedTitles-12688.test.tsx` (the Title box now reads the served title), `InterfacesPillar.heldWidget-11910.test.tsx`, `InterfacesPillar.reportHeld-27785.test.tsx`, `StudioDesignSurface.heldWidgetPublish-11910.test.tsx`. - Ablations (`scripts/ablation-replace.mjs`, restored blob == HEAD each time): precedence reverted (`return false`) → 3 of 24 spec cases red (zh entry, base tag, widget title); `previewWithServedText` replaced by the raw buffer → 2 of 3 heading cases red (the context case is a separate seam). L2 rework: `i18n-resolver.ts` swapped back to `e2d307a1`'s → 4 of 30 red (pair on report, pair on widget, zh-TW over `{ default, zh }`, bare zh over `zh-CN`); restored, 30/30. S3: `i18n-resolver.ts` swapped back to `0df531f9`'s → 3 of 34 red (fallback chain on report and widget, `zh-TW` variant); restored, 34/34. S4: `i18n-resolver.ts` swapped back to `8ad569b7`'s → the S4 case red; restored, 35/35. ## Acceptance notes - **Stored shape.** An edit typed over a translation of a plain-string label stores `{ default: SOURCE, LANG: EDIT }`. Pinned: after a zh edit the English `default` is byte-identical; a third locale (ja) still reads its bundle translation; the precedence between bundle and inline map is named and pinned (below). - **Precedence.** For report `label`/`description` and widget `title`, on an item with a packaged base whose inline entry for the requested locale differs from the base's: 1. a translation the paired `.custom` package ships; 2. the entry; never the base's translation (ruling record 6631250894's order, kept). A map equal to the package's own map changes nothing (control pin); an item with no packaged base reads the bundle as before (control pin). - **Owed, not in this PR (L2 S2).** With no packaged base (a report or dashboard no code package ships), the panel still stores `{ default: SOURCE, LANG: EDIT }`, the server still serves the bundle where it has an entry for that language, and the box shows that translation again after save, with no message. The same holds for an override once the pair carries a translation for that locale. `servedLabel.ts` now states this. Carried by #36481 (write the translation row, or say so in the panel). - **ADR-0149.** Its bundle-wins clause is scoped to dataset members; `translateDataset` is untouched, and a pin shows a dataset member's inline map still loses to the bundle. `check-prior-rulings` over the precedence terms: 0 hits; `docs/adr` has no other ruling on report/widget label precedence. - **Census** of inline locale maps on report `label`/`description` and widget `title`: objectstack `67132dd7` (2 report files, 6 dashboard files) 0; hotcrm `689166c` (5, 7) 0; gallery `782d801` (1, 1) 0. The only map in those files is a dashboard `globalFilters` label in hotcrm `activity.dashboard.ts`, not a covered prop. No packaged source changes reading; the census cannot see override rows stored in a deployment, where a row carrying such a map now reads its own entry in that locale (the change the semantic line names). - **Supersedes on these two panels only:** objectui#11161's `LABEL (name)` and objectui#12303's trailing machine name. Other dataset pickers (the spec-form `ref:dataset` widget, view and page pickers) are unchanged. - **Not changed:** the panels' structure and items; the report `description` field (it stays in the form rows below and edits the authored text); Studio's dataset designer. The en form rows below the curated fields still read the spec's English (`Dataset binding`, "Values are the dataset’s measures…"): the console deliberately carries no `en` overlay, and rewording the spec form ripples into ten generated locale bundles — a follow-up if wanted. The platform's own zh-CN `metadata-forms` bundle (the generic server-rendered form) keeps 数据集/维度/度量 for the same reason. - 「查看明细」 is #36256 and is not rebuilt here. ## Live run (L1-e REWORK) At head `c6ab9f25`, a fresh local backend (`objectstack dev --seed-admin`, file DB, the worktree's CLI and freshly built `@objectstack/spec`) ran HotCRM `689166c` (a scratch copy with `initialStates` added to its twelve state-machine validations, because the current author-time rules refuse the copy without them; no HotCRM file changed). The console ran from this branch's sources (`ui/apps/console` Vite against it), driven by Playwright as the seeded admin in a `zh-CN` and an `en-US` browser. | Acceptance | Reading | |---|---| | Open 各阶段商机, press 编辑: heading and subtitle | Before: 「各阶段商机」 / 「按阶段分组汇总商机」. With the panel open: the same. en: "Opportunities by Stage" / "Summary of opportunities grouped by stage", both states. | | Panel words (zh-CN) | 数据来源 商机指标; 报表从这里取数;每个人只能看到自己有权限的记录。; 指标 总金额 · 合计、平均赢单概率 · 平均; 分组 阶段; 图表类型 柱状图; 横轴(分组)阶段; 纵轴(指标)总金额 · 合计. HotCRM labels the measure 「总金额」, so the panel reads that, not 「金额」. Name box 各阶段商机. | | Forbidden-word sweep of the panel's visible text | zh-CN and en-US: none of `total_amount`, `avg_probability`, `opportunity_metrics`, `stage` (en: as a word), `bar`, `RLS`, 维度, 度量, 受治理. Machine names are on `title` only: `total_amount`, `avg_probability`, `stage`. | | Chart types | zh: 不显示图表(只看表格), 柱状图, 柱形图, 折线图, 面积图, 饼图, 环形图, each chart with its icon. en: No chart (table only), Bar Chart, Column Chart, … | | English | Opportunity Metrics, Total Amount · Sum, Avg Probability · Average, Group by Stage, Bar Chart; no machine name. | | Studio, same report | `/studio/app.objectstack.hotcrm/interfaces?surface=report:opportunities_by_stage`: the same words, name box 各阶段商机, sweep clean (zh and en). | | Studio, same dataset's widget | 销售业绩 (`sales_dashboard`) → 阶段管道分布: 数据 · 数据来源 商机指标, 卡片从这里取数…, 分组 阶段, 指标 总金额 · 合计, 跟着页面顶部的筛选变 with 时间 「默认(预计成交日)」, 销售代表 「默认(负责人)」, 商机类型; title box 阶段管道分布. en: Data source "Opportunity Metrics", "Total Amount · Sum", "Follows the filters at the top of the page", Date / Sales Rep / Deal Type. Sweep clean (also `owner_id`, `close_date`, `dateRange`). | | Untranslated self-built report | A dataset `my_deal_figures` (label 我的成交数据, dimension 销售阶段(自建), measure 合同额) and a report `my_deal_report` (我的成交报表) created over REST in `app.objectstack.hotcrm.custom`, no bundle entries. zh-CN panel: 数据来源 我的成交数据, 指标 合同额 · 合计, 分组 销售阶段(自建); en-US: the same author text with "· Sum". Machine names `contract_value`, `phase` on `title` only. | | Round trip: edit the name in zh-CN, Save, reload | Runtime 「编辑」 → Save on this package report is refused before this PR's code is reached: `PUT /api/v1/meta/report/opportunities_by_stage?mode=draft` → **403 NOT_OVERRIDABLE** ("ships in 'app.objectstack.hotcrm': save it into 'app.objectstack.hotcrm.custom'"); the panel stays open and dirty, as objectui#11583 has it (finding below). So the round trip ran through Studio's 定制: `POST /packages/app.objectstack.hotcrm/ensure-customization` (201), then `PUT …/opportunities_by_stage?mode=draft&package=app.objectstack.hotcrm.custom` with body `"label":{"default":"Opportunities by Stage","zh-CN":"各阶段商机(本公司)"}` and `"overrides":{"package":"app.objectstack.hotcrm","basedOn":"6.5.0"}` (200), then 发布 → `POST /packages/app.objectstack.hotcrm.custom/publish-drafts` (200, 1 published). After a reload: zh-CN heading 「各阶段商机(本公司)」, name box 各阶段商机(本公司); en-US heading and box "Opportunities by Stage"; `GET /meta/report/…?locale=zh-CN` and `?locale=en` serve the stored map `{"default":"Opportunities by Stage","zh-CN":"各阶段商机(本公司)"}`; `?locale=ja-JP` serves the bundle's 「ステージ別商談」. | Findings from the run, not fixed here (for the seat): 1. Runtime 「编辑」 → Save on a report an installed package ships is refused 403 NOT_OVERRIDABLE: `ReportView`'s save names no package and declares no override. Not touched by this diff (the save path is unchanged); #36405 gives the dashboard page this route (ensure door + `overrides`), the report page has none. Carried by #36374 (item 8, 保存后对所有人生效). 2. The report form's 描述 box shows the English source ("Summary of opportunities grouped by stage") while the subtitle beside it reads 「按阶段分组汇总商机」. The card's current-language rule covers the name box; the description stays in the form rows (stated under "Not changed"). Carried by #36374 (item 2, 说明可直接改). 3. Studio's canvas strip reads 「已选中:Pipeline by Stage」 in a zh-CN session (`selection.label` in `StudioDesignSurface`): outside the panels, same class. Carried by #36480. 4. English form rows (Dataset binding, "semantic-layer dataset", dimensions/measures) stay out, per the seat; carried by #36447. ## Verification <details><summary>Tests</summary> Readings at the merged head `20c4ea00` unless named. S4 at `85e6baf9`: spec `vitest run src/system src/ui/i18n-label-resolver.test.ts` 77 files, 2768 passed (`i18n-report.test.ts` 35/35); `tsc` and `eslint` exit 0; `overlap-check` clean. S3 at `8ad569b7`: spec `vitest run src/system src/ui/i18n-label-resolver.test.ts` 77 files, 2767 passed (`i18n-report.test.ts` 34/34); `tsc --noEmit -p packages/spec` exit 0; `eslint` on the two spec files exit 0; `overlap-check` clean against main and #36383. At `0df531f9` (main `8a741abd` with #36405 merged in): `@object-ui/app-shell` `type-check` exit 0 (after rebuilding its dependencies, 68/68 turbo tasks); one locked `vitest run` of 266 app-shell files (every Dashboard*/ReportView*/ReportConfigPanel* view test, every inspector test, the moved Studio tests, the runtime-metadata persistence test): 266 files, 3371 passed, 1 skipped; `check:test-source-alias` OK; core `column-identity.ratchet` 7/7. L2 rework at `c6ab9f25`: spec `vitest run src/system src/ui/i18n-label-resolver.test.ts` 77 files, 2763 passed (`i18n-report.test.ts` 30/30); `tsc --noEmit -p packages/spec` exit 0; `eslint` on the two spec files exit 0. - ui: one locked `vitest run` of 117 files (every app-shell, i18n and console test that names a changed module, the moved tests and the four new files): 117 files, 1141 passed, 7 skipped. - spec: `vitest run src/system/`: 76 files, 2642 passed (`i18n-report.test.ts` 24/24). - `@object-ui/app-shell` `type-check` (`tsc --noEmit` and `tsc -p tsconfig.test.json`): exit 0. - `eslint` on the touched ui files: 0 errors (warnings only in `StudioDesignSurface.tsx`, none on changed lines). - Full `pnpm build --concurrency=2` after the merge: 120/120 tasks. - Ablations: see Tests above. </details> <details><summary>Gates</summary> - `dispatch-gates --commands` at the merged head `20c4ea00`: 112 families. `dispatch-gates --ran` with recorded exit codes: 112 derived, 112 run, 0 NOT-MEASURED, every family exit 0. - The first sweep (pre-merge) found one real red, fixed in this PR: `check:test-source-alias` asked the edited tests that reach `import('@objectstack/lint' | '@objectstack/formula')` to pay that load at collection (module-top side-effect imports). Its other exit-3 rows were prerequisites (a shallow-clone fixture commit; built output), cleared by fetching the fixture and a full `pnpm build --concurrency=2` (120/120 tasks), then green. - `overlap-check`: VERDICT clean exit 0 against `origin/main` `97b9d1e6` and #36383 (shares `i18n-standard.mdx`, merges cleanly). At `c6ab9f25`: clean against `origin/main` `6a35635a` and #36383. At `0df531f9`: clean against `origin/main` `7ae5e074`, #36461 (shares `DashboardView.tsx`, `ReportView.tsx`) and #36383. - CI at the final head `e2d307a1`: 70 check-runs, 61 success and 9 skipped, none failed. The first CI run, at `20c4ea00`, went red on Test UI 9/16. The core `column-identity.ratchet` refused a new `name`/`field` dual read in the widget panel's filter-label lookup (`dimensionLabelOf`), which now reads the dimension's column through `columnIdentity()`. Locally, the ratchet, the five affected ui files (62 tests) and the app-shell type-check pass, and `overlap-check` is clean. - Changed lines vs `origin/main`: under the 3000 threshold (30 files). </details> <details><summary>Screenshots</summary> Live shots (2× scale) from the run below, in the project's shared files under `repo-objectstack-7/card-36373/`; they cannot be uploaded to GitHub from the cloud seat. They replace the harness shots, which are deleted. - `live-report-panel-zh-CN.png`: runtime 「编辑」 on 各阶段商机 after the round trip: heading 「各阶段商机(本公司)」 and subtitle 「按阶段分组汇总商机」 with the panel open, 数据来源 商机指标, 指标 总金额 · 合计 / 平均赢单概率 · 平均, 分组 阶段, 柱状图. - `live-report-panel-en-US.png`: the same report in English: "Opportunities by Stage", Data source "Opportunity Metrics", "Total Amount · Sum", Group by "Stage", "Bar Chart". - `live-report-charttypes-zh-CN.png`: the chart-type list, Chinese names with icons. - `live-studio-report-zh-CN.png`, `live-studio-widget-zh-CN.png`, `live-studio-widget-en-US.png`: Studio's report panel and the 销售业绩 dashboard's 阶段管道分布 widget panel. - `live-selfbuilt-report-panel-zh-CN.png`: an untranslated report created over REST. - `live-roundtrip-publish-dialog.png`: Studio's publish dialog for the customized name. </details> --- 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01QsR2jUP9hxdL4RzdzTs9eK <!-- signed: repo:objectstack#7 · zhuangjianguo · session_01QsR2jUP9hxdL4RzdzTs9eK --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 43580a3 commit 60e79ed

33 files changed

Lines changed: 1747 additions & 231 deletions
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@object-ui/app-shell': patch
4+
'@object-ui/i18n': patch
5+
---
6+
7+
feat(app-shell): the report and dashboard-widget panels speak business wording, and opening the report editor keeps the page in the session's language
8+
9+
Clause-②: yes (widening) — the report and widget panels accept an edit of a translated name or title in the session's language, stored as the inline locale map `{ default: SOURCE, LANG: EDIT }` the spec's `I18nLabel` already allows; nothing is removed or renamed
10+
Metadata-protocol: semantic — `translateReport` and `translateDashboard` now treat a report `label`/`description` or a widget `title` as changed when its inline locale-map entry for the requested locale (the entry the panel writes: exact tag, then the locale's own script, else base tag or a sibling region; never `default`) differs from the packaged base's own, so the base's translation no longer replaces it; a translation the paired `.custom` package ships still answers first (ruling record 6631250894), and with none the entry is served; dataset members (`translateDataset`, ADR-0149) are unchanged
11+
12+
The report editor beside a report (runtime 「编辑」 and Studio) and the dashboard widget property bar (Studio, and the dashboard page's edit state) now name things the way a business reader does:
13+
14+
- Fields, measures and data sources show their labels in the current language; the machine name is on hover only (`title`), never printed. A measure reads `LABEL · AGGREGATE` with the aggregate in words (「金额 · 合计」, "Amount · Sum").
15+
- 「行(维度)」「维度」 read 「分组」, 「值(度量)」 reads 「指标」, 「数据集」 reads 「数据来源」 (its label alone, no `(name)` and no description), and the filter-binding section reads 「跟着页面顶部的筛选变」 with each filter by its name (「时间」 for the date range, the dimension's label for a filter with none).
16+
- The chart-type list is Chinese names with their icons (柱状图, 折线图, …), not `bar`.
17+
- The line under the data source is plain words: 「报表从这里取数;每个人只能看到自己有权限的记录。」 — no 「受治理」 or 「RLS」.
18+
- The report form rows below the curated fields (section headings and hints in zh-CN) use the same wording.
19+
20+
The report's name box and a widget's title box show the served (current-language) text while it is untouched, and an edit lands in the session language only: a plain-string source shown translated becomes `{ default: SOURCE, LANG: EDIT }`, so every other language reads exactly what it read before. For a report or dashboard installed from a package (one with a packaged base), the server serves that entry ahead of the package's translation (a translation the paired customization package ships still comes first), so the edit is what the page shows after save. A report with no packaged base keeps the bundle first: where the bundle has an entry for that language, the stored edit does not show.
21+
22+
Fixed: opening the report editor no longer turns the page heading and subtitle from the served 「各阶段商机」 to the English source. The page draws the served text for every translated key the edit has not touched.
23+
24+
This supersedes objectui#11161's `LABEL (name)` and objectui#12303's trailing machine name on these two panels only; other dataset pickers are unchanged.

‎content/docs/protocol/kernel/i18n-standard.mdx‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,26 @@ its own raw dotted key on screen, in every locale.
287287
For the props that have no bundle key at all, the map is the **only**
288288
localisation route — a document localised that way is fully localised.
289289

290+
**A report's `label` and `description` and a dashboard widget's `title` keep
291+
their map entry over the bundle at the `/meta` boundary** (objectstack#36373).
292+
These props have a bundle key too, so `translateReport` and
293+
`translateDashboard` decide between the two. The map's entry for the requested
294+
locale is the one the panel writes for that locale — the exact tag, then an
295+
entry of the locale's own script where the language splits by script (a
296+
`zh-TW` reader never takes a Simplified `zh` entry), otherwise its base
297+
language or a sibling region; never `default`. When the item has a packaged
298+
base and that entry differs from the base's own, the slot counts as changed,
299+
exactly as a re-authored string does: a translation the paired `.custom`
300+
package ships still answers first, the base's translation never does, and with
301+
no pair translation the entry is served. Otherwise (no packaged base, no
302+
entry, or the same entry) the bundle entry is served as before. A map that repeats the package's own map
303+
therefore still takes a package's translation updates, and a map an admin
304+
edited in one language serves that edit while every other language reads its
305+
bundle text. This is how the report and widget panels store an edit made in a
306+
non-default language: `{ default: SOURCE, 'zh-CN': EDIT }`, the source text
307+
untouched. Dataset members are not covered: `translateDataset` keeps ADR-0149's
308+
bundle-first order.
309+
290310
**A map is never extracted, and no bundle key is synthesised for one.**
291311
`os i18n extract` scaffolds no row for a map and no key family exists for one;
292312
in particular **no key is derived from a node's position in the component

‎content/docs/ui/dashboards.mdx‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -743,9 +743,11 @@ or re-target. `os validate` and the publish door refuse such a key with
743743
absent). A dashboard embedded in a page that declares its own `variables` merges the two
744744
scopes: a filter shadows only an outer variable of the same name, and a write goes to the
745745
scope that defines the variable.
746-
- **Bindings in Studio.** The dashboard widget inspector has a **Dashboard filter bindings**
747-
section, one row per declared filter, with an apply toggle (the `false` opt-out) and a
748-
field picker for the override.
746+
- **Bindings in Studio.** The dashboard widget inspector has a **Follows the filters at the
747+
top of the page** section, one row per declared filter, named by the filter's label (the
748+
date range reads **Date**; a filter with no label reads its dimension's label), with an
749+
apply toggle (the `false` opt-out) and a field picker for the override. The panel names
750+
fields, metrics and data sources by their labels; a machine name shows on hover only.
749751
- **Refresh.** The page header has a **Refresh All** button, and `refreshIntervalSeconds`
750752
re-reads the widgets every that many seconds (`0` or unset: no automatic refresh). Widgets
751753
re-read in place rather than remounting, single-value tiles included.

‎content/docs/ui/reports.mdx‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,25 @@ A `report` entry **without** `reportName` opens the app's report index
305305
open. The console adds no index entry by itself: declare `{ id: 'nav_reports', type:
306306
'report' }` where the menu should carry it.
307307

308+
## Editing a report beside it
309+
310+
An admin opens a report's **Edit** panel from the report page (and the same panel in Studio).
311+
The panel speaks the reader's language rather than the schema's:
312+
313+
- **Data source** is the bound `dataset`, shown by its label; **Metrics** are its `values`,
314+
each read as `LABEL · AGGREGATE` (*Amount · Sum*); **Group by** is its `rows`; a matrix adds
315+
**Group columns by** (`columns`). Fields show their labels; the machine name is on hover only.
316+
- The chart type list shows each type by name with its icon.
317+
- The name box shows the report's name in the current language. An edit made in a
318+
non-default language is stored for that language only, as the inline locale map
319+
`{ default: SOURCE, 'zh-CN': EDIT }`, so every other language reads what it read before.
320+
For a report installed from a package, the server serves that entry ahead of the
321+
package's translation bundle; a report with no packaged base keeps the bundle first, so
322+
where the bundle has an entry for that language the edit does not show
323+
([inline locale maps](/docs/protocol/kernel/i18n-standard#form-2-is-several-locales-text-at-once)).
324+
- The page heading and subtitle stay in the current language while the panel is open; a key
325+
the edit changes shows the edit.
326+
308327
## Permissions and protection
309328

310329
The report schema carries exactly **one** access-shaped block, and it is not about

0 commit comments

Comments
 (0)