Skip to content
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

Match chrome (header and sidebar nav) to new docs #790

Merged
merged 43 commits into from
Dec 9, 2024

Conversation

mperrotti
Copy link
Contributor

@mperrotti mperrotti commented Oct 16, 2024

Closes https://github.com/github/primer/issues/4166

We should wait until the new docs site is launched before merging this. Update 02 Dec 2024: soft launch is happening sometime this week - likely Friday 06 Dec 2024.

Summary

Updates the design of the docs site navigation to match the new Primer docs site (https://github.com/github/primer-docs) to give a more "seamless" feel when navigating between the different sub-sites.

We chose not to make these changes in doctocat to avoid accidentally breaking things downstream.

List of notable changes:

  • Header navigation has a new layout
  • Search input moved to the sidebar and functions like the search input in the new Primer docs.

What should reviewers focus on?

Confirm that this matches the design of the new Primer docs site.

Steps to test:

  1. Run the docs site
  2. Look at the navigation at various viewports

Supporting resources (related issues, external links, etc):

Contributor checklist:

  • All new and existing CI checks pass
  • Tests prove that the feature works and covers both happy and unhappy paths
  • Any drop in coverage, breaking changes or regressions have been documented above
  • New visual snapshots have been generated / updated for any UI changes
  • All developer debugging and non-functional logging has been removed
  • Related issues have been referenced in the PR description

Reviewer checklist:

  • Check that pull request and proposed changes adhere to our contribution guidelines and code of conduct
  • Check that tests prove the feature works and covers both happy and unhappy paths
  • Check that there aren't other open Pull Requests for the same update/change

Screenshots:

Note: these have become outdated as we've iterated, but they're pretty close

Child pages

Before After
Screenshot 2024-10-16 at 11 32 20 AM Screenshot 2024-10-16 at 11 19 11 AM
Screenshot 2024-10-16 at 11 32 34 AM Screenshot 2024-10-16 at 11 22 20 AM

Landing page

Before After
Screenshot 2024-10-16 at 11 32 20 AM Screenshot 2024-10-16 at 11 19 11 AM
Screenshot 2024-10-16 at 11 32 34 AM Screenshot 2024-10-16 at 11 22 20 AM

Copy link

changeset-bot bot commented Oct 16, 2024

⚠️ No Changeset found

Latest commit: 20734ae

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copy link
Contributor

github-actions bot commented Oct 16, 2024

🟢 No design token changes found

Copy link
Contributor

github-actions bot commented Oct 16, 2024

⚠️ Visual differences found

Our visual comparison tests found UI differences.

Please review the differences by using the test artifacts to ensure that the changes were intentional.

Artifacts can be downloaded and reviewed locally.

Download links are available at the bottom of the workflow summary screen.

Example:

artifacts section of workflow run

If the changes are expected, please run npm run test:visual:update-snapshots to replace the previous fixtures.

Review visual differences

Copy link

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

Hey there! This looks awesome! Leaving some feedback from the deployment link.

Screenshot 2024-10-21 at 12 05 34 PM

I believe this should be Primer / Brand UI, since that's the page the user is currently on, and Brand UI should not be listed to the right with the other links.

Is it possible to update the side nav in this PR to match new docs as well? Main things missing is Mona Sans. If the section headers aren't clickable, I think they're fine left in gray/muted color.

Copy link

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

This looks awesome! Thank you so much 🙌
chrome-capture-2024-10-22 (1)

@emilybrick
Copy link

This looks great! I'm sorry, I mentioned in Slack but I should have put it here -

can we match the max-width of the brand page to the proiduct UI page, and add margin: 0 auto? Right now, on wide screens, they are different widths.

The max-width of the product UI page is actually being calculated based on the cards below (each card component has a max width built in), but I think it ends up around...1340px max-width. I tested this in the inspector and that appears to be the right size.

Screenshot 2024-10-23 at 10 28 53 PM Screenshot 2024-10-23 at 10 28 56 PM

export function Navigation() {
const activeItem = navItems.find((item) => item.label === 'Brand UI')
const otherItems = navItems.filter((item) => item.label !== 'Brand UI')
const sortedNavItems = activeItem ? [activeItem, ...otherItems] : otherItems
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we use consistent ordering given that this is a navigation menu shared across all docs sites?

E.g. in product docs, the product link comes first, but in brand docs the brand link is first. I'd expect them to stay the same so perhaps they don't need to be sorted at all?

Screenshot 2024-12-05 at 14 29 31

Screenshot 2024-12-05 at 14 26 11

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Forgot to change this when we changed the design of the top nav. Pushing up a fix.

Choose a reason for hiding this comment

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

Agreed - @mperrotti and I actually spoke about this last night. Will fix before it gets merged.

@emilybrick
Copy link

Note for follow up (I don't think we need to add it to this PR) - let's have consistent hover states on the top nav items.

Product UI nav item hover state:
Screenshot 2024-12-05 at 11 04 00 AM

Brand UI nav items don't have a hover state currently ☝️

Copy link

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

Approving assuming we can fix the suggestions mentioned. Thank you!!

Left a small comment here: #790 (comment)

@mperrotti
Copy link
Contributor Author

@emilybrick - that's an easy change to bring into here. I'll add that and then merge :)

I think I just styled with CSS variables that don't exist in Primer Brand.

@mperrotti
Copy link
Contributor Author

@rezrah - any idea what could be causing this NPM error in CI?

Run npx json -I -f cra-test/tsconfig.json -e 'this.exclude=["node_modules", "**/*.cy.ts"]'
npm warn exec The following package was not found and will be installed: [email protected]
json: error: ENOENT: no such file or directory, open 'cra-test/tsconfig.json'

@rezrah
Copy link
Collaborator

rezrah commented Dec 9, 2024

@rezrah - any idea what could be causing this NPM error in CI?

They're unrelated to your changes @mperrotti - feel free to merge your PR when ready.

Several integration tests started failing at the same time for different reasons. I'll take a look at fixing those later this week.

@mperrotti mperrotti merged commit 85a82b1 into main Dec 9, 2024
16 of 18 checks passed
@mperrotti mperrotti deleted the mp/match-header-to-new-docs branch December 9, 2024 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants