Skip to content

Remove unused legacy Headings component#73661

Open
levadadenys wants to merge 1 commit into
stagingfrom
claude/funny-pasteur-sqd0gu
Open

Remove unused legacy Headings component#73661
levadadenys wants to merge 1 commit into
stagingfrom
claude/funny-pasteur-sqd0gu

Conversation

@levadadenys

Copy link
Copy Markdown
Contributor

Delete apps/src/legacySharedComponents/Headings.jsx and its sibling story file. Both are unused.

  • Headings.jsx (108 lines) exports Heading1, Heading2, Heading3 and their style objects. It is marked @deprecated Use DSCO Typography instead and has zero imports across the monorepo. All name hits for Heading1/Heading2/Heading3 resolve to @code-dot-org/component-library/typography (a different origin) or to apps/tools/codemod/typography-to-mui.js (which migrates callers off this file).
  • Headings.story.jsx does not import Headings.jsx — it renders MUI Typography directly. Once Headings.jsx is gone, the story is an orphan living in legacySharedComponents/ that documents a component that no longer exists there. MUI Typography examples are already covered by apps/src/templates/temp/typography/MuiTypography.story.tsx.

Note for the reviewer: Headings.jsx was re-added on 2026-06-13 via commit 58a1eca ("Revert of Revert: RE-158 UI polish…"). Please confirm the revert-of-revert was intentional (i.e. no consumer is expected to land soon that depends on this file) before merging.

Keeping apps/tools/codemod/typography-to-mui.js. The codemod migrates DSCO Typography wrappers (Heading1..6, BodyOneText..FourText, EmText, StrongText, Figcaption) to MUI Typography. Those wrappers still ship from frontend/packages/component-library/src/typography/ and have at least one live consumer — frontend/packages/markdown/src/components/Markdown.tsx imports Heading1..4, StrongText, EmText from the DSCO. The codemod's own TODO says to delete it "when all DSCO Typography components have been replaced with MUI Typography" — we are not there yet.

Links

  • Jira:

Testing story

Deletion-only change, no runtime surface to drive. Verification is compile/import based:

  • Grepped Headings.jsx, legacySharedComponents/Headings, and every exported symbol (Heading1, Heading2, Heading3, h1Style, h2Style, h3Style, h3RebrandingStyle) across apps/, frontend/, dashboard/, lib/, shared/, and the root — zero import hits.
  • Pre-commit hook (./tools/hooks/pre-commit) clean.
  • CI (drone) will exercise the apps webpack build and unit/integration suites.

Generated by Claude Code

apps/src/legacySharedComponents/Headings.jsx has zero imports across the
monorepo and is marked "@deprecated Use DSCO Typography instead". Its
sibling Headings.story.jsx renders MUI Typography directly and does not
import Headings.jsx, so it is orphaned once the component is removed.
Delete both. MUI Typography examples are already covered by
apps/src/templates/temp/typography/MuiTypography.story.tsx.

The apps/tools/codemod/typography-to-mui.js codemod is kept: it migrates
DSCO Typography wrappers (Heading1..6, BodyOneText..FourText, EmText,
StrongText, Figcaption) to MUI Typography, and those wrappers still ship
from frontend/packages/component-library/typography and have at least
one live consumer (frontend/packages/markdown/src/components/Markdown.tsx).

Note: Headings.jsx was re-added on 2026-06-13 via a "Revert of Revert"
commit (58a1eca). Confirm that revert-of-revert was intentional before
merging.
@levadadenys levadadenys requested review from a team, Copilot and etaderhold and removed request for a team July 3, 2026 11:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Removes an unused legacy headings wrapper (Heading1/Heading2/Heading3) and its orphaned Storybook story from the apps/ (webpack) codebase, aligning with the ongoing shift toward DSCO/MUI Typography.

Changes:

  • Delete apps/src/legacySharedComponents/Headings.jsx (deprecated legacy <h1>/<h2>/<h3> wrappers and style constants).
  • Delete apps/src/legacySharedComponents/Headings.story.jsx (MUI Typography examples that no longer correspond to a local component).

Reviewed changes

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

File Description
apps/src/legacySharedComponents/Headings.jsx Removes deprecated legacy heading components and style exports with no remaining imports.
apps/src/legacySharedComponents/Headings.story.jsx Removes a Storybook story that documents MUI Typography rather than any local legacySharedComponents component.

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.

3 participants