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

fix: convert incorrect breadcrumb links to opaque spans #7626

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dario-piotrowicz
Copy link
Contributor

Description

It's pretty minor but I figured I could just open a PR to fix this small UI bug I noticed 🙂

The fact is that in pages with breadcrumbs at the bottom of the screen most of the time the first breadcrumbs link is not really a valid link and clicking it results in a hard reload of the app:

See:
issue

My changes here make breadcrumb items with falsy hrefs simple text elements instead of a links, for good measure they are also dimmed to make it more evident that they are not clickable

Validation

I manually validated this check with npm run dev and also npm run build && npm run start

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run npm run format to ensure the code follows the style guide.
  • I have run npm run test to check if all tests are passing.
  • I have run npx turbo build to check if the website builds without errors.
  • I've covered new added functionality with unit tests if necessary.

@Copilot Copilot bot review requested due to automatic review settings April 6, 2025 23:39
@dario-piotrowicz dario-piotrowicz requested a review from a team as a code owner April 6, 2025 23:39
Copy link

vercel bot commented Apr 6, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nodejs-org ✅ Ready (Inspect) Visit Preview Apr 7, 2025 0:31am

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.

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

@avivkeller
Copy link
Member

Can you add a linkless story?

Copy link
Contributor

github-actions bot commented Apr 6, 2025

Lighthouse Results

URL Performance Accessibility Best Practices SEO Report
/en 🟢 99 🟢 100 🟢 100 🟢 91 🔗
/en/about 🟢 100 🟢 100 🟢 100 🟢 91 🔗
/en/about/previous-releases 🟢 99 🟢 100 🟢 100 🟢 92 🔗
/en/download 🟢 96 🟢 100 🟢 100 🟢 91 🔗
/en/blog 🟢 100 🟢 100 🟢 96 🟢 92 🔗

Copy link
Contributor

github-actions bot commented Apr 6, 2025

Unit Test Coverage Report

Title Lines Statements Branches Functions
@node-core/ui-components Coverage: 95%
95.83% (161/168) 77.86% (102/131) 88.57% (31/35)
@nodejs/website Coverage: 87%
84.73% (494/583) 76.03% (165/217) 86.99% (107/123)
Title Tests Skipped Failures Errors Time
@node-core/ui-components 24 0 💤 0 ❌ 0 🔥 5.178s ⏱️
@nodejs/website 156 0 💤 0 ❌ 0 🔥 6.564s ⏱️

@dario-piotrowicz
Copy link
Contributor Author

Can you add a linkless story?

Thanks for the suggestion 🙂

Sure, done 🙂👍

@dario-piotrowicz
Copy link
Contributor Author

dario-piotrowicz commented Apr 7, 2025

mh... actually I might need to amend something, the last item should be styled as active even if it doesn't have an href right? 🤔

Screenshot at 2025-04-07 01-23-44

The About Node.js breadcrumb item should be styled as active, right? 🤔

@dario-piotrowicz
Copy link
Contributor Author

mh... actually I might need to amend something, the last item should be styled as active even if it doesn't have an href right? 🤔

addressed 👍 614899a (the solution is a bit ugly but I am not sure if much better can be done here 🤔)

Copy link
Member

@ovflowd ovflowd left a comment

Choose a reason for hiding this comment

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

This is weird. All breadcrumb entries should be links. The fact that About Node.js is causing a hard refresh is a bug.

We shouldn't do this; we should investigate why the link wasn't a link to begin with.

@dario-piotrowicz
Copy link
Contributor Author

why the link wasn't a link to begin with.

It's because of the site navigation structure, for example see:

Screenshot at 2025-04-07 10-50-00

Screenshot at 2025-04-07 10-51-12

there is actually no getting started page (see: https://nodejs.org/en/learn/getting-started/)

so if the breadcrumb for getting started were a link what page would it point to?

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.

3 participants