refreshVersions icon indicating copy to clipboard operation
refreshVersions copied to clipboard

Version alignement issue

Open MaxMichel2 opened this issue 1 year ago • 10 comments

🐛 Describe the bug

The alignement of the versions in the version catalog is incorrect

⚠️ Current behavior

All available versions are misaligned with the currently defined one by one space, see image below

image

✅ Expected behavior

The available versions should be aligned with the currently defined version instead

💣 Steps to reproduce

Just implement refreshVersions in a project

📱 Tech info

MaxMichel2 avatar Sep 27 '23 09:09 MaxMichel2

Do you use a custom font? Which OS are you on?

LouisCAD avatar Sep 28 '23 14:09 LouisCAD

Currently I am on Windows and I use the Inter font with the new UI (which could be the culprit)

I'll admit I didn't think about blaming the font at first considering the behaviour is correct in the versions.properties file 🤔

One thing I noticed is the appearance of the arrow in the comment which doesn't appear in the versions.properties so that could be a fix

MaxMichel2 avatar Sep 28 '23 15:09 MaxMichel2

The problem is that the width of the arrow changes from one font to the other, and I don't see how we would detect the font is different. Do you have the same problem when using the default font?

LouisCAD avatar Sep 28 '23 19:09 LouisCAD

I'll check the behaviour with the default font but this might be the issue simply (I apologise if that's the case)

An a side note, why use arrows in the versions catalog and not the versions.properties file ? Just out of curiosity 😁

MaxMichel2 avatar Sep 28 '23 19:09 MaxMichel2

Historical reasons, and we have the version. prefix in versions.properties, which gives more room to the word available without messing alignment for short keys.

LouisCAD avatar Sep 29 '23 00:09 LouisCAD

The arrow is also only one character wide in IntelliJ IDEA: (Using its default font "JetBrains Mono".) image

It's worse in VS Code with "Droid Sans Mono", since it no longer matches the grid: image

GeorgEchterling avatar Oct 04 '23 08:10 GeorgEchterling

I also have the default font, and I get 1.8-ish character width FYI, like in VS Code, which keeps the alignement good enough for keyboard @GeorgEchterling.

LouisCAD avatar Oct 04 '23 09:10 LouisCAD

Which OS @GeorgEchterling?

LouisCAD avatar Oct 04 '23 09:10 LouisCAD

@LouisCAD Fedora Linux 38 (GNOME, Wayland)

I think IntelliJ IDEA automatically scales down wide characters, since changing the font to Droid Sans Mono doesn't increase the character's width. Or maybe both fonts just don't contain the arrow and the two apps use different fallback fonts. I don't know how to test that.

GeorgEchterling avatar Oct 04 '23 09:10 GeorgEchterling