Measured by the #6120 dev while probing that card's fix (session session_019b5UBNMtTzKbVtZZGvFuxe, on origin/main133e2ea1e, with lucide-react resolution in place from PR #6129). Filed rather than fixed: re-fencing the content/docs/layout blocks is #5867's lane, and #6120 was scoped to the resolution defect only.
The measurement
With PR #6129's third-party resolution in place, four of the five content/docs/layout blocks that were red on lucide-react compile clean. The fifth — content/docs/layout/sidebar-nav.mdx, the "complete example" block whose fence sits at line 191 — is red for its own, unrelated reason:
content/docs/layout/sidebar-nav.mdx:235:7 TS2322: Type '{ label: string; items: (...)[] }[]'
is not assignable to type 'NavItem[] | NavGroup[]'.
The cause
The block writes:
constnavigationItems=[{label: 'Workspace',items: [{title: 'Inbox',href: '/inbox',icon: Mail,badge: 8,badgeVariant: 'destructive'},
...with no type annotation. So badgeVariant's string literal widens to string, and the declared shape (packages/layout/dist/SidebarNav.d.ts) is a union of literals:
exportinterfaceNavItem{title: string;href: string;badgeVariant?: 'default'|'destructive'|'outline';
...
}exportinterfaceNavGroup{label: string;items: NavItem[]}exportinterfaceSidebarNavProps{items: NavItem[]|NavGroup[]; ... }string is not assignable to that union, so the NavGroup[] branch fails; TypeScript then reports the other branch of the union, which is why the message reads "missing the following properties from type 'NavItem': title, href" and looks at first like a wrong data shape. The data shape is right. The annotation is missing.
A reader who copies this block verbatim into an annotated position, or who has strict on and assigns it anywhere typed, gets the same error.
Measured fix
Annotating the array — importing the type in the same block, since every block is compiled in isolation — takes it to zero:
import{SidebarNav,typeNavGroup}from'@object-ui/layout';constnavigationItems: NavGroup[]=[Probed under an EXIT trap with the five layout blocks temporarily re-fenced: Semantic phase: 211 of 211 block(s) judged, 0 failed, gate exit 0. Without the annotation, that same run is 1 failed.
⚠️ Note for whoever takes this: the annotation must resolve, not merely be written. A first probe added : NavGroup[] while the import landed in a different block, producing TS2304: Cannot find name 'NavGroup' — and with the annotation itself erroring, TypeScript stopped checking the literal underneath and the TS2322 disappeared. That is the same false-green shape guide/theming hit (recorded in scripts/check-doc-snippet-types.mjs's ledger): an annotation that errors silently switches off the check it was added to perform.
Scope
Belongs with the content/docs/layout re-fence under #5867 — this block cannot be brought under the gate without it. Filed unassigned.
Refs: #5867 (parent lane) · #6120 / PR #6129 (where this was measured).
Generated by Claude Code
Measured by the #6120 dev while probing that card's fix (session
session_019b5UBNMtTzKbVtZZGvFuxe, onorigin/main133e2ea1e, withlucide-reactresolution in place from PR #6129). Filed rather than fixed: re-fencing thecontent/docs/layoutblocks is #5867's lane, and #6120 was scoped to the resolution defect only.The measurement
With PR #6129's third-party resolution in place, four of the five
content/docs/layoutblocks that were red onlucide-reactcompile clean. The fifth —content/docs/layout/sidebar-nav.mdx, the "complete example" block whose fence sits at line 191 — is red for its own, unrelated reason:The cause
The block writes:
with no type annotation. So
badgeVariant's string literal widens tostring, and the declared shape (packages/layout/dist/SidebarNav.d.ts) is a union of literals:stringis not assignable to that union, so theNavGroup[]branch fails; TypeScript then reports the other branch of the union, which is why the message reads "missing the following properties from type 'NavItem': title, href" and looks at first like a wrong data shape. The data shape is right. The annotation is missing.A reader who copies this block verbatim into an annotated position, or who has
stricton and assigns it anywhere typed, gets the same error.Measured fix
Annotating the array — importing the type in the same block, since every block is compiled in isolation — takes it to zero:
Probed under an
EXITtrap with the five layout blocks temporarily re-fenced:Semantic phase: 211 of 211 block(s) judged, 0 failed, gate exit 0. Without the annotation, that same run is1 failed.: NavGroup[]while the import landed in a different block, producingTS2304: Cannot find name 'NavGroup'— and with the annotation itself erroring, TypeScript stopped checking the literal underneath and theTS2322disappeared. That is the same false-green shapeguide/theminghit (recorded inscripts/check-doc-snippet-types.mjs's ledger): an annotation that errors silently switches off the check it was added to perform.Scope
Belongs with the
content/docs/layoutre-fence under #5867 — this block cannot be brought under the gate without it. Filed unassigned.Refs: #5867 (parent lane) · #6120 / PR #6129 (where this was measured).
Generated by Claude Code