Repository navigation
Commit 5323168
fix(types)!: retire ToastSchema.action from both published faces (objectui#8338) (#8540)
* fix(types)!: retire ToastSchema.action from both published faces (objectui#8338)
`action` had NO satisfiable JSON inhabitant on the TypeScript face — `label`
and `onClick` were both required and `onClick` is a function — while the zod
mirror admitted `SchemaNode | SchemaNode[]`. Two published faces with disjoint
accept sets, one of them empty: an author who wrote the key got a green
`safeParse` and a `tsc` refusal, and no spelling satisfied both. The `toast`
renderer read neither.
ADR-0049 enforce-or-remove, retire route: `action?: never` on the declaration
and `retirementTombstone()` on the mirror. Not `handlerKeyRefusal()` — `action`
is a value key whose nested member was a function, which is why objectui#6124's
top-level sweep walked past it and retired only `onDismiss`, four lines down.
There is no replacement spelling and the capability was never fulfilled:
objectui#6250 moved the toast demos off an in-toast action entirely.
The parity ledgers drain with it: `KnownDrift` 42/64 -> 41/63 and
`WiderThanDeclared` 23/36/47 (6/30/0/11) -> 22/35/45 (6/29/0/10), every figure
re-derived by the file's own AST and mirror instruments.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CZY49skxUBYyJcdnTcYPrE
* docs(changeset): declare the ToastSchema.action retirement (objectui#8338)
Graded minor with the breaking-for-authored-metadata wording PR #7774
established: the mirror's accept set narrows (a node, and a list of nodes, no
longer parse) and the TypeScript face's `{ label, onClick }` literal stops
compiling. Both before/after columns are measured by ablating the tombstone
back to the base tree's declarations and re-running the pins.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CZY49skxUBYyJcdnTcYPrE
* fix(types): respell the action tombstone so the T2 widening tell stops firing, and pin the primitive arms it hid (objectui#8338)
Three changes, no behaviour delta on the first, a strictly larger pin on the
rest.
1. The tombstone's first message fragment moves onto the `retirementTombstone(`
call line. An indented bare quoted string that ENDS a line is regex-identical
to a closed-set member for `check-widening-tells.mjs`'s `BARE_STRING_ELEMENT`,
so a NARROWING was reported as one widening tell (exactly one, because every
continuation carries a leading `+ ` — which is the proof of the diagnosis).
The emitted string is asserted byte-identical: sha256
10b0b510c8b4ece4ab594373f870644dcefb9816b9bc92608b0791a060190fcc, len 732,
read off a rebuilt dist before and after, and the parse-time issue message
still equals `.describe()`.
2. `RETIRED_MIRROR_SHAPES` gains the primitive arms. Re-derived by re-forming
`z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)])` around the SHIPPED
`SchemaNodeSchema` (which is `z.union([BaseSchemaCore, z.string(), z.number(),
z.boolean(), z.null(), z.undefined()])`): the old mirror ALSO accepted
`'Undo'`, `1`, `true`, `null`, `[]` and `['a', 1]`. That is the larger half of
this narrowing and it was unpinned.
3. The shape list's MIXEDness is now pinned. vitest spreads an `it.each` case
only when `cases.every(Array.isArray)`, so the list arm arriving as one
argument depended on an undeclared property of the data.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CZY49skxUBYyJcdnTcYPrE
* docs(changeset): narrow an over-wide census sentence to what was measured (objectui#8338)
The note claimed no `.tsx` / `.mdx` / `.ts` source authors an `action` object.
Literally false as written: `app-shell/src/chrome/notificationToast.tsx:76` and
`chrome/toast-helpers.ts:71` both write `action: { label, onClick }` — for
SONNER's runtime API (`import { toast } from 'sonner'`), a different interface
that never fed this key. The conclusion is unchanged (0 of 7 authored `toast`
nodes carry `action`); only the sentence was wider than the measurement, and a
measured zero must not be carried forward wider than what was counted.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CZY49skxUBYyJcdnTcYPrE
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 0c46944 commit 5323168
5 files changed
Lines changed: 287 additions & 41 deletions
File tree
- .changeset
- packages/types/src
- __tests__
- zod
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | | - | |
27 | | - | |
| 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 | + | |
28 | 52 | | |
29 | 53 | | |
30 | 54 | | |
| |||
208 | 232 | | |
209 | 233 | | |
210 | 234 | | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
0 commit comments