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: added ellipsis for long content in breadcrumb #6794

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

Conversation

TenzDelek
Copy link
Contributor

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

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

@TenzDelek TenzDelek requested a review from a team as a code owner June 3, 2024 05:36
Copy link

vercel bot commented Jun 3, 2024

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

Name Status Preview Updated (UTC)
nodejs-org ✅ Ready (Inspect) Visit Preview Jun 4, 2024 10:29am

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.

Alrighty, awesome contribution! Thanks for fixing this :)

Copy link

github-actions bot commented Jun 3, 2024

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 🔗

Copy link

github-actions bot commented Jun 3, 2024

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 💤 0 ❌ 0 🔥 6.283s ⏱️

@ovflowd
Copy link
Member

ovflowd commented Jun 3, 2024

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 👀

@TenzDelek
Copy link
Contributor Author

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)

@ovflowd
Copy link
Member

ovflowd commented Jun 3, 2024

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.

@TenzDelek
Copy link
Contributor Author

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

@ovflowd
Copy link
Member

ovflowd commented Jun 3, 2024

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

@TenzDelek
Copy link
Contributor Author

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 ;)

@ovflowd
Copy link
Member

ovflowd commented Jun 4, 2024

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)

@AugustinMauroy
Copy link
Contributor

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

gap-5;
w-full
gap-5
pl-2;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
pl-2;
px-2;

It's allow to have same padding left and right

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will implement that right off. also about the breadcrumb being on left, I believe that is due to making it full width. should we keep it or make it as default? the purpose of this was there was noticeable shifting of the breadcrumb when different text length occurs. so keeping it at a same starting point we can reduce that shifting.. :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

I can see arguments either way, but since people are not really seeing the centered breadcrumb move (since it's at the bottom) it is a small concern to me. I'd rather it be centered, just as an opinion (and to preserve the original design's integrity), or if it is anchored to the left, it has padding similar to the content

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bmuenzenmeyer appreciate your input on this. I too see this issue in either way, but if it affecting the integrity of the original design, then definitely i will shift it back to the center as mention by both @AugustinMauroy and you:) .
p.s I am still figuring out about our main conversation which is to make ellipsis on the longer text format. if any of the members have any navigation on that, it would be helpful :)

Copy link
Member

Choose a reason for hiding this comment

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

@bmuenzenmeyer can you follow up here? Are you fine with this getting merged as it is? :)

@bmuenzenmeyer
Copy link
Collaborator

This PR will need to be rebased or recreated now that #6850 merged.

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.

Enhancement: Breadcrumb breakpoint
5 participants