riatelab / magrit

Thematic cartography entirely in the browser ♥
https://magrit.cnrs.fr
GNU General Public License v3.0
128 stars 18 forks source link

Fix/Column title in label options not properly aligned #113

Closed robLittiere closed 1 year ago

robLittiere commented 1 year ago

Hello Magrit team,

I noticed a very very minor thing while implementing the new changes introduced since 0.15.0.

The fields titles in the label creation popup are not vertically aligned and can overlap if the column name is too long. I did a small CSS fix, I'll let you check it out. It's basically not forcing height and let the flexbox do its thing to align the items.

Before :

Screenshot 2023-05-17 at 14 44 06

After :

Screenshot 2023-05-17 at 14 53 22

If you don't like it or would like a change, please let me know,

Robin

robLittiere commented 1 year ago

I just realized another problem on that same issue. If the field property is only one word (even separated by an underscore "_") it will stay inline and break UI clarity.

Here is an exemple :

magrit_name_too_long

There are two fixes from the top of my head :

Screenshot 2023-05-17 at 15 17 28 Screenshot 2023-05-17 at 15 20 23

If you are interested in one of those changes, I can add them in a future commit quickly, since they are very minor and easy fixes.

Robin

mthh commented 1 year ago

Nice catch, thanks for raising this issue and proposing a fix !

I like the clean UI approach where an ellipsis is added when the name is too long (this is already what is done for the layer name - cf. screenshot below - although this is done manually and not directly in CSS with the text-overflow property).

Capture du 2023-05-17 16-17-14

Capture du 2023-05-17 16-17-34

In this case I think it could be beneficial to display the full name of the field when the hovering the cursor on the clipped field name (which is not done yet for the layer name displayed above). A simple tooltip, using the HTML title attribute should be enough.

robLittiere commented 1 year ago

I agree completly, I do think the clean UI is better IF we give a chance to the user to see the full field name. I added the css in the latest commit, I'll get add the attribute or add a small tooltip a bit later 👍. I think it would be nice to keep it html/css properties as it would reduce javascript code and event listeners bloat, what do you think ?

mthh commented 1 year ago

Thanks !

I think it would be nice to keep it html/css properties as it would reduce javascript code and event listeners bloat, what do you think ?

Indeed, I totally agree :+1:

robLittiere commented 1 year ago

After trying different things, the best/simplest solution remained adding a simple title attribute. The last commit did just that.

mthh commented 1 year ago

Thanks a lot !