Repository navigation
Commit 13f5466
fix(spec): the dashboard settings hints read in business terms (#36883)
<!-- claude-projects-attribution: {"github_login":"os-support-ai"} -->
_Requested by **Yibo Wang** · [project
thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBP9pYn3ZkhGT2R2hstwEY6w)_
Fixes #36816
Clause-②: no
Metadata-protocol: none
repo:objectstack#3 · os-support-ai · session_01WGufzh1FMUQYf1PcEunaaK
## 维护者速读
-
在工作室打开仪表盘设置面板的搭建者,看到的九条字段提示(名称、显示名称、列数、间距、自动刷新、页眉、组件、日期范围、全局筛选)从开发术语改成了业务说法,英文、中文和其余八种语言同步更新。
- 属于"报表与仪表盘面板说业务话"这项体验工作,是已完成的报表面板改写的仪表盘姊妹篇,替用工作室搭仪表盘的业务管理员解决看不懂开发术语的问题。
- 只改了提示文字,不改任何可保存的设置;出错最多是某句提示读起来别扭,直接撤回即可。
- 无
## What changes
The dashboard authoring form (`packages/spec/src/ui/dashboard.form.ts`)
supplies the hints the Studio dashboard settings panel draws. The route
is the one the seat set for the report panel: English wording at the
producer first, no `en` overlay, and no rename of a section title whose
key is slugged from its label. Nine hints are rewritten in business
terms, with no CSS units, casing jargon or "config".
| Row | Before | After |
|:---|:---|:---|
| Name | snake_case unique identifier | A unique internal name for this
dashboard: lowercase letters, numbers and underscores, starting with a
letter (for example sales_overview). |
| Label | Display name | The title people see for this dashboard. |
| Columns | Grid columns (default 12) | How many columns the widgets are
laid out on, from 1 to 24. Leave it empty and the dashboard picks a
width that fits its widgets. |
| Gap | Space between widgets, in steps of 0.25rem (4 = 1rem) | How much
space to leave between widgets. Larger numbers spread them further
apart; leave it empty for the standard spacing. |
| Refresh Interval Seconds | Auto-refresh (seconds) | How often the
dashboard reloads its data, in seconds. Leave it empty or enter 0 to
turn automatic reloading off. |
| Header | Dashboard header config (title, subtitle, actions) | What
shows at the top of the dashboard: its title, its description and action
buttons. |
| Widgets | Dashboard widgets with position and sizing | The charts,
numbers and tables on this dashboard, and where each one sits. |
| Date Range | Default date range selector | The period the dashboard
opens with, and whether viewers may pick their own dates. |
| Global Filters | Filters applied to all widgets | Filters viewers can
use to narrow every widget at once, or only the widgets you choose. |
The Columns and Gap rows describe what the dashboard renderer really
does with an empty value. An unset `columns` is inferred from the
widgets' widths (4 or 12), not fixed at 12. An unset gap falls back to
the standard 4.
- **Translations.** `node scripts/check-i18n-bundles.mjs --write`
rewrote the `en` leaves and kept every translated value (merge mode).
The nine leaves were then re-translated by hand in all ten translated
locales: zh-CN, zh-Hant, ja-JP, ko, es-ES, fr, de, pt-BR, ru and ar.
This follows the repository's usual rule for changed source text (the
last source-hint change, 9742142, re-translated every locale too). No
`*.source-hashes.generated.ts` moved: these leaves had no provenance
entry.
- **Console zh-CN overlay**
(`ui/packages/app-shell/src/views/metadata-admin/metadata-form-i18n.ts`,
claim amendment 7124829549). The curated dashboard inspector renders
Chinese from this overlay, not from the platform bundle. Its nine
dashboard hints now carry the platform's new zh-CN wording; before, they
still read "snake_case 唯一标识" and "栅格列数(默认 12)". The comment over the gap
row is rewritten to match.
- **The console's "Tailwind units" control**
(`metadata-form-i18n.test.ts`) read the producer's English gap hint and
asserted it still held developer units, so that its zh leg would mean
something. It was built to go red once the spec spoke plainly. Its
English leg is now a fixed literal (the pre-rewrite hint). It then holds
both the producer's English and the zh overlay free of the vocabulary,
and a new case sweeps every dashboard hint in both languages. The
`columns` zh pin moved with its row.
- **Pin.**
`packages/spec/src/ui/dashboard-form-business-wording-36816.test.ts`
names the nine rewritten rows. Each must declare a hint free of
developer vocabulary, and a sweep holds every hint in the form to the
same rule. A control proves the vocabulary test fires on the old hints.
It pins the kind of text, not a sentence.
Unchanged on purpose: section titles and descriptions; field and
repeater-row labels (each row label must equal its schema `title`); the
three header-child hints, which already read as a builder would say
them; and the `DashboardSchema` `.describe()` prose, which is author
documentation outside the panel. The widget panel (studio
`engine.inspector.widget.*`) is out of scope. Left over (slugged section
keys): none — no section title was renamed.
**Contract review.** This PR moves non-test `packages/spec/src` text, so
it owes an **L2 contract review** before landing.
## Tests
<details><summary>spec, platform-objects and console readers: green at
5af304e</summary>
- spec: `pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2
src/ui/ src/kernel/repeater-item-titles.test.ts
src/system/i18n-resolver.test.ts`: Test Files 191 passed (191), Tests
7185 passed (7185). The new pin alone, verbose: 11 passed (11).
- spec `typecheck` plus `check:generated`: exit 0, "All 14 generated
artifacts are up to date" (measured at 2969e9a; the merge of main
touched no spec file of this diff).
- platform-objects: Test Files 125 passed (125), Tests 2126 passed
(2126).
- ui, from `ui/`: metadata-form-i18n, dashboard-schema,
DashboardDefaultInspector*, p1-spec-alignment and
`packages/app-shell/src/preview`: Test Files 56 passed (56), Tests 447
passed (447). Before the console change, the old control failed as
predicted: 1 failed / 78 passed.
- Ablation of the spec pin through `scripts/ablation-replace.mjs`,
putting the old gap hint back (anchor x1 to x0): Tests 2 failed / 9
passed. Restored blob equals HEAD's.
- Ablation of the console sweep, putting "snake_case 唯一标识" back into the
overlay (anchor x1 to x0): Tests 1 failed / 22 passed. Restored blob
equals HEAD's.
- eslint on the two console files: exit 0. Every run above exited 0
under the verify lock, except the two ablation legs, which were meant to
fail.
</details>
## Acceptance notes
- `ui/packages/plugin-dashboard/src/DashboardRenderer.tsx:409` reads
`schema.gap || 4`. An authored gap of 0, which `DashboardSchema.gap`
allows (`.min(0)`), would therefore render as 4 (1rem). This is read
from the code, not measured through a public door. The new Gap hint
deliberately does not promise that 0 means no space.
- `DashboardSchema.columns` says "(default 12)", but the renderer infers
4 or 12 from the widgets' widths when columns is unset
(`DashboardRenderer.tsx:391-406`). The new Columns hint describes the
inferred behaviour; the describe prose is unchanged.
- The old developer phrasing remains in the `DashboardSchema`
`.describe()` prose (`dashboard.zod.ts` gap and header) and in its
mirror in `packages/cli/src/commands/explain.ts:293`. That is author
documentation, outside the panel and outside this card's surface.
- Open PRs #36879, #36872 and #36802 regenerate the same platform
bundles. The files are `merge=os-regen`, so whichever lands second
regenerates; `overlap-check` reports a clean merge with all three today.
## Verification
First read, by risk:
`packages/platform-objects/src/apps/translations/*.metadata-forms.generated.ts`
(the ten hand-translated sets of nine leaves);
`ui/packages/app-shell/src/views/metadata-admin/metadata-form-i18n.test.ts`
(the reworked control and the new sweep);
`packages/spec/src/ui/dashboard.form.ts` (the nine hints).
Two-minute check: open a dashboard in Studio with the console in English
and open its settings. The Layout rows should read "How many columns the
widgets are laid out on…", "How much space to leave between widgets…"
and "How often the dashboard reloads its data…". Switch to Chinese and
the same rows read 组件排布所用的列数… / 组件之间留出的空间… / 仪表盘重新加载数据的频率(秒)….
---
_Generated by [Claude
Code](https://claude.ai/code/session_01WGufzh1FMUQYf1PcEunaaK)_
<!-- signed: repo:objectstack#3 · os-support-ai ·
session_01WGufzh1FMUQYf1PcEunaaK -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 4f7d6f7 commit 13f5466
16 files changed
Lines changed: 268 additions & 141 deletions
File tree
- .changeset
- packages
- platform-objects/src/apps/translations
- spec/src/ui
- ui/packages/app-shell/src/views/metadata-admin
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1626 | 1626 | | |
1627 | 1627 | | |
1628 | 1628 | | |
1629 | | - | |
| 1629 | + | |
1630 | 1630 | | |
1631 | 1631 | | |
1632 | 1632 | | |
1633 | | - | |
| 1633 | + | |
1634 | 1634 | | |
1635 | 1635 | | |
1636 | 1636 | | |
1637 | 1637 | | |
1638 | 1638 | | |
1639 | 1639 | | |
1640 | | - | |
| 1640 | + | |
1641 | 1641 | | |
1642 | 1642 | | |
1643 | 1643 | | |
1644 | | - | |
| 1644 | + | |
1645 | 1645 | | |
1646 | 1646 | | |
1647 | 1647 | | |
1648 | | - | |
| 1648 | + | |
1649 | 1649 | | |
1650 | 1650 | | |
1651 | 1651 | | |
1652 | | - | |
| 1652 | + | |
1653 | 1653 | | |
1654 | 1654 | | |
1655 | 1655 | | |
| |||
1677 | 1677 | | |
1678 | 1678 | | |
1679 | 1679 | | |
1680 | | - | |
| 1680 | + | |
1681 | 1681 | | |
1682 | 1682 | | |
1683 | 1683 | | |
| |||
1732 | 1732 | | |
1733 | 1733 | | |
1734 | 1734 | | |
1735 | | - | |
| 1735 | + | |
1736 | 1736 | | |
1737 | 1737 | | |
1738 | 1738 | | |
1739 | | - | |
| 1739 | + | |
1740 | 1740 | | |
1741 | 1741 | | |
1742 | 1742 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1626 | 1626 | | |
1627 | 1627 | | |
1628 | 1628 | | |
1629 | | - | |
| 1629 | + | |
1630 | 1630 | | |
1631 | 1631 | | |
1632 | 1632 | | |
1633 | | - | |
| 1633 | + | |
1634 | 1634 | | |
1635 | 1635 | | |
1636 | 1636 | | |
1637 | 1637 | | |
1638 | 1638 | | |
1639 | 1639 | | |
1640 | | - | |
| 1640 | + | |
1641 | 1641 | | |
1642 | 1642 | | |
1643 | 1643 | | |
1644 | | - | |
| 1644 | + | |
1645 | 1645 | | |
1646 | 1646 | | |
1647 | 1647 | | |
1648 | | - | |
| 1648 | + | |
1649 | 1649 | | |
1650 | 1650 | | |
1651 | 1651 | | |
1652 | | - | |
| 1652 | + | |
1653 | 1653 | | |
1654 | 1654 | | |
1655 | 1655 | | |
| |||
1677 | 1677 | | |
1678 | 1678 | | |
1679 | 1679 | | |
1680 | | - | |
| 1680 | + | |
1681 | 1681 | | |
1682 | 1682 | | |
1683 | 1683 | | |
| |||
1732 | 1732 | | |
1733 | 1733 | | |
1734 | 1734 | | |
1735 | | - | |
| 1735 | + | |
1736 | 1736 | | |
1737 | 1737 | | |
1738 | 1738 | | |
1739 | | - | |
| 1739 | + | |
1740 | 1740 | | |
1741 | 1741 | | |
1742 | 1742 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1626 | 1626 | | |
1627 | 1627 | | |
1628 | 1628 | | |
1629 | | - | |
| 1629 | + | |
1630 | 1630 | | |
1631 | 1631 | | |
1632 | 1632 | | |
1633 | | - | |
| 1633 | + | |
1634 | 1634 | | |
1635 | 1635 | | |
1636 | 1636 | | |
1637 | 1637 | | |
1638 | 1638 | | |
1639 | 1639 | | |
1640 | | - | |
| 1640 | + | |
1641 | 1641 | | |
1642 | 1642 | | |
1643 | 1643 | | |
1644 | | - | |
| 1644 | + | |
1645 | 1645 | | |
1646 | 1646 | | |
1647 | 1647 | | |
1648 | | - | |
| 1648 | + | |
1649 | 1649 | | |
1650 | 1650 | | |
1651 | 1651 | | |
1652 | | - | |
| 1652 | + | |
1653 | 1653 | | |
1654 | 1654 | | |
1655 | 1655 | | |
| |||
1677 | 1677 | | |
1678 | 1678 | | |
1679 | 1679 | | |
1680 | | - | |
| 1680 | + | |
1681 | 1681 | | |
1682 | 1682 | | |
1683 | 1683 | | |
| |||
1732 | 1732 | | |
1733 | 1733 | | |
1734 | 1734 | | |
1735 | | - | |
| 1735 | + | |
1736 | 1736 | | |
1737 | 1737 | | |
1738 | 1738 | | |
1739 | | - | |
| 1739 | + | |
1740 | 1740 | | |
1741 | 1741 | | |
1742 | 1742 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1626 | 1626 | | |
1627 | 1627 | | |
1628 | 1628 | | |
1629 | | - | |
| 1629 | + | |
1630 | 1630 | | |
1631 | 1631 | | |
1632 | 1632 | | |
1633 | | - | |
| 1633 | + | |
1634 | 1634 | | |
1635 | 1635 | | |
1636 | 1636 | | |
1637 | 1637 | | |
1638 | 1638 | | |
1639 | 1639 | | |
1640 | | - | |
| 1640 | + | |
1641 | 1641 | | |
1642 | 1642 | | |
1643 | 1643 | | |
1644 | | - | |
| 1644 | + | |
1645 | 1645 | | |
1646 | 1646 | | |
1647 | 1647 | | |
1648 | | - | |
| 1648 | + | |
1649 | 1649 | | |
1650 | 1650 | | |
1651 | 1651 | | |
1652 | | - | |
| 1652 | + | |
1653 | 1653 | | |
1654 | 1654 | | |
1655 | 1655 | | |
| |||
1677 | 1677 | | |
1678 | 1678 | | |
1679 | 1679 | | |
1680 | | - | |
| 1680 | + | |
1681 | 1681 | | |
1682 | 1682 | | |
1683 | 1683 | | |
| |||
1732 | 1732 | | |
1733 | 1733 | | |
1734 | 1734 | | |
1735 | | - | |
| 1735 | + | |
1736 | 1736 | | |
1737 | 1737 | | |
1738 | 1738 | | |
1739 | | - | |
| 1739 | + | |
1740 | 1740 | | |
1741 | 1741 | | |
1742 | 1742 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1626 | 1626 | | |
1627 | 1627 | | |
1628 | 1628 | | |
1629 | | - | |
| 1629 | + | |
1630 | 1630 | | |
1631 | 1631 | | |
1632 | 1632 | | |
1633 | | - | |
| 1633 | + | |
1634 | 1634 | | |
1635 | 1635 | | |
1636 | 1636 | | |
1637 | 1637 | | |
1638 | 1638 | | |
1639 | 1639 | | |
1640 | | - | |
| 1640 | + | |
1641 | 1641 | | |
1642 | 1642 | | |
1643 | 1643 | | |
1644 | | - | |
| 1644 | + | |
1645 | 1645 | | |
1646 | 1646 | | |
1647 | 1647 | | |
1648 | | - | |
| 1648 | + | |
1649 | 1649 | | |
1650 | 1650 | | |
1651 | 1651 | | |
1652 | | - | |
| 1652 | + | |
1653 | 1653 | | |
1654 | 1654 | | |
1655 | 1655 | | |
| |||
1677 | 1677 | | |
1678 | 1678 | | |
1679 | 1679 | | |
1680 | | - | |
| 1680 | + | |
1681 | 1681 | | |
1682 | 1682 | | |
1683 | 1683 | | |
| |||
1732 | 1732 | | |
1733 | 1733 | | |
1734 | 1734 | | |
1735 | | - | |
| 1735 | + | |
1736 | 1736 | | |
1737 | 1737 | | |
1738 | 1738 | | |
1739 | | - | |
| 1739 | + | |
1740 | 1740 | | |
1741 | 1741 | | |
1742 | 1742 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1626 | 1626 | | |
1627 | 1627 | | |
1628 | 1628 | | |
1629 | | - | |
| 1629 | + | |
1630 | 1630 | | |
1631 | 1631 | | |
1632 | 1632 | | |
1633 | | - | |
| 1633 | + | |
1634 | 1634 | | |
1635 | 1635 | | |
1636 | 1636 | | |
1637 | 1637 | | |
1638 | 1638 | | |
1639 | 1639 | | |
1640 | | - | |
| 1640 | + | |
1641 | 1641 | | |
1642 | 1642 | | |
1643 | 1643 | | |
1644 | | - | |
| 1644 | + | |
1645 | 1645 | | |
1646 | 1646 | | |
1647 | 1647 | | |
1648 | | - | |
| 1648 | + | |
1649 | 1649 | | |
1650 | 1650 | | |
1651 | 1651 | | |
1652 | | - | |
| 1652 | + | |
1653 | 1653 | | |
1654 | 1654 | | |
1655 | 1655 | | |
| |||
1677 | 1677 | | |
1678 | 1678 | | |
1679 | 1679 | | |
1680 | | - | |
| 1680 | + | |
1681 | 1681 | | |
1682 | 1682 | | |
1683 | 1683 | | |
| |||
1732 | 1732 | | |
1733 | 1733 | | |
1734 | 1734 | | |
1735 | | - | |
| 1735 | + | |
1736 | 1736 | | |
1737 | 1737 | | |
1738 | 1738 | | |
1739 | | - | |
| 1739 | + | |
1740 | 1740 | | |
1741 | 1741 | | |
1742 | 1742 | | |
| |||
0 commit comments