Skip to content

chore(design-system): relocate tight-scope components to page-scoped _components/ #18190

@myelinated-wackerow

Description

@myelinated-wackerow

A component-disposition audit identified components in src/components/ with 2+ consumers whose consumer set is bound to a single page-area scope. Per the project's _components/ convention, they should live next to their consumers instead of in the shared src/components/ namespace.

Single PR. All items move + import-path updates + verify build/type-check.

Items

  • src/components/Translatathon/ -> app/[locale]/contributing/translation-program/translatathon/_components/

    • Consumers: app/[locale]/contributing/translation-program/translatathon/leaderboard/page.tsx, src/layouts/md/Translatathon.tsx
    • Multiple .tsx files plus a constants.ts
    • Audit MDX-side references before moving: the MD layout consumer means a few MDX content files may reference these as shortcodes via src/layouts/md/Translatathon.tsx. Verify before the git mv.
  • src/components/Search/ -> src/components/Nav/Search/

    • Consumers: Nav/DesktopNav.tsx, Nav/MobileNav.tsx (relative imports)
    • Already a Nav-scoped widget; move into the Nav unit
  • src/components/LanguagePicker/ -> src/components/Nav/LanguagePicker/

    • Consumers: Nav/DesktopNav.tsx, Nav/MobileMenu/MobileMenuContent.tsx
    • Same pattern as Search

Verification before merge

  • pnpm lint passes
  • npx tsc --noEmit passes
  • pnpm build passes
  • All import sites of moved components updated
  • No git grep "from \"@/components/<MovedName>" hits remaining

Out of scope

  • Single-use components without a clear common page prefix -- tracked separately (single-use inline/relocate issues)
  • Components in the storied or shared-infra buckets -- no relocation
  • New stories or refactors of the moved components -- this is move-only

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: StaleThis issue is stale because it has been open 30 days with no activity.design systemthis label will be used in all issues related to design systemneeds triage 📥This issue needs triaged before being worked on

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions