-
Notifications
You must be signed in to change notification settings - Fork 856
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: Adjust dropdown menu item layout for better text fitting #3159
Conversation
Thanks for the PR @s1Sharp. The differences are definitely apparent with French/Russian, but with English it still looks like the text is too big for the menu size. I'm wondering if we should increase the menu width a little bit, or better yet, force the inner div to be a bit smaller so that word wrap is turned on for that menu item that's stretched over. Thoughts? |
I assume you wanted to see something similar with line breaks in the English version? This is easy to get. Need add padding from the right of 20px. There is already padding on the left. |
Yeah that looks great! |
For now it looks: |
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.
Code LGTM! Thanks @s1Sharp!
Will need some input from our UX team.
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.
Thanks @s1Sharp! This is a great improvement! Preventing overflow and the 20px right padding helps so much.
I had just a couple of suggestions:
- Can we increase the width of the menu container based on the text, upto a maximum of 200px? Menu items don't have to be wrapped if we actually have the horizontal space.
- The menu items seem to be getting vertically squished a bit because of some options wrapping to multiple rows. Ideally, the minimum height for a menu item should not be less than 36px. We shouldn't have restrictions on the overall height of the popover menu and it can be taller.
Here's how it can look with these changes:
This PR has been automatically labelled "stale" because it hasn't had recent activity. |
@s1Sharp Anything we can do to assist getting this finished? |
I tried to edit the current implementation so that the window for uploaded files would select the size dynamically. I couldn't find an elegant solution. But there is a working solution within the current implementation. I'll try to post it soon. |
- Updated the styling of `.DownloadsDropdownMenu__MenuItem` to improve text fitting and prevent text overlap.
I tried to refactor the src/main/views/downloads Dropdown Menu View.ts and src/renderer/downloadsDropdownMenu.tsx files so that the DownloadsDropdownMenu internal shape resizing event sends its dimensions to DownloadsDropdownMenuView, but this will not work in the current implementation. Therefore, I increased the size of the embedded browser window in the src/renderer/constants.ts file. And also slightly changed the css styles for the drop-down menu according to a request from @abhijit-singh For now it looks: |
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.
Thank you @s1Sharp! Looks good to me!
Summary
.DownloadsDropdownMenu__MenuItem
to improve text fitting and prevent text overlap.height
tofit-content(25%)
to ensure the menu items dynamically adjust to content size.flex-grow: 1
to allow the items to expand and occupy available space within the menu.Device Information
This PR was tested on: Ubuntu 22.04
Screenshots
I have tested it in 3 different languages (English, Russian, French). Some of them had problems with text overlapping in the download menu tab. Other languages with long translations also have overlapping text.
Before Changes:
English
French
Russian
After Changes:
English
French
Russian