Skip to content

Add prop to PageHeader to allow a bottom border - #5741

Merged
mperrotti merged 14 commits into
mainfrom
mp/pageheader-hasBorder
Mar 25, 2025
Merged

Add prop to PageHeader to allow a bottom border#5741
mperrotti merged 14 commits into
mainfrom
mp/pageheader-hasBorder

Conversation

@mperrotti

Copy link
Copy Markdown
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 ownerMarch 6, 2025 21:15
@mperrotti
mperrotti requested a review from joshblackMarch 6, 2025 21:15
@changeset-bot

changeset-botBot commented Mar 6, 2025

Copy link
Copy Markdown

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

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

Copy link
Copy Markdown
Contributor

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.

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

@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 Mar 6, 2025
@github-actions

github-actionsBot commented Mar 6, 2025

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
packages/react/dist/browser.esm.js105.57 KB (+0.09% 🔺)
packages/react/dist/browser.umd.js105.94 KB (+0.09% 🔺)

@github-actions
github-actionsBot requested a deployment to storybook-preview-5741 March 6, 2025 21:20 Abandoned
@github-actions
github-actionsBottemporarily deployed to storybook-preview-5741 March 6, 2025 21:33 Inactive
Comment threadpackages/react/src/PageHeader/PageHeader.tsx Outdated
aria-label={as === 'nav' ? ariaLabel : undefined}
aria-labelledby={as === 'nav' ? ariaLabelledBy : undefined}
className={clsx(enabled && classes.Navigation, className)}
data-component="PH_Navigation"

Copy link
Copy Markdown
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
Copy Markdown
ContributorAuthor

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
Copy Markdown
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?

@TylerJDevTylerJDevMar 19, 2025

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
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.

@primerprimer deleted a comment from github-actionsBotMar 7, 2025
Co-authored-by: Josh Black <joshblack@github.com>
@mperrotti

Copy link
Copy Markdown
ContributorAuthor

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

@primer
primerBot requested a review from emilybrickMarch 18, 2025 21:03
@github-actionsgithub-actionsBot removed the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Mar 18, 2025
@github-actions
github-actionsBottemporarily deployed to storybook-preview-5741 March 18, 2025 21:09 Inactive
@github-actions
github-actionsBottemporarily deployed to storybook-preview-5741 March 18, 2025 21:23 Inactive
@mperrottimperrotti added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Mar 18, 2025
@github-actionsgithub-actionsBot removed the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Mar 18, 2025
@github-actions
github-actionsBottemporarily deployed to storybook-preview-5741 March 19, 2025 14:53 Inactive

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

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

@TylerJDevTylerJDev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@github-actions
github-actionsBottemporarily deployed to storybook-preview-5741 March 21, 2025 13:52 Inactive
@mperrottimperrotti added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Mar 21, 2025
@github-actionsgithub-actionsBot removed the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Mar 21, 2025
@github-actions
github-actionsBottemporarily deployed to storybook-preview-5741 March 25, 2025 16:06 Inactive
@github-actions
github-actionsBottemporarily deployed to storybook-preview-5741 March 25, 2025 17:17 Inactive
@TylerJDev
TylerJDev disabled auto-merge March 25, 2025 17:31
@TylerJDev
TylerJDev added this pull request to the merge queueMar 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 queueMar 25, 2025
Merged via the queue into main with commit d32dd27Mar 25, 2025
@mperrotti
mperrotti deleted the mp/pageheader-hasBorder branch March 25, 2025 17:44
@primerprimerBot mentioned this pull request Mar 25, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: recommendedThis 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

@mperrotti@lukasoppermann@emilybrick@joshblack@langermank@TylerJDev