layer5 icon indicating copy to clipboard operation
layer5 copied to clipboard

fix codeblock horizontal-scroll issue

Open ashok-2003 opened this issue 7 months ago • 25 comments

Description

This PR fixes #6488

Notes for Reviewers Added : white-space: pre-wrap; - to ensure text-wrap to words word-break: break-word; - to ensure that long URL will break and wrap

https://github.com/user-attachments/assets/37a76e18-9c4e-40df-acfc-4a92682f903e

Signed commits

  • [x] Yes, I signed my commits.

ashok-2003 avatar May 27 '25 08:05 ashok-2003

here we go @vr-varad , please review the changes.

ashok-2003 avatar May 27 '25 08:05 ashok-2003

🚀 Preview for commit e3137b36afd092e9a18ffd67083c187ba7243081 at: https://68357666c3c24a919a437dff--layer5.netlify.app

l5io avatar May 27 '25 08:05 l5io

Umm, the single line looks kind of bad without a scrollbar. Is this the expected behavior, or am I missing something? Screenshot 2025-05-27 163419

ashok-2003 avatar May 27 '25 11:05 ashok-2003

hey @ashok-2003 any update on the pr?

vr-varad avatar May 29 '25 14:05 vr-varad

Hey @vr-varad, sorry I couldn’t look into the issue today — I have my end-sem exam scheduled for tomorrow. I’ll be able to tackle it after that. Hope you understand! Also, I’ve attached an image — is this the kind of result we’re aiming for? If so, we might just need to adjust the z-index to fix the remaining part. A quick review would help — I’ll push the PR based on your feedback. Screenshot 2025-05-27 163419 is it should be single line like this ? rest i will adjust based on feedback.

ashok-2003 avatar May 29 '25 14:05 ashok-2003

nope!! the earlier was better @ashok-2003

vr-varad avatar May 29 '25 15:05 vr-varad

Hey @vr-varad, I’m a bit confused — could you point out the image or reference we should proceed with? Are you referring to the multi-line version or the single-line one?

ashok-2003 avatar May 29 '25 15:05 ashok-2003

lets get others' review on multi line one and make changes accordingly

vr-varad avatar May 29 '25 15:05 vr-varad

🚀 Preview for commit e3137b36afd092e9a18ffd67083c187ba7243081 at: https://68387cc5083d3e04e4641cfa--layer5.netlify.app

l5io avatar May 29 '25 15:05 l5io

image This would be the ideal case, for the codeblock, with some minor fixes to the position of the copy button.

There's a video with the expected changes in the issue description @ashok-2003

M-DEV-1 avatar May 30 '25 07:05 M-DEV-1

Okay @M-DEV-1, I’ll try to implement that. But my main concern is how it should behave on mobile screens. If we go with a single line layout without a scrollbar, it might overflow the screen.

ashok-2003 avatar May 30 '25 13:05 ashok-2003

add the scroll below a curtain screen width when the text starts overflow. Hope you understand,

vr-varad avatar May 30 '25 13:05 vr-varad

🚀 Preview for commit c2548f7f47f9d04864f39eeed076c1265e88eae8 at: https://683a19b15bf7e264e8b327d1--layer5.netlify.app

l5io avatar May 30 '25 20:05 l5io

@vr-varad , @M-DEV-1, looking forward for review ! Screenshot 2025-05-30 211103

ashok-2003 avatar May 31 '25 10:05 ashok-2003

hi @ashok-2003, LGTM on desktop view but you should also take a look on how it's renderedn in mobile view.

M-DEV-1 avatar May 31 '25 11:05 M-DEV-1

Hey @M-DEV-1, I’ve also checked for smaller screens. I implemented the following media query:

@media (max-width: 1024px) { display: block; overflow-x: auto; } This ensures that below that screen width, a scrollbar appears so the content doesn’t overflow. Screenshot 2025-05-31 165340

ashok-2003 avatar May 31 '25 11:05 ashok-2003

dont use media query use theme breakpoints. @ashok-2003

vr-varad avatar Jun 02 '25 13:06 vr-varad

Hey @vr-varad, I went deeper into the codebase and used the AnimatedStepsListWrapper breakpoint. Unfortunately, I couldn’t find any special theme breakpoints. Here's the code for both AnimatedStepsListWrapper and MesheryWrapper styles—I noticed there’s some inconsistency in their media queries as well. Since I couldn’t find any custom theme breakpoints, I’ve temporarily used the same breakpoints as in AnimatedStepsListWrapper to maintain uniformity. Hope that works for now. Let me know if you find anything different. Screenshot 2025-06-04 051316

Screenshot 2025-06-04 051248

ashok-2003 avatar Jun 03 '25 23:06 ashok-2003

🚀 Preview for commit 13518c48659d107555394925da68edfa0fde7eae at: https://683f8cf88154ee450d7eb553--layer5.netlify.app

l5io avatar Jun 04 '25 00:06 l5io

LGTM!

LibenHailu avatar Jun 04 '25 07:06 LibenHailu

Hey @vr-varad, @M-DEV-1, I think it's working perfectly fine. Are we good to go on this one now? please review at https://683f8cf88154ee450d7eb553--layer5.netlify.app/cloud-native-management/meshery/getting-started

ashok-2003 avatar Jun 04 '25 07:06 ashok-2003

Looks good, but it has more vertical padding than necessary? I think it would be nice to have some horizontal padding, provided that it doesn't break. @ashok-2003 @vr-varad thoughts?

M-DEV-1 avatar Jun 04 '25 12:06 M-DEV-1

@M-DEV-1 , extra vertical padding coming from the pre div render inside the pre div. May be extra horizontal padding might make it look more chunkier. might not be good idea(According to me ). or Might be !

ashok-2003 avatar Jun 04 '25 16:06 ashok-2003

Thanks @M-DEV-1. As discussed in the meeting, I’ve undone the changes made directly to the code block and ensured that the updates remain limited to the Hero section only. Please review!

here is the video -

https://github.com/user-attachments/assets/f16e1f27-c0a7-47cc-832c-ef420b63a527

ashok-2003 avatar Jun 11 '25 06:06 ashok-2003

🚀 Preview for commit 12fbb923d92e9a2506c0965f04ee69b075be22de at: https://6849b4178f84ef3e66119055--layer5.netlify.app

l5io avatar Jun 11 '25 16:06 l5io

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 27 '25 00:06 stale[bot]

Hi @ashok-2003, looks good to me. Thanks for restricting the changes to just that specific page component.

M-DEV-1 avatar Jun 27 '25 08:06 M-DEV-1

🚀 Preview for commit a4583973ecf96a7a126a617fb104d568e19e7ecb at: https://685e5f0d87e4de40ab1bcebb--layer5.netlify.app

l5io avatar Jun 27 '25 09:06 l5io

Thanks a lot for working on this @ashok-2003, incorporating multiple rounds of feedback. However, I agree with @leecalcote here:

we don't need this line-wrapped. Sticking with one line is ideal. It's ok if the overflow isn't visible. The scrollbar height can be cut in half and/or removed instead.

  • [x] the scrollbar height seems reduced already

Again don't think, this is an valid issue which needs fixed necessarily. Thank you @vr-varad @M-DEV-1 @LibenHailu for engaging here.

vishalvivekm avatar Jun 28 '25 08:06 vishalvivekm