|
36 | 36 | * - `location` / `geolocation` (and `json` / `object` / `composite` / |
37 | 37 | * `record`) print the `{}` literal behind objectui#8481's DECLARED |
38 | 38 | * json-literal fence. Left alone deliberately; pinned unchanged. |
39 | | - * - `date` still draws `formatDate`'s hand-rolled em-dash with no accessible |
40 | | - * name — objectui#8581's subject, the same renderer. This change does not |
41 | | - * touch it, and `THE CENSUS` pins that it did not: the row is recorded as |
42 | | - * a dash that is NOT the affordance, so a fix landing on it here would |
43 | | - * have to move a pin rather than pass silently. |
| 39 | + * - `date` drew `formatDate`'s hand-rolled em-dash with no accessible name |
| 40 | + * — objectui#8581's subject, the same renderer. This change did not touch |
| 41 | + * it, and `THE CENSUS` pinned that it did not: the row was recorded as a |
| 42 | + * dash that is NOT the affordance, so a fix landing on it here would have |
| 43 | + * to move a pin rather than pass silently. It did: objectui#8581 landed, |
| 44 | + * `DateCellRenderer` now answers every unparsable value with the shared |
| 45 | + * affordance, and this file's two `date` assertions moved with it — the |
| 46 | + * census row to `true`, and THE BOUNDARY to the fix's own record. |
44 | 47 | * |
45 | 48 | * ── The direction is not open per family: `valueSchemaFor`'s arm decides ── |
46 | 49 | * Read from `@objectstack/spec` `src/data/field-value.zod.ts` (v17.3.0), per |
@@ -185,8 +188,15 @@ const REGISTERED_TYPE_COUNT = 53; |
185 | 188 | * `'[Object]'` below must print. `affordance` records whether the cell draws |
186 | 189 | * the shared "No value" glyph. |
187 | 190 | * |
188 | | - * ⚠️ `date` is recorded as `'—'` WITHOUT the affordance on purpose: that dash |
189 | | - * is `formatDate`'s own, and it is objectui#8581's subject, not this card's. |
| 191 | + * ⚠️ `date` was recorded as `'—'` WITHOUT the affordance while |
| 192 | + * objectui#8581 was open: that dash was `formatDate`'s own and belonged to |
| 193 | + * that card's renderer, not this one's. objectui#8581 has since landed — |
| 194 | + * `DateCellRenderer` now intercepts every value it cannot parse (`{}` coerces |
| 195 | + * to `[Object]`, which `new Date` rejects) and returns the shared affordance, |
| 196 | + * so the row reads `true` here. Exactly as this file predicted: the fix had to |
| 197 | + * MOVE this pin rather than pass silently. The `date` census row and THE |
| 198 | + * BOUNDARY below are now this file's record of the other card's landing, and |
| 199 | + * the reason for the `{}` face itself is unchanged — `[Object]` is not a date. |
190 | 200 | */ |
191 | 201 | const OBJECT_LITERAL_CENSUS: ReadonlyArray<readonly [type: string, text: string, hasAffordance: boolean]> = [ |
192 | 202 | // ── the twenty that already coerced correctly — LOAD-BEARING ──────────── |
@@ -246,8 +256,8 @@ const OBJECT_LITERAL_CENSUS: ReadonlyArray<readonly [type: string, text: string, |
246 | 256 | ['secret', '••••••', false], |
247 | 257 | ['vector', '[Vector]', false], |
248 | 258 | ['grid', '[Grid]', false], |
249 | | - // ── objectui#8581's hand-rolled dash — NOT the affordance, NOT moved here ─ |
250 | | - ['date', '—', false], |
| 259 | + // ── objectui#8581 LANDED: the hand-rolled dash became the affordance ── |
| 260 | + ['date', '—', true], |
251 | 261 | ]; |
252 | 262 |
|
253 | 263 | /** A real value per type — the POPULATED half, which refuses the caricature. */ |
@@ -682,13 +692,24 @@ describe('objectui#8596 — an object literal is not a cell value, and these ren |
682 | 692 | ).toBe('tel:13800138000'); |
683 | 693 | }); |
684 | 694 |
|
685 | | - it('THE BOUNDARY — `date` still draws its own dash: objectui#8581 keeps its subject', () => { |
| 695 | + it('THE BOUNDARY — `date` now draws the shared affordance: objectui#8581 landed on its own subject', () => { |
| 696 | + // This assertion is INVERTED from what it was while objectui#8581 was |
| 697 | + // open, and the inversion is the point: this file predicted that a fix |
| 698 | + // there would have to move a pin here rather than pass silently, and it |
| 699 | + // did. `{}` coerces to `[Object]`, which `new Date` rejects, so the |
| 700 | + // `date` cell takes objectui#8581's unparsable branch — the same |
| 701 | + // affordance `datetime` has always drawn for the same input. The reason |
| 702 | + // `{}` is not a date is unchanged; only who draws the answer moved. |
686 | 703 | const { container } = renderCell('date', {}); |
687 | | - expect(textOf(container), 'date: the hand-rolled dash is unchanged here').toBe('—'); |
| 704 | + expect(textOf(container), 'date: the glyph is still an em-dash').toBe('—'); |
688 | 705 | expect( |
689 | 706 | affordance(container), |
690 | | - 'date: still NOT the shared affordance — objectui#8581 rules that renderer', |
691 | | - ).toBeNull(); |
| 707 | + 'date: the dash is now the shared affordance, not `formatDate`\'s bare one (objectui#8581)', |
| 708 | + ).not.toBeNull(); |
| 709 | + expect( |
| 710 | + affordance(container)?.getAttribute('aria-label'), |
| 711 | + 'date: and it carries its accessible name', |
| 712 | + ).toBe('No value'); |
692 | 713 | }); |
693 | 714 |
|
694 | 715 | it("THE BOUNDARY — objectui#8481's json-literal fence is not reopened", () => { |
|
0 commit comments