Repository navigation
test(i18n): give the studio zh-only key families one home - #27289
Merged
Merged
Conversation
The studio namespace pin and the app-shell ZH_ONLY_REASONS pin each held their own copy of the three zh-only prefixes. The list now lives in an i18n test-support module that the namespace pin reads, and the app-shell pin asserts its reason prefixes equal it, so neither list can widen alone. Claude-Session: https://claude.ai/code/session_01JQwxban7wCJnPiiSY4ULYz Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
Author
席位核对ACCEPT · seat 席位意见:studio 命名空间的 zh-only 键族列表现在只有一个家(i18n 包的测试辅助模块),i18n 那边的测试直接读它,app-shell 那边的测试断言
Generated by Claude Code |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Requested by Warren · project thread
Fixes #27250
Clause-②: no
Metadata-protocol: none
维护者速读
ui/packages/app-shell/src/views/metadata-admin/inspectors/inspectorStrings.studioNamespace-25922.test.ts新增的相等断言;ui/packages/i18n/src/__tests__/studio-zh-only-families.ts;ui/packages/i18n/src/__tests__/studio-namespace.test.ts。pnpm --dir ui exec vitest run packages/i18n/src/__tests__/studio-namespace.test.ts packages/app-shell/src/views/metadata-admin/inspectors/inspectorStrings.studioNamespace-25922.test.ts,应看到两个文件全绿;在任一清单里多加一个前缀,应只有「a reason is given for exactly the families the i18n pin allows」这一条变红。What changes
ui/packages/i18n/src/__tests__/studio-zh-only-families.tsexportsSTUDIO_ZH_ONLY_FAMILIES, the three zh-only prefixes (engine.flowNode.,engine.enum.type.,engine.packages.form.help.). It sits under__tests__/, which the package'stsconfig.jsonexcludes, so it is not indistand nothing is added to@object-ui/i18n's exports map.studio-namespace.test.tsdrops its localZH_ONLY_FAMILIESliteral and reads the module.inspectorStrings.studioNamespace-25922.test.tsimports the module by relative path (the dependency direction stays app-shell → i18n) and adds one case, "a reason is given for exactly the families the i18n pin allows", asserting the sortedZH_ONLY_REASONSprefixes equal the sorted list. The reasons and citation anchors stay in app-shell, beside the files they cite.Why
After the designer-table parity gate retired, the zh-only family list had two homes and nothing held them equal (triage's contract review of PR #27136). Route taken: one list on the i18n side plus an equality assertion, the dispatch's first option. Deriving
ZH_ONLY_REASONSfrom the i18n list is not possible, because its reasons and anchors are app-shell facts.Tests
Test Files 2 passed (2),Tests 201 passed (201)(the new case is the 201st).scripts/ablation-replace.mjs, each with on-disk anchor counts and blob hashes, restored after:STUDIO_ZH_ONLY_FAMILIESonly: red,Tests 1 failed | 200 passed (201), the one failure being the new equality case.ZH_ONLY_REASONSonly (with a valid citation anchor): red,Tests 1 failed | 201 passed (202), again only the new equality case.git diff HEADis empty and both files' blobs equal theirHEADblobs.Acceptance notes
ZH_ONLY_FLOORin the app-shell pin keys its floors by a coarser prefix,engine.enum.rather thanengine.enum.type.. It holds counts, not the allowed set, so it is outside this card; noted only.skip-changeset).Verification
Local readings on head
37238cc1(merge base1e8e5296). Exit codes captured before any pipe; CI owns every other family.24 derived gate families: 24 run, all exit 0;
dispatch-gates --ranreconciles 24/24, 0 NOT-MEASUREDOwed beyond the derived list: both package type-checks (each compiles its tests through
tsconfig.test.json, so the cross-package import is type-checked) and the line-citation checkcheck:new-line-citationsprinted0 new citation(s).dispatch-gates --tieron this surface: no path-derived mandate (TIER_DEFAULT). Changed lines 34 (+26 / -8).Human Minimum
packages/specholds no runtime logic. (not touched)pnpm lintpasses. (lint is CI's run)main, one pull request.packages/spectouched: n/a.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code