This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
Commit 7fed09d
fix(app-shell,components,console): the three remaining select placeholders read their locale key, not a hard-coded English "Select…" (objectui#11252) (#11279)
Fixes #11252
Clause-②: no
## What changed
The last three product selects that fell back to a hard-coded English
`Select…` now read a locale key. No key was added and no dependency edge
was added. The en text is unchanged at all three.
-
`packages/app-shell/src/views/metadata-admin/datasource/DatasourceResourcePage.tsx`:
an `enum` driver-config property with no value (the named producer is
the Turso driver's optional `mode`) shows
`t('engine.form.selectEllipsis', locale)` from Studio's own table, with
`locale` from `useMetadataLocale()`. This is the word `SchemaForm`'s
enum selects and `InspectorComboField` already show. The page imports
`t` from `../i18n.js`, inside the `metadata-admin/` scope that
`check:i18n-keys` classifies as the local table.
- `packages/components/src/custom/config-field-renderer.tsx`: the select
arm's `field.placeholder ?? 'Select…'` is now `field.placeholder ??
t('common.select')`, through a `createSafeTranslation` defaults map
(`common.select` set to `Select…`). This is the path the sibling
`config-panel-renderer.tsx` uses for its footer: a published primitive
with provider-less consumers. The hook sits above the `visibleWhen`
early return. An author-supplied `placeholder` still wins, verbatim.
- `apps/console/src/pages/settings/SettingsField.tsx`: the closed
select's placeholder is `t('common.select', { defaultValue: 'Select…'
})`, with `t` from `useObjectTranslation()`. This is the shape PR
objectui#11250 used for `ScreenView`. It is also the console's
documented idiom for app screens: `SettingsView`'s objectui#4024 comment
records `useObjectTranslation` rather than `createSafeTranslation` for
this directory. It is safe the same way: a provider-less mount answers
the inline en default, never the raw key. `@object-ui/console` already
declares `@object-ui/i18n`.
- `.changeset/11252-select-placeholders-i18n.md`: patch for
`@object-ui/app-shell`, `@object-ui/components` and
`@object-ui/console`.
## Pins
- One per site, each under `zh-CN` and `en`. Each asserts the key's
identity: what the bound instance or the Studio table answers. A guard
proves the zh answer is neither the en word nor the raw key. Each also
has a CONTROL case, where a set value or a declared default renders
instead of the placeholder.
-
`packages/app-shell/src/views/metadata-admin/datasource/DatasourceResourcePage.selectPlaceholderLocale-11252.test.tsx`.
It drives the real page against a faked authenticated fetch that serves
a Turso-shaped catalog: `url`, plus an optional `mode` enum with no
default. It clicks "New datasource" and reads the `mode` trigger.
-
`packages/components/src/__tests__/config-field-select-placeholder-i18n-11252.test.tsx`.
This one also pins that an author-supplied placeholder still wins under
zh-CN.
-
`packages/components/src/__tests__/config-field-select-placeholder-no-provider-11252.test.tsx`
is the provider-less leg of the defaults map. It is its own file because
`createI18n` registers a module-global instance that outlives
`cleanup()`, the convention
`config-panel-footer-no-provider-4750.test.tsx` already follows.
-
`apps/console/src/pages/settings/__tests__/SettingsField.selectPlaceholderLocale-11252.test.tsx`.
- The enumeration pin:
`packages/app-shell/src/__tests__/select-placeholder-literal-11252.test.ts`.
- It walks `packages/` and `apps/`, skipping tests, and parses only
files that contain `Select` followed by an ellipsis (the U+2026 glyph or
three full stops).
- It classifies each string, template and JSX-text token with the
TypeScript AST. Comments are trivia, so prose is never read as code.
- Allowed positions: a locale pack row, a row under a dotted translation
key, and the `defaultValue` of a translation call's options object.
Anything else is an offender.
- Lit control: each offender shape is planted in memory and must be
found by the same classifier. The shapes are a JSX attribute, `??` and
`||` fallbacks, JSX text, a `placeholder:` property (ASCII spelling), a
template, and a pack-shaped row outside the packs. The allowed shapes
and comments must not be flagged.
- Population control: the tree scan must see a pack row, a table row and
an inline default.
## Measurements (the PM's mechanism assumptions, re-measured at
`7d074baae`)
1. **Confirmed.** Hard-coded `Select…` sits at exactly the three sites:
the datasource page's enum `SelectValue`, `ConfigFieldRenderer`'s select
fallback, and `SettingsField`'s closed select. Every other occurrence in
product source is a translation-table row, `ScreenView`'s inline
default, or a comment. The enumeration pin now re-derives this; no count
is copied here.
2. **Confirmed.** `common.select` is defined in all ten built-in packs
(ar, de, en, es, fr, ja, ko, pt, ru, zh). `engine.form.selectEllipsis`
has an en row and a zh row in Studio's table, and
`check:i18n-designer-parity` is green.
3. The dispatch's test lead `packages/components/src/custom/` holds no
test files. The component's pins sit where the package keeps its
config-panel pins, `packages/components/src/__tests__/`.
## Tests (final head `88a1f2d52`)
- Targeted union, run on `88a1f2d52` with `pnpm exec vitest run` (repo
root, verbose): `Test Files 34 passed (34)`, `Tests 629 passed (629)`.
It covered:
- the datasource directory;
- `packages/app-shell/src/__tests__/`, which includes
`spec-symbol-parity`, a reader of the page;
- `scripts/__tests__/spec-symbol-ledger-app-shell-7265.test.ts`;
- `apps/console/src/pages/settings/`;
- the five components `config-panel` / `config-field` pins;
- plugin-dashboard's four `ConfigPanel*` suites, the only in-tree mounts
of `ConfigFieldRenderer` besides `ConfigPanelRenderer`.
- The five new files alone: `Test Files 5 passed (5)`, `Tests 16 passed
(16)`.
- Ablations, each through objectstack's `scripts/ablation-replace.mjs`.
In every case the anchor hit 1→0, the blob moved, and the restore was
proven (`blob == HEAD`, `git diff HEAD` empty). The pins resolve their
subjects through `src/` (vitest alias and relative imports), so no
`dist/` leg applies.
- A1: the datasource literal restored. `2 failed | 14 passed (16)`: the
datasource zh case and the enumeration pin's "finds no offender", which
named that file.
- A2: the `ConfigFieldRenderer` literal restored. `2 failed | 14
passed`: the components zh case and the enumeration pin.
- A3: the `SettingsField` literal restored. `2 failed | 14 passed`: the
settings zh case and the enumeration pin.
- A4: the `common.select` row deleted from the new defaults map. `1
failed | 15 passed`: only the provider-less leg.
- Gate reach: changing the `SettingsField` inline default makes
`check:i18n-keys` exit 1 with `[default-value-drift] common.select` on
`SettingsField.tsx`. Changing the new defaults row makes it exit 1 with
`[factory-default-drift] common.select (FIELD_DEFAULT_TRANSLATIONS)`.
The gate reads both new call sites.
- Build and type-check. `pnpm --workspace-concurrency=2 --filter
'@object-ui/app-shell^...' build` (29 packages) passed. So did app-shell
plus the five remaining plugins of `@object-ui/console^...`. Then `pnpm
--filter PKG type-check` exited 0 for `@object-ui/components`,
`@object-ui/app-shell` and `@object-ui/console`. Each config's resolved
file list contains the new test files: app-shell and components through
`tsconfig.test.json`, console through `tsconfig.json`.
- Gates, all exit 0: `check:i18n-keys`, `check:i18n-drift`,
`check:i18n-dead-keys`, `check:i18n-designer-parity`,
`check:control-bytes`, `check:new-line-citations` (0 new citations),
`check:test-path-roots`, `check:phantom-deps`,
`check-changeset-presence` (8 source files of 3 released packages, 1
changeset).
- `eslint` on the 8 changed ts/tsx files, with the repo config the
package `lint` scripts use: exit 0, 0 errors. The 9 warnings all sit on
lines this branch did not add.
- The changeset is markdown, so `node scripts/markdown-test-inputs.mjs
--audit` was run (exit 0), and so was the root `scripts/__tests__/`
suite on `88a1f2d52`: `177 passed | 2 skipped (179)`, `Tests 5371 passed
| 2 skipped`.
- Declared narrowing: the whole `packages/components/` and
`packages/app-shell/` suites were not run locally. They are CI's. Each
changed product file's in-tree importers were enumerated with `git
grep`, and their suites are in the targeted union above:
- the datasource page is imported only by its `register.ts`;
- `ConfigFieldRenderer` only by `ConfigPanelRenderer`;
- `SettingsField` only by `SettingsView`.
## Acceptance notes
These were observed and not filed. None has a measured public door or a
named producer beyond this card. No carrier is known for any of them
(承接者:无).
- `DatasourceResourcePage` carries other English copy: the driver
select's "Choose a driver", the schema-mode labels, the status chips and
the toasts. That is a page-level family, recorded as the precedent PR
did. This card closes only the `Select…` family.
- The console's `useSettingsLabel` exposes a `fieldPlaceholder` helper
that no arm of `SettingsField` calls, and the console's settings
`Specifier` type declares no `placeholder`. This is dead code, not a
contract gap.
- Studio's zh word for this slot (`engine.form.selectEllipsis`) differs
from the zh pack's `common.select`. Each surface reads its own existing
key, per the triage direction.
Session: `https://claude.ai/code/session_011p7ikEivgXefNDaE5S5Uec`
---
_Generated by [Claude
Code](https://claude.ai/code/session_011p7ikEivgXefNDaE5S5Uec)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent b4333ab commit 7fed09d
9 files changed
Lines changed: 606 additions & 3 deletions
File tree
- .changeset
- apps/console/src/pages/settings
- __tests__
- packages
- app-shell/src
- __tests__
- views/metadata-admin/datasource
- components/src
- __tests__
- custom
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
225 | 226 | | |
226 | 227 | | |
227 | 228 | | |
| 229 | + | |
228 | 230 | | |
229 | 231 | | |
230 | 232 | | |
| |||
452 | 454 | | |
453 | 455 | | |
454 | 456 | | |
455 | | - | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
456 | 461 | | |
457 | 462 | | |
458 | 463 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
0 commit comments