X Tutup
Skip to content

Condense Inspector layout for Arrays#103257

Merged
Repiteo merged 1 commit intogodotengine:masterfrom
dugramen:simplify-array-inspector
Oct 29, 2025
Merged

Condense Inspector layout for Arrays#103257
Repiteo merged 1 commit intogodotengine:masterfrom
dugramen:simplify-array-inspector

Conversation

@dugramen
Copy link

@dugramen dugramen commented Feb 24, 2025

Mostly implements godotengine/godot-proposals#10125

  • Merges + Add Element button and size modifier into 1 row, and moves it to the bottom of the list

  • Moves array buttons & handles up to the property header, freeing up space in nested editors

  • Adds an Editor Setting to enable or disable condensing the buttons (in some cases the old uncondensed layout is a bit clearer)
    image

  • Fixes an issue where dragged/reordered element's folded states were not updated, so the wrong items were unfolded / folded after the drag

Before After
image image
Previous version

image

Also things I might have to address if desired:

  • This doesn't affect dictionaries.
  • This doesn't change the Array / Resource button design, which passivestar's design does.
  • This doesn't remove the Stylebox for the array buttons, which passivestars' design does.
  • It might be good to have another Editor Setting to keep the size row at the top,

Edit: Added array property's name to size label

Details

Edit 2: Added setting for size controls to be at the top, bottom, or split like it was before:

image

Top Split
image image

Edit 3: Renamed the setting to "embedded_list_buttons". Embedded buttons are now flat, and array button labels have shorter text as per the proposal design. Moved the "Add Element" button to the top alongside the array header button, to allow adding elements from both the top and bottom. Changed the setting from edit 2 to a bool called "condensed_size_controls_layout", when disabled just uses the old size controls layout.

Edit 4: fixed rtl layout

@dugramen dugramen requested a review from a team as a code owner February 24, 2025 18:45
@Calinou Calinou added this to the 4.x milestone Feb 24, 2025
@Calinou
Copy link
Member

Calinou commented Feb 24, 2025

It might be good to have another Editor Setting to keep the size row at the top,

What we could do is keep displaying the size at the bottom, unless the array has enough items to warrant displaying it both at the top and bottom.1 This would be the case for any array with more than 1 page (20 items by default IIRC). This way, you can adjust the array's size regardless of whether you're at the top or bottom when it matters most.

Also, I suggest displaying the name of the array in the Size property as the proposal mentioned (e.g. Surface Names Size). This should make nested arrays easier to work with.

Footnotes

  1. It's fairly common for table-based designs to do this if the table is long enough.

@dugramen
Copy link
Author

dugramen commented Feb 24, 2025

It might be good to have another Editor Setting to keep the size row at the top,

What we could do is keep displaying the size at the bottom, unless the array has enough items to warrant displaying it both at the top and bottom.[^1] This would be the case for any array with more than 1 page (20 items by default IIRC). This way, you can adjust the array's size regardless of whether you're at the top or bottom when it matters most.

That makes a lot of sense. Though I wonder if it's ever a concern if you can see both the top and bottom, if the user has a really low number of items per page set

Also, I suggest displaying the name of the array in the Size property as the proposal mentioned (e.g. Surface Names Size). This should make nested arrays easier to work with.

Oh I didn't notice that, thanks 😅

@arkology
Copy link
Contributor

If the size property is not at the top, it will result in a significant degradation of the user experience - the size field will constantly change its position as the size is changed.

@dugramen
Copy link
Author

If the size property is not at the top, it will result in a significant degradation of the user experience - the size field will constantly change its position as the size is changed.

I can make it a setting, with options "top", "bottom", and maybe "split" for keeping the old layout.

@dugramen dugramen force-pushed the simplify-array-inspector branch 3 times, most recently from 3575c14 to be03107 Compare February 24, 2025 22:19
@dugramen
Copy link
Author

Ok I think I found a good middle ground:
image
The add button is at the top next to the array button, and the size modifier is at the bottom. So from both the top and bottom you can add new elements easily.

This is how it looks in an array of arrays. The add button is hidden when folded:
image

I already added the editor setting for top vs bottom size controls, but I should probably remove it if this fixes all the same problems.

@AThousandShips AThousandShips changed the title Condensed Inspector layout for Arrays Condense Inspector layout for Arrays Feb 25, 2025
@arkology
Copy link
Contributor

arkology commented Feb 25, 2025

I can make it a setting, with options "top", "bottom", and maybe "split" for keeping the old layout.

Some thoughts about UX:

  1. When you change the array size (increase or decrease), you want the position of the size field to always be in the same place.

godot windows editor x86_64_nUBer1vXHg

  1. When you want to add a new element to the bottom of an array, moving to the top (to click "Add element" button) and back to the bottom is counter-productive.

  2. Having the "Add element" button on the same line as the size field is useless, because the size field button already has an up arrow that does exactly the same thing (adds an element).

@dugramen
Copy link
Author

dugramen commented Feb 25, 2025

@arkology what do you think of the design in the comment above. The add button always stays beside the array header, while the size controls stay at the bottom

Edit: The only downside I see is that you can't keep removing elements in place. 1, I'm not sure if that's really that big a deal, but 2, we can add a - button up there as well if it is

@arkology
Copy link
Contributor

arkology commented Feb 25, 2025

@dugramen
This will break (1) and partially (2) (up/down arrows are quiet small compared to current big "Add element" button - dont forget about tablet users with touchscreen) from #103257 (comment) at the same time.

@dugramen dugramen force-pushed the simplify-array-inspector branch 2 times, most recently from 645eebe to 475a528 Compare February 25, 2025 21:29
@passivestar
Copy link
Contributor

When you change the array size (increase or decrease), you want the position of the size field to always be in the same place

There's no need to aim at the small button in the size field to remove elements when you can be clicking any of the trashcans in the list itself, they are bigger and you dont need to move your mouse between elements to remove multiple if you just start deleting from the middle of the list

For adding it's still better to provide bigger buttons to make sure it's usable on touchscreens. Size field is there to allow typing values in and displaying the size. One-by-one add/delete should be doable with normal buttons

What we could do is keep displaying the size at the bottom, unless the array has enough items to warrant displaying it both at the top and bottom. This would be the case for any array with more than 1 page (20 items by default IIRC).

You'd normally want to add elements to a paginated list from the last page of it, and the last page will have less than 20 items. And items aren't necessarily one-liners, you can have 3 nested resources that won't fit on screen. I like the idea of the second add button on the bottom but it should be based not on the number of items but rather on what the user can see on screen. Ideally you'd check if the header is scrolled out of view to show the bottom button

Renamed the setting to "embedded_list_buttons"

I'm not sure there's a need for a minor style change like that to be configurable, godot is already using that style of simple icon buttons in different lists extensively. Inspector arrays have heavy UI that benefits from them

This doesn't change the Array / Resource button design, which passivestar's design does

That doesn't necessarily need to happen in this PR, can always be done later

This doesn't affect dictionaries

Would be awesome to see, but can probably be a separate PR as well

@dugramen
Copy link
Author

dugramen commented Mar 4, 2025

There's no need to aim at the small button in the size field to remove elements when you can be clicking any of the trashcans in the list itself, they are bigger and you dont need to move your mouse between elements to remove multiple if you just start deleting from the middle of the list

Yeah that works well, but it's also worth mentioning untyped arrays are a bit different. The remove button is inside the type picker dropdown. Maybe we could add a dedicated delete button besides it? If that takes too much space, maybe we can move the type picker to the left side (next to the move handle or by the reset button)? Just an idea

Renamed the setting to "embedded_list_buttons"

I'm not sure there's a need for a minor style change like that to be configurable, godot is already using that style of simple icon buttons in different lists extensively. Inspector arrays have heavy UI that benefits from them

This setting disables the condensed design. I only added it because in some cases, like direct arrays of arrays of arrays, the condensed design could be less clear. I'm fine removing it though, since it may not be very common. Here's a comparison:

Embedded Normal
image image

This doesn't affect dictionaries

Would be awesome to see, but can probably be a separate PR as well

I actually wanted to do it to dictionaries, but they do some weird manual layouts. There is no property header. Rather each entry is an HBoxContainer with 2 EditorProperty. It's more complexity, and I would've attempted it until I saw that nested resources currently look like this. I feel like we should have a better idea of how to use this space first before trying to save a few pixels on the button (it might even need to be implemented differently)
image

@passivestar
Copy link
Contributor

I only added it because in some cases, like direct arrays of arrays of arrays, the condensed design could be less clear

Nested resources is where I like the new design because side buttons kill a lot of space usable for data. Maybe if readability is a concern you could try making the backgrounds of nested resources increasingly more opaque for deeper resources? just put a cap on the opaqueness at 3-4 levels or smth like that. quick sketch (scuffed inner contrast because I only had time to overlay colored boxes on top of the image):

222

Alternatively could experiment with slightly increasing border sizes to make them more discernible. Or maybe a small left margin outside of them to make them a little bit indented. Hard to say without actually trying all of those things. This can be a separate PR too, but I think there are a lot of things that can be tried to fix this without resorting to huge vertical buttons

@dugramen
Copy link
Author

dugramen commented Mar 4, 2025

Nested resources is where I like the new design because side buttons kill a lot of space usable for data. Maybe if readability is a concern you could try making the backgrounds of nested resources increasingly more opaque for deeper resources? just put a cap on the opaqueness at 3-4 levels or smth like that. quick sketch (scuffed inner contrast because I only had time to overlay colored boxes on top of the image):

Oh I like that design. As far as I can tell, there's no special logic for the colors/transparency of the sub inspectors, it's just drawing one of the 16 styleboxes defined in the theme under "EditorStyles". Maybe we could just adjust the bg_color for all those styleboxes, to be more colored like the inner pink one

@Delsin-Yu
Copy link
Contributor

Would it be possible to have this design for dictionaries as well?

@dugramen
Copy link
Author

dugramen commented Mar 7, 2025

Would it be possible to have this design for dictionaries as well?

Yeah but I'm not sure how helpful it'd be. Again this is what nested inspectors look like in dictionaries

image

@dugramen
Copy link
Author

dugramen commented Mar 9, 2025

I implemented it for Dictionaries (not pushed yet), and also embedded the key property into the label area of the value property. This way, bottom editors can take up the unused horizontal space, but idk how I feel about it aesthetically:

Before After
image image

@dugramen dugramen marked this pull request as draft March 9, 2025 15:47
@passivestar
Copy link
Contributor

passivestar commented Mar 9, 2025

This way, bottom editors can take up the unused horizontal space, but idk how I feel about it aesthetically

This is obviously a huge improvement, those sub-editors are practically unusable in the left picture. The only concern here would be whether it's easy enough to understand at a glance what is a key and what is a value, but in practice you would normally much more often use typed dictionaries rather than what you have in your example and it'll be easy to read because of the repeating data

(if readability of untyped dictionaries is a concern you could experiment with a unique style for keys, such as font color/weight/style, bg color, etc, but I don't think it will be necessary tbh)

@Delsin-Yu
Copy link
Contributor

Thanks so much for the dictionary part, I can't wait to cherrypick this and start using it for production.

@dugramen
Copy link
Author

dugramen commented Mar 9, 2025

Thanks so much for the dictionary part, I can't wait to cherrypick this and start using it for production.

Still have to clean it up a bit before pushing

@dugramen dugramen force-pushed the simplify-array-inspector branch from c401cf2 to 766468c Compare October 28, 2025 21:30
@dugramen
Copy link
Author

Rebased and fixed conflicts. Also made the changes from @KoBeWi

@KoBeWi
Copy link
Member

KoBeWi commented Oct 28, 2025

I think putting edit button at the left of Dictionary entry will be confusing:
image
It looks like it would edit the key, but it edits the value.

@dugramen dugramen force-pushed the simplify-array-inspector branch from 766468c to c09438b Compare October 28, 2025 22:29
Copy link
Member

@KoBeWi KoBeWi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the implementation looks good now.
There is the matter of that potentially confusing button placement, which would require more changes, but maybe ti's fine.

edit_btn->set_accessibility_name(TTRC("Edit"));
edit_btn->set_button_icon(get_editor_theme_icon(SNAME("Edit")));
edit_btn->set_disabled(is_read_only());
edit_btn->set_flat(true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's flat for?
You could use FlatButton theme variation instead.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure I'll use that

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should use SceneStringName(FlatButton) instead of plain string.

@dugramen dugramen force-pushed the simplify-array-inspector branch 2 times, most recently from 9b6f321 to cd10944 Compare October 28, 2025 23:18
Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes look fine to me, and overall the usability improvement is massive so this is great.

Regarding the recent discussion on the position of the Delete button, given the lack of consensus I would have kept it on the right side for now (consistent with other UIs and how it was until now) to evaluate further in another PR. Because with it on the left side, I foresee some potential pushback from some users on this PR because they don't like the new icon placement. (I personally agree with Yuri's remark that the delete icon next to the resource selector is a problem, but it's a pre-existing issue that's orthogonal to what this PR was meant for, and I'm not convinced by the solution so far.)

But we can try it as is and adjust later in follow-ups. If the feedback is that people love the gain of usable space but dislike the icon, we can deal with that specifically.

Copy link
Member

@ajreckof ajreckof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code from this last version is really good and the change is something that was needed for quite some time. I agree with akien that i think we should not move the delete edit button in this PR but keep it in a separate proposal PR to not slow this one down with the consideration of where is the best place to put it.

Personnaly the center option seems the most elegant and the least likely to have misclicks.

@dugramen
Copy link
Author

So should I return it back to the right or just leave it for now (it's currently on the left)

@AdriaandeJongh
Copy link
Contributor

As @akien-mga said: given the lack of consensus, I would keep it on the right side for now.

@dugramen dugramen force-pushed the simplify-array-inspector branch from cd10944 to 7df65de Compare October 29, 2025 16:51
@dugramen
Copy link
Author

Ok I readded the right container and moved buttons back to the right

@Repiteo Repiteo merged commit 5345910 into godotengine:master Oct 29, 2025
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Oct 29, 2025

Thanks! Excellent job implementing such a strongly-requested feature!

@dugramen
Copy link
Author

@Repiteo Thank you!

@MadeScientist
Copy link
Contributor

I really like your design, I am very grateful to you for your effort!

@obsurveyor
Copy link

@dugramen I really love this update! TileSet's various Layers sections could really use it too. This should be the default for any list displays in Godot now.

@TotoShampoin
Copy link

TotoShampoin commented Feb 13, 2026

I'm in Godot 4.6 and I can't find the setting for the size?

@TotoShampoin
Copy link

@KoBeWi Yeah it was suggested that the layout change be a separate PR since we didn't agree on a location for the add button. So this pr currently only embeds the "move", "delete", and "pick" buttons directly into the property's header, rather than them taking up an entire column for the whole array / dictionary slot

Which separate PR?

@dugramen
Copy link
Author

I'm in Godot 4.6 and I can't find the setting for the size?

@TotoShampoin what do you mean size? Originally there was a setting to disable this feature for each side, but that was decided as unnecessary.

Also sorry there is no PR (from me at least) for moving the "add" button. It didn't seem like it was very desired in the first place. People were concerned with more horizontal space not vertical space. Is that something you actually wanted or you're just curious about it?

@TotoShampoin
Copy link

TotoShampoin commented Feb 13, 2026

Well yeah, while I am happy for the saved horizontal space, I am currently struggling a lot with container nesting (goes dictionary → resource → array → resource → array. I swear it makes sense in my design), and it's getting to the point I am seriously considering making a custom plugin just to make the interface easier on my specific project.

But the part where the size field was going to be moved below the elements or was even gonna be removed, and the add button being moved away...
Yeah, I just found out about this MR, but I'm very much hyped by saving vertical space for those.

I did stumble across the "Debloat Array" plugin, which would've been ideal, but it doesn't work for me (no arrays in the resources being rendered at all)

@dugramen
Copy link
Author

@TotoShampoin makes sense. You should open a proposal or discussion with a screenshot of how it looks for you, so people can discuss what to do about it

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.

Simplify the layout of nested resources in inspector
X Tutup