Skip to content

docs(layout): compile the 12 plaintext-fenced TypeScript blocks in content/docs/layout (#5867 batch 5) - #6189

Merged
yinlianghui-tw merged 7 commits into
mainfrom
claude/issue-5867-plaintext-fenced-ts-batch5
Aug 25, 2026
Merged

docs(layout): compile the 12 plaintext-fenced TypeScript blocks in content/docs/layout (#5867 batch 5)#6189
yinlianghui-tw merged 7 commits into
mainfrom
claude/issue-5867-plaintext-fenced-ts-batch5

Conversation

@yinlianghui-tw

Copy link
Copy Markdown
Collaborator

Part of #5867 — batch 5 of N, the content/docs/layout/** group. The card stays open; the remainder is measured at the bottom.

What this batch does

Re-fences the 12 TypeScript blocks in content/docs/layout/** that were fenced plaintext, so check-doc-snippet-types compiles them, and fixes the four blocks it then reddened. Lowers KNOWN_UNHIGHLIGHTED_TS_FENCES by the three layout files in the same pull request, as that map's shrink-only contract requires.

Population re-derived at the claim SHA b37d3f0fd with the gate's own fence walk (check-doc-fence-languages.mjs --list, whose spelling set is plaintext / text / plain / txt / no info string, per #6135): 105 blocks / 83 files, of which content/docs/layout/** is 12 blocks / 3 filesapp-shell.mdx 4, page-header.mdx 3, sidebar-nav.mdx 5. Every layout block is spelled plaintext; the widening added none here. It reconciles with batch 4's handback exactly: 110 − 6 (fields, since landed) + 1 (the widening's file-upload.mdx) = 105.

Fence assignment: ts for the three pure-interface blocks, tsx for the nine carrying JSX.

#6120's fix is on main, established rather than assumed

The gate was run on today's origin/main before anything was edited. @object-ui/layout is absent from --build-filter there (nothing in the compiled population imported it) and appears the moment these blocks are re-fenced — with it, lucide-react and react become resolvable as its declared dependencies. The header line moves 20 imported package(s) to 21, and no layout block reports an unresolved third-party import.

The four blocks the gate reddened, all fixed, none marked

⛔ No FRAGMENT_MARKER was declared. The ledger, UNGATED_DOCS and the gate itself are untouched.

blockdiagnosticfix
app-shell.mdx Component PropsTS2304AppShellBrandingimport the type from @object-ui/layout — it is a real export of that package
app-shell.mdx Collapsible SidebarTS2304 x4: AppShell, SidebarNav, navItemsimport the two components; declare const navItems: NavItem[] for the value defined in an earlier block, the idiom already used seven times in blocks/block-schema.mdx and components/basic/icon.mdx
sidebar-nav.mdx IconsTS2304SidebarNavimport it — the block imported its icons and not the component it renders
sidebar-nav.mdx Usage with AppShellTS2741 children missing on AppShellProps; TS2304Home, Infoimport the two icons; give AppShell a real child

The last one is the #5044 class: a reader copying that block gets code that does not compile, on a page the gate reported as covered.

Hazard 1, measured on this batch rather than inherited

An unresolved type name degrades to any and suppresses the checks beneath it, so a first-round diagnostic count is a lower bound. app-shell.mdx's Collapsible Sidebar block passed no children to AppShell and round 1 never said so — the name AppShell was itself unresolved. Both defects were fixed together, then the suppression was demonstrated: reverting only the child of that block, with the imports left in place, reddens it with

content/docs/layout/app-shell.mdx:123:2 TS2741: Property 'children' is missing in type
'{ navbar: Element; sidebar: Element; }' but required in type 'AppShellProps'.

— a diagnostic that round 1 could not produce. The mutation was proved on disk before the run (injected marker count 1 to 2, removed count 1 to 0) and restored under trap ... EXIT INT TERM, with git status --porcelain empty afterwards.

Hazard 2 did not bite: Syntax phase: every block parsed, so every one of them reached the semantic phase on every run, so no layout block had its imports checked by nothing.

Verification

All readings at branch head 80bcfc357, git status clean, every heavy run through the container's shared verify lock. Exit codes captured by redirect before any pipe; each gate's own verdict line quoted.

check:doc-snippetsbefore (origin/mainb37d3f0fd, built tree) — exit 0:

Scanned 223 document(s): 179 covered (74 of them hold a ts/tsx block), 44 ungated
Covered blocks: 362 — 251 to compile, 111 declared fragment(s).
Semantic phase: 251 of 251 block(s) judged, 0 failed.

check:doc-snippetsafter — exit 0:

Scanned 223 document(s): 179 covered (77 of them hold a ts/tsx block), 44 ungated
Covered blocks: 374 — 263 to compile, 111 declared fragment(s).
Syntax phase: every block parsed, so every one of them reached the semantic phase.
Semantic phase: 263 of 263 block(s) judged, 0 failed.
Every covered documentation snippet compiles against the built types.

Deltas: blocks-to-compile +12, exactly the batch size · covered documents 179 unchanged · ungated 44 unchanged · declared fragments 111 unchanged · diagnostics 0. Gate strictness unmoved — check-doc-snippet-types.mjs is not in the diff.

Intermediate reading, kept because it is the evidence for the fix list: the first post-re-fence run was exit 1, Semantic phase: 263 of 263 block(s) judged, 4 failed, with the nine diagnostics tabulated above.

Other gates, same head:

  • check:doc-fences exit 0 — every TypeScript block in 223 document(s) is fenced ts/tsx/typescript, except 80 declared file(s) carrying 93 block(s) of objectui#5867's remaining population (was 83 files / 105 blocks — the map drops by exactly this batch)
  • check:doc-types exit 0 — Every documented component type is registered.
  • docs:check-links exit 0 — Links are valid across 15 scan roots.
  • check:control-bytes exit 0 — OK (scanned 5110 tracked text file(s); skipped 85 binary), plus a self-scan over the five changed files with zero hits
  • check-changeset-presence exit 0 — No source of a released package changed in this range, so no changeset is owed; the empty-frontmatter changeset is declared anyway. changeset:check exit 0.

Vitest from the repo root (never package-scoped, per #3378): check-doc-fence-languages, check-doc-snippet-types, check-doc-component-types, check-doc-links, check-changeset-presenceTest Files 5 passed (5), Tests 215 passed (215).

Lint, narrowed with the narrowing measured rather than asserted: the diff is three .mdx, one .changeset/*.md and one .mjs; eslint's own configuration reports the four Markdown-family files as File ignored because no matching configuration was supplied and lints the .mjs clean (file count read from --format json: 5 reported, 4 ignored, 0 errors). No project / projectService appears in eslint.config.js, so type-aware linting is off and this diff cannot move the verdict on any untouched file.

Render, narrowed and declared: pnpm site:build green at branch head (exit 0), then the prerendered HTML counted per code block. Batch 4's rebuilt-baseline double build was not repeated; the after-state is read with two controls instead. Blocks carrying shiki colour tokens — app-shell 4 of 10, page-header 5 of 12, sidebar-nav 6 of 12 — equal this batch's per-page share plus each page's pre-existing highlighted fences (page-header has two yaml, sidebar-nav one bash), and every remaining prose plaintext block on those pages still renders with none. Control: components/layout/page.mdx, untouched, renders its one block with zero colour tokens.

Remainder, measured at this branch head

groupblocksfilesstate
content/docs/components/**7272⛔ blocked — #6122, #6143, and #5155; the 2026-08-24 lane correction on #5867 rules that re-fencing this group is negative, not merely blocked
content/docs/core/**111⛔ blocked on #6121 (needs-user-decision)
named in UNGATED_DOCS — re-fencing adds zero to the compile population76leave
content/docs/plugins/** (plugin-dashboard.mdx)31recorded on #6122; correct form pinned by landed precedent #5015 / PR #5069
content/docs/layout/**00✅ complete — this batch
content/docs/fields/**00✅ complete
content/docs/blocks/**00✅ complete
total9380

The count is now readable from the repository rather than re-derived by hand: node scripts/check-doc-fence-languages.mjs --list.


Generated by Claude Code

The re-fence gave the "Collapsible Sidebar" block `declare const navItems:
NavItem[]` so it would compile on its own, borrowing the array defined under
"Basic Usage". `packages/layout/src/__tests__/app-shell-docs-nav-example.test.ts`
reads this page from disk and requires every SidebarNav fence that mentions
`const navItems` to spell `const navItems: NavItem[] = [` — the annotation is
what turns a copied typo into a compile error (objectui#3999 / #4793) — so the
`declare` form reddened the pin.
Replace it with a real, annotated two-item array. The block still compiles
standalone, and it is now self-contained rather than self-declared, which is the
stronger of the two states the snippet gate offers.
The array is deliberately NOT a copy of the "Basic Usage" three-item run: that
run is compared line-for-line against the test file, and a second verbatim copy
on the page would satisfy the parity search while the real block went stale.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019b5UBNMtTzKbVtZZGvFuxe
@yinlianghui-tw
yinlianghui-tw added this pull request to the merge queueAug 25, 2026
Merged via the queue into main with commit 65d3e76Aug 25, 2026
25 checks passed
@yinlianghui-tw
yinlianghui-tw deleted the claude/issue-5867-plaintext-fenced-ts-batch5 branch August 25, 2026 01:50
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@yinlianghui-tw@claude