electricitymaps / electricitymaps-contrib

A real-time visualisation of the CO2 emissions of electricity consumption
https://app.electricitymaps.com
GNU Affero General Public License v3.0
3.37k stars 911 forks source link

Frontend feature request: handle long strings in energy sources panel #4558

Open jarek opened 1 year ago

jarek commented 1 year ago

The "energy sources" list clips strings that are too long:

image (this screenshot is with the English label manually changed to "pumped hydro storage")

Describe the solution you'd like

It would be nice if it instead shifted how much space the text can take up by shortening the production bars instead (within some limits), or wrapped the text, or did something else to allow longer labels.

Additional context

This is an issue for several of the languages, where text is either clipped on display, or had to be abbreviated in the localization file:

image image image image

Ankitchaudharyy commented 1 year ago

Hey! Can I work on this issue?

tonypls commented 1 year ago

Hey! Can I work on this issue?

Of course!

Ankitchaudharyy commented 1 year ago

jarek Provide Steps to reproduce this issue.

tonypls commented 1 year ago

It looks like in English this issue has been fixed but across other languages there is still an issue that sometime the energy production types in the zone overview panel on the left sometimes puts the label out of view.

A nice way to fix this would be to truncate the pumped hydro string when it's above a certain length and add ellipsis.

image
Ankitchaudharyy commented 1 year ago

Sure. @tonypls Thanks

Lucas-Otavio commented 2 weeks ago

It seems this issue is still relevant, but now the string overflows instead of being hidden. A couple of examples in Brazilian Portuguese and Polish:

image image