godotengine / godotengine/godot

ItemList truncation does not show ellipsis (...) with new script editor list minimum width

Open
#97,124 8 comments 1 reaction 0 assignees View on GitHub
bug regression topic:editor
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions
Appears in editor in 4.4 since https://github.com/godotengine/godot/pull/96909
Not visible in editor in 4.3, but the underlying behavior in ItemList is observable in 4.3

### System information

Windows 10

### Issue description

In an ItemList, names are truncated if they are too wide for the list. Usually this is done with an ellipsis `...`, but when the width is small enough, no ellipsis is used. I think this is good intended behavior, otherwise only an ellipsis would be shown at very low widths.

Since https://github.com/godotengine/godot/pull/96909 set the minimum width of the script list to 100, the width is small enough that many script names are now truncated with no ellipsis. This happens *right around* a script list width of 100. For `new_script.gd`, the threshold for the behavior happens at 101px wide, so it was easily noticeable when testing.

I believe this is *existing behavior* of the ItemList truncation, but since the preview editor script list minimum was above the threshold, it was not visible to godot editor users. The MRP is created and tested in 4.3, and replicates the same behavior if the width is low enough.

Observed behavior in the https://github.com/godotengine/godot/pull/96909 artifact:

https://github.com/user-attachments/assets/17179298-3a6d-4d83-b0af-7be34a7d144e

Observed behavior in the MRP (created and tested in 4.3).

https://github.com/user-attachments/assets/bd7a7570-f944-4e00-a27c-fe37b4597373

Possible resolutions:
- Tweak the truncation limits so that an ellipsis is still used at the minimum script width of 100.
- Tweak the minimum script width to 105 or 110, to barely avoid this behavior.
- Do nothing, as this *is* intended behavior, just an edge case that usually doesn't come up in the editor. In this case the user is knowingly making their editor UI crowded in exchange for extra script editor space, and minor "problems" like this may be expected. (It's me. I'm user. 😃)

CC @aXu-AP

### Steps to reproduce

Open the MRP.
Adjust the HSplitContainer left and right. You can test with and without 16x16 icons.

### Minimal reproduction project (MRP)

[mrp-truncation.zip](https://github.com/user-attachments/files/17032862/mrp-truncation.zip)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.