Uh oh!
There was an error while loading. Please reload this page.
docs(theme): rewrite theme-schema.mdx around the retained Theme document - #5809
Merged
Conversation
…ent (#5648) The page taught a schema that does not exist: a fabricated `ThemeSchema` / `type: 'theme'` component wrapper (retired in #5489, never implemented by any renderer), per-mode light/dark palettes, retired typography scale keys, a `mode: 'system'` spelling and a `radius` key — all fenced ```plaintext so no gate ever read them. Rewritten around what actually runs: `Theme` / `ThemeMode` / `ColorPalette` from `@object-ui/types` (owned there since #5716 — NOT `@objectstack/spec/ui`, which retired its theme module in 17.2.0), `ThemeEngine` (`@object-ui/core`) and `ThemeProvider` / `useTheme` (`@object-ui/react`). Token tables are re-derived from `packages/types/src/theme.ts` and `ThemeEngine`'s COLOR_TO_CSS_MAP. All snippets are fenced ts/tsx so `check:doc-snippet-types` compiles them; one block pins the typography tombstones via @ts-expect-error. The three `check-doc-component-types.mjs` exemption entries for this page (`theme` / `theme-switcher` / `theme-preview`) are deleted — the page re-enters that gate's population with zero exempted literals. The unregistered switcher/ preview kinds (#5647) are no longer taught. Docs-only; empty-frontmatter changeset declares no release. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EuPCi56cnGyykygi3z9w4m
… prose doc-version-claims flagged both (shard 4/4 on PR #5809): a pinned spec version in prose is the defect class this rewrite exists to kill — #3645 is the record of one going stale for thirteen majors. Taking the gate's first remedy: the literals are deleted, the sentences now carry the same facts through their issue references (objectui#5716, objectstack#5021), which cannot go stale. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EuPCi56cnGyykygi3z9w4m
os-zhuang
marked this pull request as ready for review
August 23, 2026 12:42
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes#5648
What
content/docs/core/theme-schema.mdx(369 lines re-measured, every code block fencedplaintext) taught a theme schema that does not exist. Rewritten (374 lines) around the retained theme system — theThemedocument,ThemeEngine(@object-ui/core),ThemeProvider/useTheme(@object-ui/react) — with every snippet fencedts/tsxsocheck:doc-snippet-typescompiles it, and the page's threecheck-doc-component-types.mjsexemption entries (theme/theme-switcher/theme-preview) deleted, so the page re-enters that gate's population with zero exempted literals.Review round (PM, shard 4/4 red):
doc-version-claimsflagged two pinned@objectstack/specversion literals in the rewritten prose — the same defect class this PR removes, freshly planted (#3645 is the record of one going stale for thirteen majors). Fixed by the gate's first remedy in3d90250d0: both literals deleted; the sentences carry the same facts through their issue references (objectui#5716, objectstack#5021), which cannot go stale.KNOWN_CLAIMSwas not touched.The six falsehoods, corrected
ThemeSchemaimport from@object-ui/types— the page now teachesTheme(plusThemeMode/ColorPalette/THEME_MODES), which is what the package exports.ThemeSchemafrom@object-ui/types/zod— cannot be re-spelled, see the staleness note below: no runtime theme-document validator exists any more. The Validation section says so and documents the type-level enforcement (thenevertombstones) instead.type: 'theme'node withthemes[]/activeTheme/allowSwitching/persistPreference/storageKey— the page now states a theme is a document handed toThemeProvider, not a component, and documents the real provider props (themes,defaultTheme,defaultMode,persist,storageKey,target) fromThemeProviderProps.light:/dark:palettes — replaced by the real singlecolorsmap; per-mode palettes are authored as two documents sharing tokens viaextends.typography.fontSize/lineHeight— the page documentsfontFamily.baseas the only live typography key, shows the retired scales as compile-time refusals (a@ts-expect-errorblock that doubles as a live pin: if a tombstone is ever un-retired, the unused directive turns the snippet gate red), and teachescustomVarsas the declared replacement.mode: 'system'andradius:— the page teachesThemeModeas exactlylight/dark/auto(with an explicit "there is nosystemmember"), theborderRadiuskey, and thebasemiddle step.Token tables are re-derived from
packages/types/src/theme.tsand fromThemeEngine'sCOLOR_TO_CSS_MAP/ radius / shadow maps — each key is documented with the CSS variable it actually emits — not from the page's own copy.The unregistered
theme-switcher/theme-previewkinds are no longer taught anywhere on the page. #5647 stays open and is not addressed here; whoever takes it re-reads the exemption list as this PR leaves it (this file's entry is gone entirely).The card's Reality column is stale on two points — measured
Both moved after the card was written, exactly as the dispatch warned:
Themefrom@objectstack/spec/ui" is no longer where the document lives. Since The theme TYPE surface (Theme,ThemeMode,ColorPalette, …) still derives from@objectstack/spec/ui, which retired it — objectui cannot refresh its spec pin past 17.1.0 until this is re-homed or dropped, and the choice needs a ruling #5716,@object-ui/typesOWNSTheme/ThemeMode/ColorPalette(packages/types/src/theme.ts, hand-written from the last-published shapes), and the vacancy pins inpackages/types/src/__tests__/page-nav-misc-spec-parity.test.tsassert those three names are ABSENT from the spec surface. The rewrite imports from@object-ui/typesthroughout.ThemeDefinitionSchema") is also stale: Remove/localize the six dangling@objectstack/spec/uitheme-schema imports inpackages/types/src/zod/theme.zod.ts— the ruled FIRST leg of unbreaking objectstack's Console Pin Gate #5710 removed all six theme-document validators from@object-ui/types/zod, and its module header records that hand-writing local mirrors is a localization branch no ruling has taken. So the old "Runtime Validation" section could not be corrected to a different import — it is replaced by an honest Validation section.Line census re-measured at 369; all six falsehoods confirmed present pre-rewrite.
Verification (union re-run at
3d90250d0, exit codes captured via redirect before any pipe)scripts/__tests__/doc-version-claims.test.tsvia repo-root vitest — reproduced red at03447fe7f(the two literals, same lines as the shard), green after the fix: 18 passed (18).check:doc-types— exit 0, its own verdict line: "Every documented component type is registered." (this page now contributes zero exempted literals).check:doc-snippets— exit 0 against freshly built dists (turbo, concurrency 2, under the shared verify lock): "Semantic phase: 101 of 101 block(s) judged, 0 failed." Controls: resolution topackages/types/dist/index.d.ts, sentinel TS2305, positive clean.03447fe7f; the fix commit touched prose only, no fenced block — expected direction: red; observed: red). Mutation leg:THEME_MODESrespelled to a fabricated name, confirmed on disk (grep count 2 probe / 0 pristine), gate exit 1 withcontent/docs/core/theme-schema.mdx:142:10 TS2305. Restore leg: restored from the branch commit, confirmed on disk (0 probe / 2 pristine), gate exit 0. No rebuild step exists between mutation and measurement by construction: the gate reads the.mdxfrom disk each run and the mutation touched no package source. The mutation script carried a restore trap for EXIT/INT/TERM.check:doc-links— exit 0: "Links are valid across 13 scan roots."check:control-bytes— exit 0.check-doc-component-types.test.ts,check-doc-snippet-types.test.ts,check-doc-links.test.ts): 3 files, 141 tests passed (first round; none of those files changed since).check-changeset-presenceexit 0 ("no changeset is owed" — the empty-frontmatter changeset declares docs-only, the objectui-legal way);check-changeset-no-majorexit 0;check-changeset-fixedexit 0.scripts/check-doc-component-types.mjs— linted, exit 0, zero problems. The.mdxis outside the population by eslint's OWN config ("File ignored because no matching configuration was supplied"), and the changed file is a data-map deletion with no cross-file lint semantics, so untouched files' judgments cannot move.content/, soBuild Docsdoes a real, minutes-long build (the feat(sdui-parser): warn on dashboard widget options keys no renderer consumes (#5709) #5743 precedent: 225 s), not the path-filtered skip.Test (coverage)is red onmainindependently of this PR (Test (coverage)is red on every push tomainbecauseCODECOV_TOKENis unset — the four shards are green, the upload is rejected #5436 /ci.yml'sconcurrencycancels the push-lane coverage job mid-run, so Codecov gets nothing on a merge that is followed by another merge #5422).Generated by Claude Code