Condense Inspector layout for Arrays#103257
Conversation
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. Footnotes
|
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
Oh I didn't notice that, thanks 😅 |
|
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. |
3575c14 to
be03107
Compare
Some thoughts about UX:
|
|
@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 |
|
@dugramen |
645eebe to
475a528
Compare
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
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
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
That doesn't necessarily need to happen in this PR, can always be done later
Would be awesome to see, but can probably be a separate PR as well |
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): 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 |
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 |
|
Would it be possible to have this design for dictionaries as well? |
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) |
|
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 |
c401cf2 to
766468c
Compare
|
Rebased and fixed conflicts. Also made the changes from @KoBeWi |
766468c to
c09438b
Compare
| 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); |
There was a problem hiding this comment.
What's flat for?
You could use FlatButton theme variation instead.
There was a problem hiding this comment.
It should use SceneStringName(FlatButton) instead of plain string.
9b6f321 to
cd10944
Compare
There was a problem hiding this comment.
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.
ajreckof
left a comment
There was a problem hiding this comment.
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.
|
So should I return it back to the right or just leave it for now (it's currently on the left) |
|
As @akien-mga said: given the lack of consensus, I would keep it on the right side for now. |
cd10944 to
7df65de
Compare
|
Ok I readded the right container and moved buttons back to the right |
|
Thanks! Excellent job implementing such a strongly-requested feature! |
|
@Repiteo Thank you! |
|
I really like your design, I am very grateful to you for your effort! |
|
@dugramen I really love this update! |
|
I'm in Godot 4.6 and I can't find the setting for the size? |
Which separate PR? |
@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? |
|
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... 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) |
|
@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 |










Mostly implements godotengine/godot-proposals#10125
Merges
+ Add Elementbutton and size modifier into 1 row, and moves it to the bottom of the listMoves 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)

Fixes an issue where dragged/reordered element's folded states were not updated, so the wrong items were unfolded / folded after the drag
Previous version
Also things I might have to address if desired:
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:
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