Skip to content

docs: link the successor inline in the deprecation callout - #2962

Merged
maaaathis merged 2 commits into
mainfrom
claude/docs-deprecation-notice-b3441d
Aug 27, 2026
Merged

docs: link the successor inline in the deprecation callout#2962
maaaathis merged 2 commits into
mainfrom
claude/docs-deprecation-notice-b3441d

Conversation

@mfal

@mfal mfal commented Aug 27, 2026

Copy link
Copy Markdown
Member

What & why

The deprecation callout rendered the successor component as a separate
Ersatz: line below the notice text:

Deprecated
Align wurde in Combine umbenannt und wird in einer zukünftigen Major-Version entfernt.
Ersatz: Combine

Two lines saying the same thing. The successor belongs in the sentence that
names it:

Deprecated
Align wurde in Combine umbenannt und wird in einer zukünftigen Major-Version entfernt.

deprecationNotice frontmatter is now Markdown. ComponentContent serializes
it server-side (serialize() with remarkGfm, same options as the page
content) and ComponentStatusCallout renders it with MDXRemote and
createCustomComponents() — so a link in the notice becomes a Flow Link inline
inside a RouterProvider and routes client-side, exactly like a link in the
body.

replacedBy loses its only consumer and goes away, together with
resolveReplacedBy and ReplacementLink.

Affects the two deprecated component pages: Align and SegmentedControl.

Trade-off a reviewer should weigh

replacedBy was not just the href source — it validated the target at build
time, and an unknown component name failed the build. A hand-written href in
the notice has no such guard. This was an explicit call: the docs app validates
no internal link anywhere today (five are already dead), so it adds no new class
of breakage. A content-wide link check would be the real fix, and is its own
change.

Verification

tsc --noEmit and ESLint clean. Checked both pages in the dev server: the
notice renders as one line with the successors inline, no console errors, and
clicking the link navigates. apps/docs has no test suite.

Base branch & title

docs: → base main. Docs-only, so the merge publishes nothing.

Checklist

  • PR title is a Conventional Commit and matches the base branch above
  • pnpm lint is clean (0 errors; the 119 selector-max-type warnings are
    pre-existing) and pnpm affected:test runs no tasks — apps/docs has no
    test targets
  • Generated code is committed (no generators touched)
  • User-facing strings added to both de-DE and en-US locale files
    (n/a — docs content, not component UI text)
  • Docs updated if a public API changed; intentional visual changes get
    updated snapshots / the update-screenshots label (n/a — no component
    renders changed)

The deprecation callout rendered the successor as a separate "Ersatz:" line
below the notice text. Reading it meant parsing two sentences that say the
same thing. The successor belongs in the sentence that names it.

`deprecationNotice` is now rendered as MDX with the same component mapping the
page content uses, so a Markdown link in the notice becomes a Flow `Link` and
routes client-side. `replacedBy` loses its only consumer and goes away with
`resolveReplacedBy` and `ReplacementLink`.

Trade-off: `replacedBy` also validated its target at build time — an unknown
component name failed the build. A hand-written href in the notice has no such
guard. Accepted deliberately; the docs app validates no internal link anywhere
today, so this adds no new class of breakage.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@mfal
mfal requested a review from a team August 27, 2026 07:55
@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for ./packages/components/

Status Category Percentage Covered / Total
🔵 Lines 76% 627 / 825
🔵 Statements 75.91% 643 / 847
🔵 Functions 77.95% 145 / 186
🔵 Branches 66.66% 298 / 447
File CoverageNo changed files found.
Generated in workflow #6348 for commit c6125e3 by the Vitest Coverage Report Action

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Preview Deployment

Preview environments are ready:

Type URL
docs pr-2962.docs.review.flow-components.de
storybook pr-2962.storybook.review.flow-components.de

Images:

  • docs: ghcr.io/mittwald/flow/docs:pr-2962
  • storybook: ghcr.io/mittwald/flow/storybook:pr-2962

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors how deprecated component pages in apps/docs render their deprecation notice so the successor component can be linked inline (Markdown/MDX), and removes the now-redundant replacedBy frontmatter + resolver.

Changes:

  • Compile deprecationNotice frontmatter to an MDXRemoteSerializeResult on the server and render it in the client-side status callout via MDXRemote + createCustomComponents().
  • Remove replacedBy frontmatter and its build-time resolver (resolveReplacedBy / ReplacementLink) since the successor link now lives in the notice text.
  • Update the deprecated component pages (Align, SegmentedControl) to link successors inline.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
apps/docs/src/lib/mdx/MdxFile.ts Updates frontmatter docs for deprecationNotice (now Markdown) and removes replacedBy metadata.
apps/docs/src/lib/componentStatus/replacedBy.ts Deletes the replacedBy resolver and related types.
apps/docs/src/lib/componentStatus/index.ts Re-exports the new deprecation notice serializer instead of replacedBy utilities.
apps/docs/src/lib/componentStatus/deprecationNotice.ts Adds server-side serialization for Markdown/MDX deprecation notices.
apps/docs/src/lib/componentStatus/ComponentStatusCallout.tsx Renders the serialized notice via MDXRemote using the shared MDX custom components.
apps/docs/src/content/04-components/structure/align/index.mdx Converts deprecation notice to include an inline successor link; removes replacedBy.
apps/docs/src/content/04-components/form-controls/segmented-control/index.mdx Converts deprecation notice to include inline successor links; removes replacedBy.
apps/docs/src/app/_components/layout/ComponentContent/ComponentContent.tsx Serializes deprecationNotice server-side and stops resolving/passing replacedBy.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread apps/docs/src/lib/componentStatus/deprecationNotice.ts Outdated
Comment thread apps/docs/src/lib/componentStatus/ComponentStatusCallout.tsx
…styling

Two review findings on the MDX notice:

`deprecationNotice:` with nothing behind it is YAML `null`, and an empty string
is a string — both passed the `=== undefined` check and reached `serialize()`,
so the callout rendered an empty body instead of the generic fallback
sentence. Blank copy now resolves to `undefined`.

The page-body MDX mapping caps paragraphs at `--max-text-width` (960px), the
article column's measure. Reusing it wholesale applied that cap inside the
callout, wrapping the notice narrower than the alert it sits in. `p` is now
overridden to a plain `Text` so the callout's layout no longer depends on
page-body styling; the link and inline-code mapping stays shared.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@maaaathis
maaaathis merged commit 3319c70 into main Aug 27, 2026
11 checks passed
@maaaathis
maaaathis deleted the claude/docs-deprecation-notice-b3441d branch August 27, 2026 11:24
Sign up for free to 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.

4 participants