-
-
Notifications
You must be signed in to change notification settings - Fork 199
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: repos with long name partially stack #2534
fix: repos with long name partially stack #2534
Conversation
* fix: lint suggestions
β¦erflow-result-items
β Deploy Preview for oss-insights ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
β Deploy Preview for design-insights ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This result is different from mine, locally. As you can see on the after screenshot in the PR form, I only get a single line for repo names, and the longer ones are cut. But without ellipsis. Based on the docs, I also wonder why So, let me try your solution. |
β¦erflow-result-items
* fix: remove truncate from div in line 147
@takanome-dev I follow your suggestion and made the changes as below:
I've tried several things and I found that only longer repo names are truncated and have ellipsis. But the longer owner names stay as is. That's why for longer owner names, ellipsis are not showing. It will take me a while to figure this out if you want to have the cc: @nickytonline |
Hey @adiati98, the changes looks good to me π Let's hear what @open-sauced/engineering think about it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We definitely want each item in the list to be on one line and contain ...
if it's too long. I'm wrapping up some feature work atm, but if you're still stuck on this @adiati98, I can take a peek to provide suggestions.
I'm honestly still stuck if we want to do ellipsis, @nickytonline . When there's a longer organization name, they will stack on top of each other. And I haven't found a solution for this. |
@nickytonline I've made the changes as per Bekah's suggestion to apply width in the It didn't work for the longer organization name when I tried earlier (before my last commit) as I mentioned in this comment. But after setting the width, it now works! The longer organization names are not in two lines as shown below. However, as a note, for very long organization name, there's only ellipsis shown for the repo name as below. |
components/atoms/Search/search.tsx
Outdated
cursor === index && "_cursorActive bg-slate-100", | ||
"px-4 py-2 overflow-hidden break-all hover:bg-light-slate-2" | ||
)} | ||
className={clsx(cursor === index && "_cursorActive bg-slate-100", "px-4 py-2 hover:bg-light-slate-2")} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refactor (blocking): Instead of styling each span, configure it for all spans in it's parent.
className={clsx(cursor === index && "_cursorActive bg-slate-100", "px-4 py-2 hover:bg-light-slate-2")} | |
className={clsx(cursor === index && "_cursorActive bg-slate-100", "px-4 py-2 hover:bg-light-slate-2", "[&_span]:max-w-[12.3rem]")} |
Is md:max-w-[11rem]
required @adiati98? I'm only asking as the value is smaller for a larger screen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nickytonline let me check it locally and get back to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nickytonline I've tested the suggestions locally, committed, and pushed them. We don't need the md:max-w-[11rem]
.
Below is the screenshot of the result. The blue box is longer repo name is truncated. And the green box is longer organization name, with the whole repo name gets truncated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great @adiati98, could we make the 12.3 rem a little bit bigger, like 12.4 or 12.5 or does it get cut off (not ellipsis) at 12.4?
@nickytonline making However, I tried two sizes:
|
The 13rem one looks good. Thanks for your patience in this @adiati98! |
@nickytonline thank you also for your patience going back and forth with this! π I'm not on my computer anymore. So, either I'll fix it tomorrow or if you can do it, Nick. π |
No rush. Whenever you have a chance to push the changes. |
Done π |
## [2.17.0](v2.16.1...v2.17.0) (2024-04-10) ### π§βπ» Code Refactoring * remove `/hub` and `/pages` subfolder routing ([#2963](#2963)) ([5c090f3](5c090f3)) ### π Features * add range selection to contributor profile page ([#3125](#3125)) ([641f9b2](641f9b2)) * add Skeleton to Repo Page ([#3124](#3124)) ([d661ffa](d661ffa)) * initial `/starsearch` layout ([#3148](#3148)) ([5c3d61b](5c3d61b)) * matched Contritbutor Insight edit page style to workspace UI ([#3109](#3109)) ([c9e3872](c9e3872)) * matched Repository Insight edit page style to workspace UI ([#3092](#3092)) ([c65b053](c65b053)) * repo charts style fixes ([#3151](#3151)) ([9b7197b](9b7197b)) * search for repositories ([#3140](#3140)) ([10ede95](10ede95)) ### π€ Build System * update to Next.js 13.5.6 ([#3149](#3149)) ([b65b84c](b65b84c)) ### π Bug Fixes * now common OG image functions are in a utility file ([#3132](#3132)) ([450d874](450d874)) * pass selected repositories to new repository insight creation ([#3107](#3107)) ([3c57f94](3c57f94)) * repos with long name partially stack ([#2534](#2534)) ([1ed303b](1ed303b)) * swap text for stars/forks in repo page OG image ([#3145](#3145)) ([22fa602](22fa602)) * text area input does not focus when active and add highlight input is always focussed in post a highlight form ([#3008](#3008)) ([e9b9fed](e9b9fed)) * update API URL in contributor card edge function for pull requests ([#3157](#3157)) ([668a26b](668a26b)) * use OpenGraph image URL and remove server request from user profile ([#3137](#3137)) ([4e27f55](4e27f55)), closes [#3066](#3066)
Description
This PR fixes the long repos' names that are partially stacked at the back of another name in the search input of the Explore tab.
The changes made here:
Add Tailwind className:
truncate
to truncate overflowing text.tracking-tighter
to reduce letter spacing for better space.inline-block
to the<span>
.Remove Tailwind classNames:
overflow-hidden
as it's included in thetruncate
.break-all
as we don't want to add line breaks.Note: Changes made based on this conversation.
What type of PR is this? (check all applicable)
Related Tickets & Documents
Fixes #2335
Mobile & Desktop Screenshots/Recordings
Before
After
### AfterSteps to QA
Added to documentation?
[optional] Are there any post-deployment tasks we need to perform?
[optional] What gif best describes this PR or how it makes you feel?