Repository navigation
feat(Markdown): add heading links identity foundation - #6911
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report
|
There was a problem hiding this comment.
Thanks for making linkable Markdown headings opt-in. Preserving released no-plugin output, sharing one heading allocator between Markdown and Outline through the same plugin entry, keeping authored heading links valid with a sibling permalink, and leaving custom heading renderers in control are a strong basis, and the mechanism for keeping both surfaces on the same IDs is clear.
Approval needs a maintainer to settle the governing spec for this intentional change first. The current Markdown, Outline-from-Markdown, and system records still preserve top-level-only heading identity and treat widening traversal as a separate decision, while this proposal adds depth-first nested IDs, Unicode fragments, and a caller-owned namespace and URL base for plugin-enabled documents. Please have a maintainer provide or update that governing spec — including alignment of all three records for the plugin-enabled carve-out — before this contract is accepted as current.
Independent fixes will still be needed after that decision:
- The permalink is visible at rest in the exact-head browser evidence (rest opacity 1 where 0 is expected) instead of quiet until hover or focus, and that CI job is red. Please make the rest-hidden state reach the link and re-prove the rest, hover, focus, touch, and forced-colors states.
- The Outline and system records are not updated in this PR, so they would still contradict the approved plugin-enabled behavior. Please align them, or record why they need no alignment, as part of the maintainer-approved spec update.
[Automated review]
There was a problem hiding this comment.
Thanks for making linkable Markdown headings opt-in. Preserving released no-plugin output, sharing one heading allocator between Markdown and Outline through the same plugin entry, keeping authored heading links valid with a sibling permalink, and leaving custom heading renderers in control are a strong basis, and aligning the proposed wording across the Markdown, Outline, system, and API-admission records in this revision makes the decision clear to evaluate.
Approval needs a maintainer to update the existing governing spec for this intentional change first. The current records on the main branch still preserve top-level-only heading identity and treat widening traversal as a separate decision, while this proposal adds depth-first nested IDs, Unicode fragments, and a caller-owned namespace and URL base for plugin-enabled documents. Please have a maintainer approve the exact proposed spec text in this PR as that governing update — or state the corrections required — before this contract is accepted as current.
Once that decision is settled, please also make sure the exact-head browser evidence for the new permalink passes for the rest, hover, focus, touch, and forced-colors states, since that proof is still pending.
[Automated review]
There was a problem hiding this comment.
Thanks for making linkable Markdown headings opt-in. Preserving released no-plugin output, sharing one heading allocator between Markdown and Outline through the same plugin entry, keeping authored heading links valid with a sibling permalink, and leaving custom heading renderers in control are a strong basis, and collecting the contract in a dedicated module record with delegating edits in the surrounding records makes the decision clear to evaluate.
Approval needs a maintainer to update the existing governing spec for this intentional change first. The current records on the main branch still preserve top-level-only heading identity, treat widening traversal as a separate decision, and limit first-party plugins to the public protocol with no privileged capability, while this proposal adds depth-first nested IDs, Unicode fragments, and a caller-owned namespace and URL base for plugin-enabled documents, with Core composing the module through an internal seam. Please have a maintainer approve the exact proposed spec text in this PR as that governing update — or state the corrections required — before this contract is accepted as current.
Once that decision is settled, please also make sure the exact-revision browser evidence for the new permalink passes for the rest, hover, focus, touch, and forced-colors states, since that proof is still pending.
[Automated review]
There was a problem hiding this comment.
Thanks for making linkable Markdown headings opt-in and for adding a clear copy confirmation to the permalink. Preserving released no-plugin output, sharing one heading allocator between Markdown and Outline through the same plugin entry, keeping authored heading links valid with a sibling permalink, leaving custom heading renderers in control, and failing soft to native navigation when clipboard access is unavailable are a strong basis, and collecting the contract in a dedicated module record with delegating edits in the surrounding records makes the decision clear to evaluate.
Approval needs a maintainer to update the existing governing spec for this intentional change first. The current records on the main branch still preserve top-level-only heading identity, treat widening traversal as a separate decision, and limit first-party plugins to the public protocol with no privileged capability, while this proposal adds depth-first nested IDs, Unicode fragments, a caller-owned namespace and URL base, and copy-on-activation with a check and polite confirmation for plugin-enabled documents, with Core composing the module through an internal seam. Please have a maintainer approve the exact proposed spec text in this PR as that governing update — or state the corrections required — before this contract is accepted as current.
Independent fixes will still be needed after that decision:
- The permalink is visible at rest in the exact-revision browser evidence (rest opacity 1 where 0 is expected) instead of quiet until hover or focus, and that job stops before proving the later hover, focus, copy, touch, and forced-colors states. Please make the rest-hidden state reach the link and re-prove all of those states, including the fixed-space check, clipboard contents, and fragment navigation.
- The verified authored size is now 2,232 changed lines, over the review threshold without a cleared exception. Please provide the decomposition and necessity evidence that satisfies the exception once the governing contract is settled, or reduce or split the scope into bounded reviewable parts.
[Automated review]
376e8f3 to
380fb30
Compare
There was a problem hiding this comment.
Thanks for splitting linkable Markdown headings into this identity foundation. Keeping it opt-in and default-off, preserving released no-plugin output, sharing one heading allocator between Markdown and Outline through the same plugin entry, leaving custom heading renderers in control, and collecting the contract in a dedicated module record with delegating edits in the surrounding records makes the decision clear to evaluate, and the focused identity and server-rendering tests pass at this revision.
Approval needs a maintainer to update the existing governing spec for this intentional change first. The current records on the main branch still preserve top-level-only heading identity, treat widening traversal as a separate decision, and limit first-party plugins to the public protocol with no privileged capability, while this proposal adds depth-first nested IDs, Unicode fragments, and a caller-owned namespace for plugin-enabled documents, with Core composing the module through an internal seam. Please have a maintainer approve the exact proposed spec text in this PR as that governing update — or state the corrections required — before this contract is accepted as current.
One independent fix will still be needed after that decision:
- An entry created by a duplicate Core copy would be silently unrecognized, because its options are stored only in the creating copy, so a consuming copy falls back to released IDs with no diagnostic and Markdown and Outline could disagree if they come from different copies. Please carry recognition on the stable cross-package shape and prove it with a duplicate-copy fixture.
[Automated review]
380fb30 to
644dc3c
Compare
There was a problem hiding this comment.
Thanks for splitting linkable Markdown headings into this identity foundation. Keeping it opt-in and default-off, preserving released no-plugin output, sharing one heading allocator between Markdown and Outline through the same plugin entry, carrying the namespace on the entry so compatible duplicate Core copies agree, leaving custom heading renderers in control, and collecting the contract in a dedicated module record with delegating edits in the surrounding records makes the decision clear to evaluate, and the focused identity and server-rendering tests pass at this revision.
Approval needs a maintainer to update the existing governing spec for this intentional change first. The current records on the main branch still preserve top-level-only heading identity, treat widening traversal as a separate decision, and limit first-party plugins to the public protocol with no privileged capability, while this proposal adds depth-first nested IDs, Unicode fragments, and a caller-owned namespace for plugin-enabled documents, with Core composing the module through an internal seam. Please have a maintainer approve the exact proposed spec text in this PR as that governing update - or state the corrections required - before this contract is accepted as current.
One independent fix will still be needed after that decision:
- A same-name or incompatible heading-links entry currently makes Markdown rendering throw instead of failing soft with a diagnostic and the released heading behavior, so a version-skewed or lookalike entry can take down the whole document. Please route that validation through the existing soft plugin-admission path and prove the Markdown component still renders with matching Outline IDs.
[Automated review]
644dc3c to
a1c4b10
Compare
There was a problem hiding this comment.
Thanks for splitting linkable Markdown headings into this identity foundation. Keeping it opt-in and default-off, preserving released no-plugin output, sharing one heading allocator between Markdown and Outline through the same plugin entry, carrying the namespace on the entry so compatible duplicate Core copies agree, leaving custom heading renderers in control, and collecting the contract in a dedicated module record with delegating edits in the surrounding records makes the decision clear to evaluate, and the focused identity and server-rendering tests pass at this revision.
Approval needs a maintainer to update the existing governing spec for this intentional change first. The current records on the main branch still preserve top-level-only heading identity, treat widening traversal as a separate decision, and limit first-party plugins to the public protocol with no privileged capability, while this proposal adds depth-first nested IDs, Unicode fragments, and a caller-owned namespace for plugin-enabled documents, with Core composing the module through an internal seam, and locks the future permalink renderer to an honest copy button with canonical reveal behavior and no navigation, hash, or scroll mutation. Please have a maintainer approve the exact proposed spec text in this PR as that governing update - or state the corrections required - before this contract is accepted as current.
One independent fix will still be needed after that decision:
- A same-name or incompatible heading-links entry currently makes Markdown rendering throw instead of failing soft with a diagnostic and the released heading behavior, so a version-skewed or lookalike entry can take down the whole document. Please route that validation through the existing soft plugin-admission path and prove the Markdown component still renders with matching Outline IDs.
[Automated review]
a1c4b10 to
4d743a4
Compare
There was a problem hiding this comment.
Thanks for splitting linkable Markdown headings into this identity foundation. Keeping it opt-in and default-off, preserving released no-plugin output, sharing one heading allocator between Markdown and Outline through the same plugin entry, carrying the namespace on the entry so compatible duplicate Core copies agree, removing incompatible same-name entries in Markdown and Outline instead of crashing, leaving custom heading renderers in control, and collecting the contract in a dedicated module record with delegating edits in the surrounding records makes the decision clear to evaluate, and the focused identity and server-rendering tests pass at this revision.
Approval needs a maintainer to update the existing governing spec for this intentional change first. The current records on the main branch still preserve top-level-only heading identity, treat widening traversal as a separate decision, and limit first-party plugins to the public protocol with no privileged capability, while this proposal adds depth-first nested IDs, Unicode fragments, and a caller-owned namespace for plugin-enabled documents, with Core composing the module through an internal seam, and locks the future permalink renderer to an honest copy button with canonical reveal behavior and no navigation, hash, or scroll mutation. Please have a maintainer approve the exact proposed spec text in this PR as that governing update - or state the corrections required - before this contract is accepted as current.
One independent fix will still be needed after that decision:
- An incompatible or same-name heading-links entry is dropped in Markdown and Outline with no diagnostic, so a caller silently loses the intended namespace and nested targets, and the public parser entrypoint still runs a lookalike transform instead of dropping it, so parsed and rendered documents can diverge. Please report the dropped entry through the existing diagnostic path and apply the same removal consistently across Markdown, Outline, and parser entrypoints, with tests for that parity.
[Automated review]
4d743a4 to
07292f2
Compare
|
/approve-spec 07292f2 |
There was a problem hiding this comment.
Thanks for splitting linkable Markdown headings into this identity foundation. Keeping it opt-in and default-off, preserving released no-plugin output, sharing one heading allocator between Markdown and Outline through the same plugin entry, carrying the namespace on the entry so compatible duplicate Core copies agree, treating only the exact module configuration as heading links while malformed entries fail soft instead of throwing, and leaving custom heading renderers in control makes this a clean foundation, and the focused identity, Markdown, Outline, and server-rendering tests pass at this revision along with typecheck and the repository knowledge, sync, and changeset checks.
The governing spec question is now settled for this revision: the proposed module record and its delegating edits carry exact-head owner approval, so the depth-first nested IDs, Unicode fragments, caller-owned namespace, and internal projection seam are accepted as the governing contract for plugin-enabled documents, with the future permalink renderer locked to an honest copy button with canonical reveal behavior and no navigation, hash, or scroll mutation. No blocking defect remains in this foundation; the renderer itself still belongs in the dependent follow-up with its own browser evidence.
[Automated review]
07292f2 to
7a57544
Compare
|
/approve-spec 7a57544 |
There was a problem hiding this comment.
Thanks for splitting linkable Markdown headings into this identity foundation. Keeping it opt-in and default-off, preserving released no-plugin output, sharing one heading allocator between Markdown and Outline through the same plugin entry, carrying the namespace on the entry so compatible duplicate Core copies agree, treating only the exact module configuration as heading links while malformed entries fail soft instead of throwing, and leaving custom heading renderers in control makes this a clean foundation, and the focused identity, Markdown, Outline, and server-rendering tests pass at this revision along with typecheck and the repository knowledge, sync, and changeset checks.
The governing spec question is now settled for this revision: the proposed module record and its delegating edits carry exact-head owner approval, so the depth-first nested IDs, Unicode fragments, caller-owned namespace, and internal projection seam are accepted as the governing contract for plugin-enabled documents, with the future permalink renderer locked to an honest copy button with canonical reveal behavior and no navigation, hash, or scroll mutation. No blocking defect remains in this foundation; the renderer itself still belongs in the dependent follow-up with its own browser evidence.
[Automated review]
<!-- template: bug-fix.md -->
## User impact
An app that builds Astryx from source with the documented Next.js setup, but sets no browserslist or targets a browser without Unicode property escapes (such as Safari 11), fails `next build --webpack` with `Unknown property: L` (also `Zs`, `Letter`). The errors point at `Avatar.tsx`, `Markdown/parser.ts` and `Markdown/plugins/headingLinks.ts`, package source the app cannot change, and come from both the PostCSS pass and the JavaScript compile. Any import from the package root reaches them.
## Problem and solution fit
- Why it fails: with no targets, or old ones, `next/babel`'s preset-env rewrites every `\p{…}` regex literal with transform-unicode-property-regex. Next's bundled copy of that transform loads `regenerate-unicode-properties` at runtime, which Next does not ship, so it throws (Next 16.3.6 and 16.4.2 alike).
- Why it harms the task: the throw stops the whole build.
- Why that matters: the app cannot fix it in its own code, and the error names a Unicode property, not the missing target.
## Expected behavior and authority
This is a regression of a settled case. #5450 hit this failure in `NumberInput/numberParser.ts` and builds those expressions with `new RegExp(...)`; its comment records why, and notes that property escapes need no transform in any browser this package supports. #6698, #6911 and #7051 later added four new literals and reintroduced it.
## Smallest restoration
- The four literals become `new RegExp(...)` with the same pattern and flags, built once at module load as before.
- Each site's comment names the cause and when a literal is safe again: once Next's bundled Babel ships the Unicode data.
- A source-build test fails when a Core module writes a property escape as a regex literal.
## Evidence
- Reproduction before the change: a clean registry install of main's documented Next.js example (`apps/example-nextjs-source`, hoisted, browserslist removed). `next build --webpack` fails in the PostCSS pass (`Avatar.tsx: Unknown property: L`) and in the JavaScript compile (`Unknown property: L`, `Zs`, `Letter` from the three files).
- Result after the change: the same install, with this change applied to Core's source, compiles and prerenders, and all 226 rendered class names have a rule in the emitted CSS.
- Representative unchanged path: the Avatar and Markdown suites pass unchanged.
- Regression test or other mutation-sensitive proof: `unicodePropertyEscapes.source-build.test.mjs` fails on main listing the four literals, and passes here.
## Scope
- [x] One defect is restored.
- [x] Separable contradictory or unsettled tagalongs were removed or split.
- [x] No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
- [x] Public text and artifacts contain no internal Meta context.
## Testing
- `pnpm exec vitest run --project ui packages/core/src/Avatar packages/core/src/Markdown packages/core/src/unicodePropertyEscapes.source-build.test.mjs`: 50 files, 1,158 tests pass (the new test alone fails on main).
- `next build --webpack` on the clean install, no browserslist: fails on main in both passes; passes with this change (226 of 226 rendered classes have a rule).
- `pnpm -F @astryxdesign/core typecheck`, ESLint and Prettier on the touched files, `pnpm check:repo`, changeset coverage: pass.
Summary
createMarkdownHeadingLinks(), a standalone opt-in/default-off first-party identity module exported from@astryxdesign/core/Markdown/pluginsSymbol.forplugin envelope so compatible duplicate Core copies preserve namespaces#copy button, no navigation/hash/scroll mutation, canonicaluseContainerReveal, line-height-sized layout, and overflow-visible coarse hit geometryStack
Attribution
This stack carries forward the inline trailing
#permalink direction contributed by Ernest Tien in the superseded #6665. The Changeset credits both contributors; the implementation uses the standalone module architecture and copy-button behavior described above.Test plan
pnpm exec vitest run packages/core/src/Markdown/plugins/headingLinks.test.tsx packages/core/src/Markdown/plugins/headingLinks.ssr.test.tsx packages/core/src/Markdown/Markdown.test.tsx packages/core/src/Markdown/Markdown.public.test.ts packages/core/src/Outline/parseOutlineFromMarkdown.test.ts(142 tests)pnpm --filter @astryxdesign/core typecheckpnpm --filter @astryxdesign/core build@astryxdesign/core/Markdown/pluginsruntime import plus generated declaration/barrel verificationpnpm check:knowledge && pnpm check:sync && pnpm check:changesetsWriting rubric results
#6665standing references found; replaced with durable visual and interaction facts.@cixzhang