tweb icon indicating copy to clipboard operation
tweb copied to clipboard

[BUG] Long channel title results in line breaks in web view

Open paramazo opened this issue 1 year ago • 4 comments

Describe the bug If a channel title starts and ends with emojis, it receives line breaks in the web view.

To Reproduce Create a channel with a title of at least 20 characters and two emojis, one at the beginning and one emoji at the end of the title.

Expected behavior It should not create line breaks. If it is too long, it should trim the name at the end and insert like "channelnametoolong.."

Additional context First step would be to improve css and get some more space for the title. increase max-width: 340px to 372px.

channel_tg

paramazo avatar Dec 20 '23 14:12 paramazo

Isn't this the predicted behavior?

I checked the css and none of word-break, overflow-wrap and text-wrap set, means text will wrap as default.

Screenshot_20231221_083615

The only property related to this is text-overflow: ellipsis, means unbreakable long word will be tailed with ..., is this what you want? Screenshot_20231221_084217

OrkWard avatar Dec 21 '23 00:12 OrkWard

The only property related to this is text-overflow: ellipsis, means unbreakable long word will be tailed with ..., is this what you want?

Thats right, it works without emojis in the title. With emojis it will not be trimmed and receives ugly line breaks like shown in my screenshot

paramazo avatar Dec 21 '23 07:12 paramazo

The only property related to this is text-overflow: ellipsis, means unbreakable long word will be tailed with ..., is this what you want?

Thats right, it works without emojis in the title. With emojis it will not be trimmed and receives ugly line breaks like shown in my screenshot

I mean, only unbreakable words will be processed, as for emoji, it won't be considered as part of the word(more clearly, in your case, [emoji] channelnametoolonghere [emoji] are three words from the perspective of browser). If some words are too long, it will expand to ellipsis, or if the sentence of multiple words are too long, the browser just break it into multiple lines by default.

And I don't think there's anything wrong. The channel name should never be hidden in ellipsis; Too long words are problems need to avoid by owners.

OrkWard avatar Dec 21 '23 20:12 OrkWard

Too long words can not be avoided if billions of users can register unique groupnames. It would be possible to also expand multiple words which are too long to elipsis with a small javascript function.

Further, the main div is 400px wide, but the title div inside is limited to 340px. It could easily be increased a bit.

This are my two recommendations to improve on this topic.

paramazo avatar Jan 04 '24 14:01 paramazo