Skip to content

Conversation

liuliu-dev
Copy link
Contributor

@liuliu-dev liuliu-dev commented Sep 22, 2025

The PageHeader change PR is causing integration test failing.

Error message:

Error: packages/issue-viewer/components/header/HeaderViewer.tsx(65,21): error TS2339: Property 'TitleArea' does not exist on type 'ForwardRefComponent<"div", PageHeaderProps> & { Actions: ({ sx, ...rest }: PageHeaderActionsProps) => Element; Title: ({ sx, ...rest }: PageHeaderTitleProps) => Element; }'.
Error: packages/issue-viewer/components/header/HeaderViewer.tsx(66,12): error TS2322: Type '{ children: Element[]; as: "h1" | "h2" | "h3" | "h4" | "h5" | "h6"; sx: { fontSize: string | number | SystemCssProperties | CSSPseudoSelectorProps | ... 8 more ... | undefined; mr: number | undefined; }; className: string; }' is not assignable to type 'IntrinsicAttributes & { as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | undefined; } & ChildrenPropTypes & SxProp'.
  Property 'children' does not exist on type 'IntrinsicAttributes & { as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | undefined; } & ChildrenPropTypes & SxProp'.
Error: packages/issue-viewer/components/header/HeaderViewer.tsx(115,22): error TS2339: Property 'TitleArea' does not exist on type 'ForwardRefComponent<"div", PageHeaderProps> & { Actions: ({ sx, ...rest }: PageHeaderActionsProps) => Element; Title: ({ sx, ...rest }: PageHeaderTitleProps) => Element; }'.
Error: packages/issue-viewer/components/header/HeaderViewer.tsx(117,21): error TS2339: Property 'ContextArea' does not exist on type 'ForwardRefComponent<"div", PageHeaderProps> & { Actions: ({ sx, ...rest }: PageHeaderActionsProps) => Element; Title: ({ sx, ...rest }: PageHeaderTitleProps) => Element; }'.
Error: packages/issue-viewer/components/header/HeaderViewer.tsx(118,23): error TS2339: Property 'ContextAreaActions' does not exist on type 'ForwardRefComponent<"div", PageHeaderProps> & { Actions: ({ sx, ...rest }: PageHeaderActionsProps) => Element; Title: ({ sx, ...rest }: PageHeaderTitleProps) => Element; }'.
Error: packages/issue-viewer/components/header/HeaderViewer.tsx(120,24): error TS2339: Property 'ContextAreaActions' does not exist on type 'ForwardRefComponent<"div", PageHeaderProps> & { Actions: ({ sx, ...rest }: PageHeaderActionsProps) => Element; Title: ({ sx, ...rest }: PageHeaderTitleProps) => Element; }'.
Error: packages/issue-viewer/components/header/HeaderViewer.tsx(121,22): error TS2339: Property 'ContextArea' does not exist on type 'ForwardRefComponent<"div", PageHeaderProps> & { Actions: ({ sx, ...rest }: PageHeaderActionsProps) => Element; Title: ({ sx, ...rest }: PageHeaderTitleProps) => Element; }'.
Error: packages/issue-viewer/components/header/HeaderViewer.tsx(125,23): error TS2339: Property 'ContextArea' does not exist on type 'ForwardRefComponent<"div", PageHeaderProps> & { Actions: ({ sx, ...rest }: PageHeaderActionsProps) => Element; Title: ({ sx, ...rest }: PageHeaderTitleProps) => Element; }'.
Error: packages/issue-viewer/components/header/HeaderViewer.tsx(136,24): error TS2339: Property 'ContextArea' does not exist on type 'ForwardRefComponent<"div", PageHeaderProps> & { Actions: ({ sx, ...rest }: PageHeaderActionsProps) => Element; Title: ({ sx, ...rest }: PageHeaderTitleProps) => Element; }'.
Error: Process completed with exit code 2.

The issue is that sub components like TitleArea, ContextArea, and ContextAreaActions are not exported from styled-react, and some of the Props are not wrapped by PropsWithChildren

Copy link

changeset-bot bot commented Sep 22, 2025

🦋 Changeset detected

Latest commit: 87a4898

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@primer/styled-react Patch
@primer/react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Sep 22, 2025
Copy link
Contributor

👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks!

@liuliu-dev liuliu-dev added the skip changeset This change does not need a changelog label Sep 22, 2025
@liuliu-dev liuliu-dev removed the skip changeset This change does not need a changelog label Sep 22, 2025
@github-actions github-actions bot added integration-tests: failing Changes in this PR cause breaking changes in gh/gh and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Sep 22, 2025
@primer-integration
Copy link

👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/3046

@primer-integration
Copy link

🟢 ci completed with status success.

@github-actions github-actions bot added integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh and removed integration-tests: failing Changes in this PR cause breaking changes in gh/gh labels Sep 22, 2025
@liuliu-dev liuliu-dev marked this pull request as ready for review September 22, 2025 23:08
@liuliu-dev liuliu-dev requested a review from a team as a code owner September 22, 2025 23:08
Copy link
Contributor

@Copilot Copilot AI left a comment

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 fixes TypeScript type issues in the PageHeader component that were causing integration test failures. The primary issue was missing subcomponent exports and incorrect type definitions in the styled-react package.

  • Exports missing PageHeader subcomponents (TitleArea, ContextArea, etc.) from styled-react
  • Adds PropsWithChildren wrapper to PageHeaderTitleProps and creates PageHeaderTitleAreaProps
  • Exports the new TitleAreaProps type and ChildrenPropTypes from the main react package

Reviewed Changes

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

Show a summary per file
File Description
packages/styled-react/src/components/PageHeader.tsx Adds missing subcomponent exports and fixes type definitions with PropsWithChildren
packages/react/src/index.ts Exports new PageHeaderTitleAreaProps and PageHeaderChildrenPropTypes types
packages/react/src/tests/snapshots/exports.test.ts.snap Updates test snapshot to reflect new exported types
packages/react/src/PageHeader/PageHeader.tsx Exports TitleAreaProps type that was previously internal
.changeset/nasty-seals-carry.md Documents the patch-level changes for both packages

Copy link
Contributor

@llastflowers llastflowers left a comment

Choose a reason for hiding this comment

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

✅ Thanks for fixing this!!

@liuliu-dev liuliu-dev added this pull request to the merge queue Sep 22, 2025
Merged via the queue into main with commit 5c29b01 Sep 22, 2025
45 checks passed
@liuliu-dev liuliu-dev deleted the liuliu/pageheader-fix branch September 22, 2025 23:31
@primer primer bot mentioned this pull request Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants