Skip to content

Fix PageHeader type issues - #6896

Merged
liuliu-dev merged 5 commits into
mainfrom
liuliu/pageheader-fix
Sep 22, 2025
Merged

Fix PageHeader type issues#6896
liuliu-dev merged 5 commits into
mainfrom
liuliu/pageheader-fix

Conversation

@liuliu-dev

@liuliu-devliuliu-dev commented Sep 22, 2025

Copy link
Copy Markdown
Contributor

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

@changeset-bot

changeset-botBot commented Sep 22, 2025

Copy link
Copy Markdown

🦋 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
NameType
@primer/styled-reactPatch
@primer/reactPatch

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-actionsgithub-actionsBot 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
@github-actions

Copy link
Copy Markdown
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-devliuliu-dev added the skip changeset This change does not need a changelog label Sep 22, 2025
@liuliu-devliuliu-dev removed the skip changeset This change does not need a changelog label Sep 22, 2025
@github-actions
github-actionsBottemporarily deployed to storybook-preview-6896 September 22, 2025 22:41 Inactive
@github-actionsgithub-actionsBot 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
Copy Markdown

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

@primer-integration

Copy link
Copy Markdown

🟢 ci completed with status success.

@github-actionsgithub-actionsBot 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 ownerSeptember 22, 2025 23:08

CopilotAI 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

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
FileDescription
packages/styled-react/src/components/PageHeader.tsxAdds missing subcomponent exports and fixes type definitions with PropsWithChildren
packages/react/src/index.tsExports new PageHeaderTitleAreaProps and PageHeaderChildrenPropTypes types
packages/react/src/tests/snapshots/exports.test.ts.snapUpdates test snapshot to reflect new exported types
packages/react/src/PageHeader/PageHeader.tsxExports TitleAreaProps type that was previously internal
.changeset/nasty-seals-carry.mdDocuments the patch-level changes for both packages

@llastflowersllastflowers 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.

✅ Thanks for fixing this!!

@liuliu-dev
liuliu-dev added this pull request to the merge queueSep 22, 2025
Merged via the queue into main with commit 5c29b01Sep 22, 2025
45 checks passed
@liuliu-dev
liuliu-dev deleted the liuliu/pageheader-fix branch September 22, 2025 23:31
@primerprimerBot mentioned this pull request Sep 22, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: passingChanges in this PR do NOT cause breaking changes in gh/gh

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@liuliu-dev@llastflowers