fix: open external link in new tab for navbar items
Description
Open external navigation bar's link in new tab
Validation
If clicked in the Certification and Docs in the navbar, should open it in the new tab.
Related Issues
None
Check List
- [x] I have read the Contributing Guidelines and made commit messages that follow the guideline.
- [x] I have run
npx turbo formatto ensure the code follows the style guide. - [x] I have run
npx turbo testto check if all tests are passing. - [x] I have run
npx turbo buildto check if the website builds without errors. - [x] I've covered new added functionality with unit tests if necessary.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Updated (UTC) |
|---|---|---|---|
| nodejs-org | ✅ Ready (Inspect) | Visit Preview | Mar 19, 2024 10:19pm |
Honestly, I'm not in favour of this change, because if a user wants to go to the docs and goes through nodejs.org, they'll end up with two tabs open, which will "take time" to close. I think that opening a new tab should only be done when the user needs to keep the source page open, which isn't the case here.
@AugustinMauroy That's a good point. However, I believe the expectations for most users are to open the clicked link in a new tab whenever they see a top-right arrow (↗) since it is mostly used as an indicator for a link from another site.
Either way, whatever decision will be made (open in a new tab, remove the arrow, or even keep the current behaviour), I am all for it 🙆♂️ .
@AugustinMauroy are you okay with moving this forward?
Lighthouse Results
| URL | Performance | Accessibility | Best Practices | SEO | Report |
|---|---|---|---|---|---|
| /en | 🟢 94 | 🟢 90 | 🟢 100 | 🟢 91 | 🔗 |
| /en/about | 🟢 100 | 🟢 91 | 🟢 100 | 🟢 91 | 🔗 |
| /en/about/previous-releases | 🟢 99 | 🟢 90 | 🟢 100 | 🟢 92 | 🔗 |
| /en/download | 🟢 100 | 🟠 89 | 🟢 100 | 🟢 91 | 🔗 |
| /en/blog | 🟢 100 | 🟢 90 | 🟢 100 | 🟢 92 | 🔗 |
Unit Test Coverage Report
| Lines | Statements | Branches | Functions |
|---|---|---|---|
| 80.07% (450/562) | 79.55% (144/181) | 71.17% (79/111) |
Unit Test Report
| Tests | Skipped | Failures | Errors | Time |
|---|---|---|---|---|
| 90 | 0 :zzz: | 0 :x: | 0 :fire: | 4.425s :stopwatch: |
@AugustinMauroy are you okay with moving this forward?
I'm in favor of keeping this behavior. But modifying api docs link to not have icons and blank page.
@AugustinMauroy i appreciate your thoughts but am going to merge this. it's generally common consensus that
- the arrow means you are leaving the site
- its a courteous gesture in today's tab based browsing to open blank
if you feel strongly, please block it in future discussions
that being said, some of the usage here is probably wrong (credit @ovflowd for mentioning this)