Uh oh!
There was an error while loading. Please reload this page.
spec: dashboard widget translation node gains subCaption for the metric sub-caption (#7862) - #8056
Conversation
…ic sub-caption (#7862) The #5428 ruling (2026-08-06, item 4) gives the metric widget's sub-caption (options.description — a different authored field from widget.description) its own translation key. The strict {title?, description?} widget node refused every implementation of that; this adds the optional third member, re-points the subtitle alias at subCaption (leaving it pointing at description kept steering authors to the shared key the ruling forbids), and extends translateDashboard to overlay options.description. Key path: dashboards.<name>.widgets.<widgetId>.subCaption Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0123k4cam2jEAkPmbJeoaY3r
…geset Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0123k4cam2jEAkPmbJeoaY3r
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
📓 Docs Drift CheckThis PR changes 1 package(s): 106 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
⛔ 7 release-owned page(s) also reference the affected code. These are read-only:
|
Uh oh!
There was an error while loading. Please reload this page.
Fixes#7862
What
The #5428 maintainer ruling (2026-08-06, item 4) gives the metric widget's sub-caption (
options.description— a DIFFERENT authored field fromwidget.description) its own translation key, and forbids sharingwidget.description's key (「两个作者字段两个 key」). The strict{ title?, description? }widget translation node refused every implementation of that, and its own hint pointedsubtitleatdescription— precisely the shared key the ruling forbids. This implements option A from the issue (the only ruling-consistent shape; option B is a maintainer-only veto).packages/spec/src/system/translation.zod.ts— the widget node gains an optional third member,subCaption, keyeddashboards.{name}.widgets.{widgetId}.subCaption. Thesubtitlealias is re-pointeddescription→subCaption(on a metric widget, the string an author calls the "subtitle" is the sub-caption under the number; the in-file comment records the objectui: dashboard KPI cards drop the translated widget title/description — the self-containedmetricpath bypassestWidgetTitle, and the plugin's privateresolveLabelnever callst()#5428 rationale). The node stays strict; unknown keys are still refused with substance.packages/spec/src/system/i18n-resolver.ts—translateDashboard(measured: it enumerates node members; wired into the REST/metapath viaMETADATA_DOCUMENT_TRANSLATORS) resolves the new key and overlays the widget'soptions.description, carrying every otheroptionskey through untouched. The two authored fields stay on their own keys:descriptionnever reachesoptions.description,subCaptionnever reacheswidget.description.translation-typegen.ts— measured: object-scoped only (label/pluralLabel/fields/_views), does not enumerate the widget node; no change needed.packages/lint/src/validate-translation-references.ts— measured: validates widget ids only, not member names; no change needed.packages/spec/liveness/translation.json— thedashboardsrow note extended to record the new member and its consumer.@objectstack/specminor (the accept-set only grows; existing bundles unaffected).Not in this PR (dispatch scope)
pages.{name}.components.{id}node is untouched — the objectui: dashboard KPI cards drop the translated widget title/description — the self-containedmetricpath bypassestWidgetTitle, and the plugin's privateresolveLabelnever callst()#5428 ruling covers the dashboard widget node only, and the pages face's own recorded exclusions (subtitlestays page-level) are not disturbed by this change.dashboards.{name}.widgets.{widgetId}.subCaption.content/docs/ui/translations.mdx(hand-written guide) does not yet mention the new key — outside this card's declared file surface; filed as docs: content/docs/ui/translations.mdx does not list the dashboard widget node'ssubCaptionkey (follow-up to #7862) #8052 (sub-issue of spec: the dashboard widget TranslationData node needs a third member for the metric sub-caption — the #5428 ruling's "own key" mandate is unimplementable against the strict{title?, description?}node #7862).Tests
subCaptionaccepted on the widget node; title/description round-trip pinned byte-identical; unknown key still refused naming the surface;subtitlehint asserted to point atsubCaptionand NOT atdescription; near-misssubCaptoingets the edit-distance suggestion.translateDashboard: overlay ontooptions.descriptionwith other options keys carried through; two-fields-two-keys separation asserted both ways; no input mutation; bundle-onlysubCaptioncreates the options bag (mirroring bundle-onlytitle).subCaptionparses green;subtitlerejects red hintingsubCaptionnotdescription; disttranslateDashboardoverlaysoptions.description.@objectstack/specsuite: 381 files / 10095 tests green pre-merge;check:generatedgreen on the merged tree (13 artifacts; docs/authorable-surface genuinely unchanged — the reference docs truncate the widget node's inner shape); typecheck + test-typecheck ratchet green (debt unchanged at the ledger count); post-merge suite re-run result recorded in the dev report.Refs #5428 (the ruling), objectui#4032, objectui#4358.
Generated by Claude Code