mattermost / desktop

Mattermost Desktop application for Windows, Mac and Linux
Apache License 2.0
2.03k stars 829 forks source link

Fix: Adjust dropdown menu item layout for better text fitting #3159

Closed s1Sharp closed 2 weeks ago

s1Sharp commented 1 month ago

Summary

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.
mattermost-build commented 1 month ago

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.

devinbinnie commented 1 month ago

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?

s1Sharp commented 1 month ago

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;

devinbinnie commented 1 month ago

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!

s1Sharp commented 1 month ago

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)
mattermost-build commented 3 weeks ago

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!

devinbinnie commented 3 weeks ago

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

s1Sharp commented 3 weeks ago

@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 commented 3 weeks ago

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)