desktop icon indicating copy to clipboard operation
desktop copied to clipboard

Fix: Adjust dropdown menu item layout for better text fitting

Open s1Sharp opened this issue 1 year ago • 5 comments

Summary

  • Updated the styling of .DownloadsDropdownMenu__MenuItem to improve text fitting and prevent text overlap.
  • Changed height to fit-content(25%) to ensure the menu items dynamically adjust to content size.
  • Added flex-grow: 1 to allow the items to expand and occupy available space within the menu.
  • Added padding-right: 20px to ensure text does not touch the right edge of 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 Before Changes (English)
French Before Changes (French)
Russian Before Changes (Russian)
After Changes:
English After Changes (English)
French After Changes (French)
Russian After Changes (Russian)
Updated the styling of `Downloads Menu` to improve text fitting and prevent text overlap.

s1Sharp avatar Oct 05 '24 00:10 s1Sharp

Hello @s1Sharp,

Thanks for your pull request! A Core Committer will review your pull request soon. For code contributions, you can learn more about the review process here.

mattermost-build avatar Oct 05 '24 00:10 mattermost-build

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?

devinbinnie avatar Oct 07 '24 13:10 devinbinnie

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?

Eng with right padding

This is easy to get. Need add padding from the right of 20px. There is already padding on the left. padding-right: 20px;

s1Sharp avatar Oct 07 '24 13:10 s1Sharp

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?

Eng with right padding This is easy to get. Need add padding from the right of 20px. There is already padding on the left. padding-right: 20px;

Yeah that looks great!

devinbinnie avatar Oct 07 '24 14:10 devinbinnie

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? Eng with right padding This is easy to get. Need add padding from the right of 20px. There is already padding on the left. padding-right: 20px;

Yeah that looks great!

For now it looks:

English After Changes (English)
French After Changes (French)
Russian After Changes (Russian)

s1Sharp avatar Oct 07 '24 16:10 s1Sharp

This PR has been automatically labelled "stale" because it hasn't had recent activity. A core team member will check in on the status of the PR to help with questions. Thank you for your contribution!

mattermost-build avatar Oct 28 '24 01:10 mattermost-build

@s1Sharp Anything we can do to assist getting this finished?

devinbinnie avatar Oct 28 '24 13:10 devinbinnie

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

s1Sharp avatar Oct 28 '24 13:10 s1Sharp

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:

English After Changes (English)
French After Changes (French)
Russian After Changes (Russian)

s1Sharp avatar Oct 30 '24 20:10 s1Sharp