nodejs.org icon indicating copy to clipboard operation
nodejs.org copied to clipboard

fix: added ellipsis for long content in breadcrumb

Open TenzDelek opened this issue 1 year ago • 12 comments

Description

added ellipsis for the long content in the breadcrumb to improve the layout shifting and in some case, breaking of the breadcrumb into next line.

Validation

before: image

after: image

Other Changes

  • Layout is shifted toward the left.

Related Issues

Fixes #6754

Check List

  • [x] I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • [x] I have run npm run format to ensure the code follows the style guide.
  • [x] I have run npm run test to check if all tests are passing.
  • [x] 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.

TenzDelek avatar Jun 03 '24 05:06 TenzDelek

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

Name Status Preview Updated (UTC)
nodejs-org ✅ Ready (Inspect) Visit Preview Jul 21, 2024 3:17pm

vercel[bot] avatar Jun 03 '24 05:06 vercel[bot]

Lighthouse Results

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

github-actions[bot] avatar Jun 03 '24 10:06 github-actions[bot]

Unit Test Coverage Report

Lines Statements Branches Functions
Coverage: 92%
90.67% (593/654) 76.08% (175/230) 94.57% (122/129)

Unit Test Report

Tests Skipped Failures Errors Time
131 0 :zzz: 0 :x: 0 :fire: 5.476s :stopwatch:

github-actions[bot] avatar Jun 03 '24 10:06 github-actions[bot]

Can we update the code so that it attempts to use as much of the available width as possible?

image

As you can see on this screenshot, there's still available space 👀

ovflowd avatar Jun 03 '24 10:06 ovflowd

Can we update the code so that it attempts to use as much of the available width as possible?

image As you can see on this screenshot, there's still available space 👀

hmm, seems interesting, in my viewport, the display is getting to it full. (maybe it depends on resolution of the screen) image what might be the appropriate length because for ellipsis to get trigger i believe we need a fix width (current implementation uses max-w-96 (384px)

TenzDelek avatar Jun 03 '24 10:06 TenzDelek

Can we update the code so that it attempts to use as much of the available width as possible?

image

As you can see on this screenshot, there's still available space 👀

hmm, seems interesting, in my viewport, the display is getting to it full. (maybe it depends on resolution of the screen)

image

what might be the appropriate length because for ellipsis to get trigger i believe we need a fix width (current implementation uses max-w-96 (384px)

max-w-full should work? Which sets the width to 100%; You dont need to define a static width for ellipsis to work.

ovflowd avatar Jun 03 '24 10:06 ovflowd

Can we update the code so that it attempts to use as much of the available width as possible?

image

As you can see on this screenshot, there's still available space 👀

hmm, seems interesting, in my viewport, the display is getting to it full. (maybe it depends on resolution of the screen) image what might be the appropriate length because for ellipsis to get trigger i believe we need a fix width (current implementation uses max-w-96 (384px)

max-w-full should work? Which sets the width to 100%; You dont need to define a static width for ellipsis to work.

the max-w-full doesn't seem to work. it is instead shifting the width further making the right panel smaller. image i believe from what i have seen, we are doing is making a fix length for a individual breaditem and applying the truncate to it. but what we oversight is that how we can make it truncate when it reaches the width like here the overall breadcrumb. (i hope this make sense haha) i will again look into it and get back , thank you for pointing this out

TenzDelek avatar Jun 03 '24 10:06 TenzDelek

Can we update the code so that it attempts to use as much of the available width as possible?

image

As you can see on this screenshot, there's still available space 👀

hmm, seems interesting, in my viewport, the display is getting to it full. (maybe it depends on resolution of the screen) image what might be the appropriate length because for ellipsis to get trigger i believe we need a fix width (current implementation uses max-w-96 (384px)

max-w-full should work? Which sets the width to 100%; You dont need to define a static width for ellipsis to work.

the max-w-full doesn't seem to work. it is instead shifting the width further making the right panel smaller. image i believe from what i have seen, we are doing is making a fix length for a individual breaditem and applying the truncate to it. but what we oversight is that how we can make it truncate when it reaches the width like here the overall breadcrumb. (i hope this make sense haha) i will again look into it and get back , thank you for pointing this out

Im pretty sure what Im referring to is possible, you might just need to investigate a bit more xD

ovflowd avatar Jun 03 '24 10:06 ovflowd

hey @ovflowd Following up on our discussion about the breadcrumb layout, I've implemented the suggested changes. However, I've encountered an issue where extensive text in the breadcrumb section seems to be causing the right panel to shrink in width rather than truncating with an ellipsis (...). I suspect this might be related to the current grid layout settings. I have tried all the possibilities but was not able to come up with the solution haha, if possible can you give any possible solution that I might be oversighting ;)

TenzDelek avatar Jun 04 '24 07:06 TenzDelek

hey @ovflowd Following up on our discussion about the breadcrumb layout, I've implemented the suggested changes. However, I've encountered an issue where extensive text in the breadcrumb section seems to be causing the right panel to shrink in width rather than truncating with an ellipsis (...). I suspect this might be related to the current grid layout settings. I have tried all the possibilities but was not able to come up with the solution haha, if possible can you give any possible solution that I might be oversighting ;)

Hi @TenzDelek, thanks for investigating! Unfortunately I don't have the time/capacity to look into this now, maybe someone from the Website team can? (cc @nodejs/nodejs-website)

ovflowd avatar Jun 04 '24 08:06 ovflowd

@TenzDelek now it's not centered anymore Capture d’écran 2024-06-04 à 11 35 12

AugustinMauroy avatar Jun 04 '24 09:06 AugustinMauroy

This PR will need to be rebased or recreated now that https://github.com/nodejs/nodejs.org/pull/6850 merged.

bmuenzenmeyer avatar Jul 05 '24 11:07 bmuenzenmeyer

cc @TenzDelek could you please rebase your PR?

ovflowd avatar Jul 20 '24 15:07 ovflowd

@ovflowd @bmuenzenmeyer can you check once if the pr is valid. this is my first time doing a git rebase. if any issue with this pr ,will close this and raise a new one.

TenzDelek avatar Jul 21 '24 14:07 TenzDelek