This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
refactor(i18n): retire the dead dashboard.noRows and dashboard.noDataAvailable keys - #7573
Merged
Merged
Conversation
…ataAvailable` keys objectui#7063 routed the three dashboard empty-state renders (DatasetWidget, ObjectDataTable, PivotTable) through one shared `WidgetEmptyState`, which resolves its own copy from `dashboard.empty.*`. The two keys the old per-widget placeholders used outlived their call sites in all ten locale packs — 20 entries. Re-measured on this branch rather than inherited from the card, and by FULLY QUALIFIED key: zero `t()`/`tt()` call sites for either, no dynamic `dashboard.` head a substitution could resolve onto them, and every surviving textual occurrence under `packages/` is a comment recording the consolidation. The same query shape returns live call sites for the lit controls `dashboard.empty.title` and `dashboard.total`, so the zero is a measurement rather than a broken query. `check:i18n-keys` stays green across the deletion with the en pack going 2,964 -> 2,962 keys and every in-scope call-site key still resolving. Not touched: `table.noRows` and `engine.form.noRows` — two different, same-named keys in other namespaces — nor the comments in the dashboard widgets that record why three strings became one shared empty state. The packs' own comment keeps that rationale and now names the retirement instead of a row that is gone. The pin follows the five prior retirements (objectui#4145, objectui#4392, objectui#4730, objectui#5504, objectui#6310): every i18n gate here runs call site -> key, so none of them can see a dead key come BACK into the packs. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EMrWaQw3XS5DxTHxp4yRyC
Contributor
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #7125
Clause-②: no — argued from this diff below, not adopted. One measured fact cuts the other way and is stated there rather than omitted.
Two rows removed from each of the ten locale packs (20 entries), plus the retirement pin and a changeset.
packages/i18n/src/locales/*only; no widget, no call site, no comment outside the packs was touched.The gate that owns "all ten packs move together"
packages/i18n/src/__tests__/all-locales-key-parity.test.ts— every pack defines everyenkey and no pack defines a keyenlacks. Found before editing, named here, run after, and shown discriminating below.en-zh-key-parity.test.tsis the second, narrower one; both are green.Deadness re-measured on this branch, by fully-qualified key, with lit controls
Triage's zero was not adopted. Three independent instruments, each with a control so a zero reads as a measurement:
packages/+apps/+scripts/, locale packs excluded.dashboard.noRows→ 4 hits,dashboard.noDataAvailable→ 6 hits, and every one is a comment (WidgetEmptyState.tsx:19,25,26,DatasetWidget.tsx:731,ObjectDataTable.tsx:619,969,PivotTable.tsx:306, and the Dashboard/analytics widgets render a bare 「暂无数据行」 that is indistinguishable from a load failure — make the DEFAULT empty state self-explaining, platform-wide #7063 pin test's docblock). Lit controls in the same query shape:dashboard.empty.title→ 2 livett()call sites,dashboard.total→ 3. The query finds live call sites when they exist.pnpm check:i18n-keys(the repo's AST call-site gate) stays green across the deletion, with theenpack going 2,964 → 2,962 keys and "every in-scope call-site key resolves against the en pack". A livet()asking for either key would land red here.scripts/check-i18n-dead-keys.mjs(the reverse sweep) listed both as candidates before and lists neither after; thedashboardnamespace goes 4-confirmed/3-needs-review → 4-confirmed/1-needs-review. The lit controls never appear in its candidate list at all.Also checked, because a fully-qualified sweep alone can miss them: no i18next
keyPrefix/ namespaceduseTranslation('ns')call sites exist in this repo (so no bare-name resolution channel), and the onlydashboard.${...}template in the tree is an assertion message in a test, not a key. The package's one dynamic key family isdashboard.trend., whose prefix covers neither key.Deleted by fully-qualified key, never by bare name
Three keys in this repo are spelled
noRows. The deletion was done positionally — inside each pack'sdashboard: {block, asserted to be exactly one block with exactly one matching row per key — so the other two are untouched and are now pinned as untouched:table.noRows(en.ts:396)dashboard.noRowsengine.form.noRows(app-shell/.../metadata-admin/i18n.ts, read atwidgets.tsx)The rationale stayed; only the keys went
WidgetEmptyState.tsx:19-26and the comments inDatasetWidget.tsx,ObjectDataTable.tsxandPivotTable.tsxare not in this diff.The one comment that is edited is the packs' own #7063 block, which said "
noRowsabove is the terse fragment it replaces" — a sentence that points at a row this PR removes. It keeps every clause of its rationale and now names the retirement instead of a row that is gone. Byte-identical in all ten packs before and after.The pin, and why a green parity gate is not enough
packages/i18n/src/__tests__/dashboard-emptyState-keys-retired-7125.test.ts— sixth in the retirement-pin series (#4145, #4392, #4730, #5504, #6310), same shape. Every i18n gate in this repo runs call site → key, so none of them can see a dead key come back: the reverse sweep is report-only by design,check:i18n-driftfires only when a value changes, and ten packs agreeing on a dead key is exactly what the parity gate wants.Verification
Union re-run after the final commit, on
2b343c226:pnpm exec vitest run packages/i18n/ packages/plugin-dashboard/→Test Files 150 passed (150)/Tests 1781 passed (1781), exit 0pnpm check:i18n-keys→ exit 0, "Every in-scope call-site key resolves against the en pack (2962 keys) …"pnpm check:i18n-drift→ exit 0, "0 en value(s) changed (0 key(s) added, 2 removed — those are all-locales-key-parity's)"node scripts/check-changeset-presence.mjs→ exit 0, "11 source file(s) of 1 released package(s) changed, and this change declares 1 changeset(s)"node scripts/check-changeset-no-major.mjs→ exit 0, "No changeset declares amajorbump"node scripts/check-control-bytes.mjs→ exit 0, "scanned 6240 tracked text file(s)"pnpm --filter @object-ui/i18n run type-check→ exit 0 (both legs;tsc -p tsconfig.test.json --listFilesconfirms the new test file is IN that project, so the green covers it)pnpm --filter @object-ui/i18n run lint→ exit 0, 33 pre-existing warnings, none in a file this PR touchesExit codes were captured by redirect-then-read, never through a pipe.
The parity gate shown discriminating, and the pin shown to catch what it cannot
Run from the committed implementation, restore under
trap ... EXIT INT TERMwith absolute paths viagit checkout HEAD -- ABSOLUTE_PATH, each mutation proven on disk before any result was read.Leg 1 — nine packs deleted,
deleft behind (the failure mode the card warns about). Mutation proven byde.tsblob equal to the base blobe063401cd…. Result: exit 1,— red, naming the tenth pack, plus the pin red on
de :: dashboard.noRows/de :: dashboard.noDataAvailable.Leg 2 — the deletion fully reverted in all ten packs. Parity:
Test Files 1 passed (1)/Tests 32 passed (32)— green, because ten packs agreeing on a dead key satisfies it. Pin: exit 1, red, naming all 20 pack::key pairs. That contrast is the whole reason the pin exists.Both legs restored and proven by state:
git diff HEADempty and all ten pack blobs equal to their HEAD blobs (an empty hash would have been read as failure, not as "nothing to compare").One honest correction: leg 1's on-disk probe printed
3where the script's inline annotation said "expect 2" — the regex^ (noRows|noDataAvailable):also matchestable.noRowsin the same file, which is the very key this PR keeps. The mutation itself is proven by the blob hash and by the parity failure naming exactly the twodashboard.*keys; the annotation was wrong, not the leg.Clause-②: no
The removal moves no accept/reject behaviour on any contract, and it is not on a governed surface:
GOVERNED_SURFACESinscripts/check-governed-queue-guard.mjsisdocs/adr/,.claude/,skills/, none of which this diff touches, and the changeset gate reports "0 of them a manifest whose published contract moved". No signature changes:I18nConfig.resourcesisRecord<string, Record<string, unknown>>andt/tt/useSafeTranslatetakekey: string, so nothing accepts or rejects on the pack's member set. Five prior retirements of exactly this shape shipped aspatchon@object-ui/i18nwith a pin test and no contract review.The fact that cuts the other way, stated rather than omitted:
TranslationKeys = typeof enis exported from@object-ui/i18nand re-exported by@object-ui/react, so the removal does narrow a published structural type. Measured withtsc, not asserted — reading the retired member now fails, and the surviving control compiles:I still read that as
no: the narrowed thing is a snapshot type of a data catalogue that no API consumes as a constraint — its six occurrences in this repo are import/export lines only — and a review commissioned on it would have no design question to answer. If the maintainer reads a shipped catalogue entry as contract surface regardless of whether anything constrains on it, the datum above is the one to overrule me with, andneeds:contract-reviewbelongs on this PR.Narrowings declared
packages/i18n/+packages/plugin-dashboard/, not the whole farm. Could have caught: a test in another package asserting a retired value, or type-depending on the removed members. Why the subset still covers it: the repo-wide AST gate (check:i18n-keys) is green over all ofpackages/+apps/; a repo-wide text sweep for the retired values outside the packs returns only comments plus one hardcodedtitle="No rows"prop in an app-shell preview that never reads the pack; andplugin-dashboardis the only runtime consumer ofdashboard.*— its one assertion on the old copy is a negative one (not.toContain('暂无数据行')), which deletion can only strengthen. CI runs the full farm regardless.packages/i18n. That package owns every changed file, so this is the exact per-package command turbo runs for them. It could not catch a rule violation raised in another package by this change — none is possible: no exported symbol, import or call site moved.@object-ui/i18n(both legs). Downstream type-check not run locally; the probe above is the direct measurement of the only cross-package type surface involved, andTranslationKeysis a constraint nowhere.check:eager-closurenot run. It needs a fullapps/consolevite build to producedist/eager-closure.json. Direction argument: this diff only removes catalogue entries, so the measuredi18n-localesbytes move DOWN, away from the ceiling; at the script's own ~147 gzipped bytes per short key across ten packs, ~294 bytes against 8,924 of recorded headroom moves the blind-gauge ratio by ~0.003x from 0.10x, nowhere near the 1.00x that errors. CI runs it.🤖 Generated with Claude Code
https://claude.ai/code/session_01EMrWaQw3XS5DxTHxp4yRyC
Generated by Claude Code