|
50 | 50 | * |
51 | 51 | * #3913 stopped at labels, so the hints under them stayed English: 「图标」 over |
52 | 52 | * a box reading `lucide icon name`. The column joins the walk above as a fifth |
53 | | - * family, with the SAME positional derivation — but only for the 8 placeholders |
| 53 | + * family, with the SAME positional derivation — but only for the 7 placeholders |
54 | 54 | * that are prose. The other 10 are example VALUES (`20`, `https://…`, a JSON |
55 | 55 | * sample) and are `{ literal: … }` in `block-config.ts`, never keys: translating |
56 | 56 | * them would corrupt the thing the author is being told to type. |
@@ -178,12 +178,13 @@ describe('block-config labels are translation keys (#3913)', () => { |
178 | 178 | expect(families.field).toBeGreaterThan(80); |
179 | 179 | expect(families.add).toBe(5); |
180 | 180 | expect(families.option).toBeGreaterThan(50); |
181 | | - // Exact, like `add`: the keyed half of the placeholder column is 8 of 18 |
182 | | - // (#3979). A 9th prose placeholder should fail here and be translated; a |
183 | | - // 9th VALUE placeholder does not reach this family at all and is caught by |
184 | | - // the literal inventory instead. Either way the new one gets classified |
185 | | - // rather than defaulting to English-on-screen. |
186 | | - expect(families.placeholder).toBe(8); |
| 181 | + // Exact, like `add`: the keyed half of the placeholder column is 7 of 17 |
| 182 | + // (#3979; 8 of 18 until objectui#3829 retired the canonical |
| 183 | + // `page:header.icon` field). An 8th prose placeholder should fail here and |
| 184 | + // be translated; an 8th VALUE placeholder does not reach this family at all |
| 185 | + // and is caught by the literal inventory instead. Either way the new one |
| 186 | + // gets classified rather than defaulting to English-on-screen. |
| 187 | + expect(families.placeholder).toBe(7); |
187 | 188 | }); |
188 | 189 |
|
189 | 190 | it('stores exactly the key its position implies', () => { |
@@ -297,16 +298,24 @@ describe('en-US labels are unchanged by the key migration (#3913)', () => { |
297 | 298 | 'engine.inspector.pageBlock.option.location.record_more': 'Record more menu', |
298 | 299 | 'engine.inspector.pageBlock.option.severity.warning': 'Warning', |
299 | 300 | // ── the placeholder family (#3979) ─────────────────────────────────────── |
300 | | - // ALL EIGHT, not a sample: this column was migrated by hand rather than |
| 301 | + // ALL SEVEN, not a sample: this column was migrated by hand rather than |
301 | 302 | // mechanically, and the en side is the only thing standing between "the key |
302 | 303 | // resolves" and "the key resolves to what the box used to say". Each value |
303 | 304 | // below is byte-identical to the literal `block-config.ts` held at |
304 | 305 | // `origin/main` 6bd6a4d76 — including the U+2026 ellipsis in `Text…`, which |
305 | 306 | // a re-typed `...` would silently replace. |
| 307 | + // |
| 308 | + // It was EIGHT until objectui#3829: `…placeholder.page:header.icon` went |
| 309 | + // with the canonical `page:header` icon field, retired upstream by |
| 310 | + // objectstack#6946 / PR objectstack#7115. Dropping the sample row is the |
| 311 | + // right move rather than keeping it as a "still translated" check — the key |
| 312 | + // is gone from both locale tables, so `t()` now returns it unchanged and an |
| 313 | + // assertion here would be pinning the passthrough against itself. The |
| 314 | + // deliberate absence is pinned in `block-config.test.ts` instead, where the |
| 315 | + // field's absence is pinned beside it. |
306 | 316 | 'engine.inspector.pageBlock.placeholder.object-metric.icon': 'lucide icon name', |
307 | 317 | 'engine.inspector.pageBlock.placeholder.element:text.content': 'Text…', |
308 | 318 | 'engine.inspector.pageBlock.placeholder.element:button.icon': 'lucide icon name', |
309 | | - 'engine.inspector.pageBlock.placeholder.page:header.icon': 'lucide icon name', |
310 | 319 | 'engine.inspector.pageBlock.placeholder.record:details.sections.name': 'snake_case, e.g. contact_info', |
311 | 320 | 'engine.inspector.pageBlock.placeholder.record:alert.icon': 'lucide icon name', |
312 | 321 | 'engine.inspector.pageBlock.placeholder.record:quick_actions.actionNames': 'action name', |
@@ -363,11 +372,16 @@ describe('placeholders that must NOT be translated (#3979)', () => { |
363 | 372 | 'record:details.sections.columns': { literal: '2', because: 'a column count' }, |
364 | 373 | }; |
365 | 374 |
|
366 | | - it('collects all 18 placeholders — 8 keyed, 10 literal', () => { |
| 375 | + it('collects all 17 placeholders — 7 keyed, 10 literal', () => { |
367 | 376 | // Guards the walk: if placeholder collection silently found nothing, every |
368 | 377 | // assertion here would pass over an empty list. |
369 | | - expect(PLACEHOLDERS.length).toBe(18); |
370 | | - expect(PLACEHOLDERS.filter((p) => p.spec.key !== undefined).length).toBe(8); |
| 378 | + // |
| 379 | + // 18 / 8 / 10 until objectui#3829: the canonical `page:header` icon box was |
| 380 | + // a KEYED placeholder, and it went with the field when objectstack#6946 / |
| 381 | + // PR objectstack#7115 retired `PageHeaderProps.icon`. The literal half is |
| 382 | + // untouched, which is what this split says. |
| 383 | + expect(PLACEHOLDERS.length).toBe(17); |
| 384 | + expect(PLACEHOLDERS.filter((p) => p.spec.key !== undefined).length).toBe(7); |
371 | 385 | expect(PLACEHOLDERS.filter((p) => p.spec.literal !== undefined).length).toBe(10); |
372 | 386 | }); |
373 | 387 |
|
|
0 commit comments