Repository navigation
feat(cli): id-anchored, prose-only doc overlays — bulletproof overlay merge (#2182) - #4117
josephfarina wants to merge 11 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Make reference-doc dense/zh overlays structurally unable to drop, misalign, or override canonical content (the #2182 / #3891 bug class). - ContentBlock gains an optional stable id; ReferenceTranslationDoc is prose-only, id-keyed blocks and cannot express type/code/table/structure - api/docs.mjs merge is id-anchored and fail-safe: unmatched or unexpressible overrides fall back to canonical English; no array positions anywhere - all reference docs migrated: principles, theme, layout (per-block ids), tokens (ids emitted from scripts/generate-token-docs.mjs); overlays rewritten to blocks - docOverlays.test.mjs gate: every overlay block id resolves, prose-only, unique base ids, and the legacy positional content shape is rejected - component/hook overlays already safe on main via #3892 (overlayComponentDoc) Refs #2182 Co-authored-by: Cursor <[email protected]>
9f9e3f5 to
88d2bb2
Compare
Reference-doc blocks now carry a stable id; the docsite's data generator emitted a ContentBlock interface without it, so the typed docsRegistry data (id present) failed the Next build typecheck (TS2353). Add id?: string to the emitted type. Co-authored-by: Cursor <[email protected]>
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR No new or modified components detected. Bundle Size Summary
Accessibility AuditStatus: 67 accessibility violation(s) found — 6 critical, 55 serious, 6 moderate. AppShell - 1 issue(s)
Avatar - 1 issue(s)
AvatarGroup - 1 issue(s)
Badge - 1 issue(s)
Banner - 1 issue(s)
Card - 1 issue(s)
Carousel - 1 issue(s)
Chat - 1 issue(s)
ChatComposer - 1 issue(s)
ChatComposerInput - 2 issue(s)
ChatLayout - 1 issue(s)
ChatReasoning - 1 issue(s)
ChatToolCalls - 1 issue(s)
CheckboxList - 1 issue(s)
ClickableCard - 1 issue(s)
CodeEditor - 2 issue(s)
CodeEditorPerf - 2 issue(s)
CodeEditorTheme - 1 issue(s)
CodeTheme - 1 issue(s)
Collapsible - 1 issue(s)
DateRangeInput - 1 issue(s)
FileInput - 3 issue(s)
Grid - 1 issue(s)
GridMasonry - 1 issue(s)
Heading - 1 issue(s)
Icon - 1 issue(s)
InputGroup - 1 issue(s)
Item - 2 issue(s)
Kbd - 1 issue(s)
Layout - 2 issue(s)
List - 2 issue(s)
LogStream - 1 issue(s)
OverflowList - 1 issue(s)
Overlay - 1 issue(s)
Pagination - 1 issue(s)
PowerSearch - 1 issue(s)
ProgressBar - 1 issue(s)
RadioList - 1 issue(s)
Schedule - 1 issue(s)
Section - 1 issue(s)
SegmentedControl - 1 issue(s)
SelectableCard - 1 issue(s)
Stack - 1 issue(s)
Stepper - 1 issue(s)
TabList - 1 issue(s)
Table - 1 issue(s)
TableGroupedRows - 2 issue(s)
TablePagination - 1 issue(s)
TableTree - 1 issue(s)
Text - 1 issue(s)
Theme - 1 issue(s)
PopArt - 1 issue(s)
Thumbnail - 1 issue(s)
Timestamp - 1 issue(s)
Token - 1 issue(s)
Tokenizer - 1 issue(s)
Toolbar - 1 issue(s)
ToolbarEdgeCompensation - 1 issue(s)
Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
… docs - ContentBlock.id is now required (every canonical block is addressable) - backfilled stable ids into the remaining 14 reference docs (~270 blocks) - gate: assert every block in every reference doc has a unique id - token-ref error blocks carry ids too - docsite generator keeps ContentBlock.id optional (passive consumer; can't re-break) Refs #2182 Co-authored-by: Cursor <[email protected]>
…uthored ids
Making id required in the type broke runtime block synthesizers that legitimately
omit it (apps/sandbox DocPreview builds {type:'prose', text} from a description;
token-ref fallbacks). The correct enforcement is the docs gate, which already
asserts every authored block in a reference .doc.mjs has a unique id. So the type
stays optional (synthesizers are fine) while source docs remain fully id'd.
Co-authored-by: Cursor <[email protected]>
Picked up via merge of main (#4114 added this doc after this branch forked). The id gate correctly flagged it; adding ids brings it into compliance. Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
|
I'm gonna make this whole system better in a follow up PR, but for now this at least bullet proofs the bugs and let's me put it off for a little longer |
…ons prose The overlay prose in these two guide docs used curly apostrophes (authored as \u2019 escapes) in possessives/contractions (consumer's, integration's, core's, author's, you're). Straighten to ASCII ' (escaped for the single-quoted JS strings) per the AI-slop typographic rubric (check 17 / A4). Prose only, meaning unchanged; both files parse and render with straight apostrophes.
Pull in #4149 (localize tree expander aria-label) which fixes the @astryx/no-hardcoded-i18n-string lint errors in useTableTreeData.tsx that were failing CI on the stale merge ref. Branch does not touch that file; merge is clean.
cixzhang
left a comment
There was a problem hiding this comment.
Approving. This structurally eliminates the #2182 bug class rather than patching a symptom.
- Type redesign narrows overlays to id-keyed, prose-only
blocks— an overlay literally can't carry a type/code/table/structure anymore. - Merge is id-anchored with a block-type match guard; anything unmatched or unexpressible falls back to canonical English (fail-safe).
- The CI gate is thorough — id coverage, real-anchor resolution, prose-only, and rejection of legacy positional
content. Ran it locally: 55/55 pass, all overlays migrated cleanly.
Nit (non-blocking): the changeset is one dense paragraph, a touch over the "2-3 line" changelog guidance — fine to leave.
…rose (#4633) Recast 18 prose em-dash asides to semicolons across three cli guide docs (now at packages/cli/assets/docs/ after the restructure): elevation (11), internationalization (6), getting-started (1). Independent-clause asides, so a semicolon carries the same meaning. Prose only; code comments, the {/* */} JSX comment, the pseudo-locale example, and numeric ranges left untouched. These were previously deferred behind the stalled overlay PR #4117, which edits the pre-restructure packages/cli/docs/ path that no longer exists on main; the files now live at assets/docs/ and are owned by no open PR. Night Watch — Doc Reviewer
Builds on #3891 and #3892 to make the reference-doc overlay mechanism structurally incapable of the recurring bug class behind #2182 — overlays dropping, misaligning, or overriding canonical content.
Approach
Canonical
*.doc.mjsis the single source of truth. The dense/zh overlays (generated externally, never hand-maintained) are prose-only deltas keyed by stable anchors — section title + blockid, never array position — merged fail-safe:id; anything unmatched or unexpressible falls back to canonical English.ReferenceTranslationDocis narrowed so an overlay literally cannot carry a type/code/table/structure — onlytext/itemsprose, keyed by id.Status — reference-doc bulletproofing complete
ContentBlockgains an optional stableid;ReferenceTranslationDoc-> prose-only id-keyedblocks(packages/core/src/docs-types.ts)packages/cli/src/api/docs.mjs)principles,theme(50 blocks),layout(13),tokens(ids emitted fromscripts/generate-token-docs.mjs)blocksdocOverlays.test.mjs, 34 tests): every overlay block id resolves + prose-only + unique base ids; legacy positionalcontentis rejectedComponent-doc surface: already bulletproofed on
mainby #3892 (overlayComponentDocmerges by name, base wins) — no change needed here.This PR is the overlay mechanism. Doc content (translation/compression) is generated externally; doc size (#2182's original ask) is that generator's concern. Keeping #2182 open.
Optional follow-up: extend the gate to also assert component overlays are prose-only (hardening — the runtime path is already safe).
Refs #2182.