Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preview Dictionary and Array values in the inspector instead of showing size. #101331

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bruvzg
Copy link
Member

@bruvzg bruvzg commented Jan 9, 2025

Should fix #101278 (comment)

Before After
Screenshot 2025-01-09 at 10 22 24 Screenshot 2025-01-09 at 10 18 00

@bruvzg bruvzg added this to the 4.x milestone Jan 9, 2025
@AdriaandeJongh
Copy link
Contributor

This effectively removes the array or dictionary size from the 'array preview' which is a very useful UX thing.

I would suggest making / waiting for a proposal for a complete redesign of this array or dict preview, because I don't think the design this PR is an improvement from the current UX. The icons are very small and barely readable. There is more information in this preview, but I could argue that that information is not necessarily more useful.

@Calinou
Copy link
Member

Calinou commented Jan 9, 2025

This is a great improvement to me, but I think the size should still be displayed at the beginning (e.g. between parentheses).

For instance:

  • (3) [3, 6, 9]
  • (2) {"hello": "world", "foo": "bar}

This could also be (size 3) but then it'd take much more space, and horizontal space is already at a premium here.

@arkology
Copy link
Contributor

arkology commented Jan 9, 2025

From the one hand, this allows to see elements without unfolding which is great.
From the other hand, I can't tell where is PackedVector2Array and where is just typed array with Vector2 😆

@bruvzg
Copy link
Member Author

bruvzg commented Jan 9, 2025

This is a great improvement to me, but I think the size should still be displayed at the beginning

Added size.

I can't tell where is PackedVector2Array and where is just typed array with Vector2

It's displayed differently ([V2] icon, and Arr icon + type info).

Screenshot 2025-01-09 at 16 52 46

@DrCanvas
Copy link

DrCanvas commented Jan 12, 2025

I think previewing dictionary and array contents isn't very helpful, especially since they're rarely used with so few items. Imagine trying to preview textures or scenes here. Maybe something like this would work better:

3534536363647

@DrCanvas
Copy link

Alternatively, we could display arrays/dictionaries more efficiently by merging property names and values into a single line. The preview could be slightly grayed out and displayed only when there's enough space. We could add options in editor settings to toggle these previews on/off and adjust their threshold.

image

@ajreckof
Copy link
Member

Alternatively, we could display arrays/dictionaries more efficiently by merging property names and values into a single line. The preview could be slightly grayed out and displayed only when there's enough space. We could add options in editor settings to toggle these previews on/off and adjust their threshold.

image

I like the changing the preview color o mark a clearer distinction between the two but mixing the property name and value is clearly a no for me. This would make it too much different from all others property editors and would dilute information and make it harder to read.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants