Skip to content

Add prop to PageHeader to allow a bottom border #5741

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Mar 25, 2025
Merged

Conversation

mperrotti
Copy link
Contributor

Relates to https://github.com/github/primer/issues/2837

Screenshot 2025-03-06 at 4 11 06 PM

Changelog

New

  • hasBorder prop on PageHeader

Changed

Removed

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

@mperrotti mperrotti requested a review from a team as a code owner March 6, 2025 21:15
@mperrotti mperrotti requested a review from joshblack March 6, 2025 21:15
Copy link

changeset-bot bot commented Mar 6, 2025

🦋 Changeset detected

Latest commit: 18f09dd

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

This PR includes changesets to release 1 package
Name Type
@primer/react Minor

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

Copy link
Contributor

github-actions bot commented Mar 6, 2025

Uh oh! @mperrotti, at least one image you shared is missing helpful alt text. Check your pull request body to fix the following violations:

  • Images should have meaningful alternative text (alt text) at line 7

Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image.

Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs.

🤖 Beep boop! This comment was added automatically by github/accessibility-alt-text-bot.

Copy link
Contributor

github-actions bot commented Mar 6, 2025

👋 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!

@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 Mar 6, 2025
Copy link
Contributor

github-actions bot commented Mar 6, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 105.57 KB (+0.09% 🔺)
packages/react/dist/browser.umd.js 105.94 KB (+0.09% 🔺)

@github-actions github-actions bot requested a deployment to storybook-preview-5741 March 6, 2025 21:20 Abandoned
@github-actions github-actions bot temporarily deployed to storybook-preview-5741 March 6, 2025 21:33 Inactive
@@ -754,6 +762,7 @@ const Navigation: React.FC<React.PropsWithChildren<NavigationProps>> = ({
aria-label={as === 'nav' ? ariaLabel : undefined}
aria-labelledby={as === 'nav' ? ariaLabelledBy : undefined}
className={clsx(enabled && classes.Navigation, className)}
data-component="PH_Navigation"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
data-component="PH_Navigation"
data-component="PageHeader.Navigation"

One suggestion that could make it more clear what the component is when coming back to this later

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PH_{Subcomponent} is the naming pattern we use for the other subcomponents. Do you still think we should change it?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we're kind of trying to move away from data-component actually.. what about just giving it a classname instead?

Copy link
Member

@TylerJDev TylerJDev Mar 19, 2025

Choose a reason for hiding this comment

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

I agree, PageHeader.Navigation is more clear, but to keep it consistent I think PH_{Subcomponent} is fine too! Would be curious about the className route too 👀 Maybe we'll want to revisit in a different PR to adjust the existing data-* attributes.

@lukasoppermann
Copy link
Contributor

@mperrotti somehow I can't add this comment to the code, but we need this: hasBorder={args.hasBorder} on the Playground story: https://github.com/primer/react/pull/5741/files#diff-38be7109ab257cb99d6f1950aa251d530e55a99c8705aaf94ff68f2d98c82897R195

@lukasoppermann
Copy link
Contributor

Also it is buggy for those two cases:
CleanShot 2025-03-07 at 10 21 54@2x
CleanShot 2025-03-07 at 10 22 25@2x

I wonder if we should disable those cases, so that lines can not be added when a Navigation or description is enabled?

But for a normal text description it could be useful.

@primer primer deleted a comment from github-actions bot Mar 7, 2025
@mperrotti
Copy link
Contributor Author

@lukasoppermann - I thought I handled those cases already, but I must have broke something. I'll take another look.

Copy link
Contributor

@emilybrick emilybrick left a comment

Choose a reason for hiding this comment

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

Snapshots look good here & in storybook
Screenshot 2025-03-19 at 1 01 56 PM

I'm not sure if the naming pattern discussion is resolved, but story + snapshots lgtm 👍

@mperrotti mperrotti enabled auto-merge (squash) March 19, 2025 17:10
Copy link
Member

@TylerJDev TylerJDev left a comment

Choose a reason for hiding this comment

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

LGTM!

@TylerJDev TylerJDev disabled auto-merge March 25, 2025 17:31
@TylerJDev TylerJDev added this pull request to the merge queue Mar 25, 2025
@TylerJDev TylerJDev removed this pull request from the merge queue due to a manual request Mar 25, 2025
@mperrotti mperrotti added this pull request to the merge queue Mar 25, 2025
Merged via the queue into main with commit d32dd27 Mar 25, 2025
44 checks passed
@mperrotti mperrotti deleted the mp/pageheader-hasBorder branch March 25, 2025 17:44
@primer primer bot mentioned this pull request Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants