Something changed with UI layout logic. Breaking previously working GUI

Something changed within the last 12 hours that is breaking a debug UI in one of my games.

This is what it currently looks like:
Screen Shot 2024-07-25 at 9.15.00 PM

It’s supposed to read:

pos: x, y, z
ang: 0, 0
vel: x, y, z

fps: 60 Hz
tps: 60 Hz
pys: x Hz
mem: 0 MB
net: 0 ms

Version: 1.0.0

Many of the labels are way off the screen.

12 hours ago, each of these lines were correctly spaced out vertically, and horizontally aligned to the right. No code changes have been made, I even went back to a version from days ago to confirm something changed on the engine level.

This UI works by categorizing (n) amount of text labels in to groups. These groups are represented with a resizable frame (AutomaticSize), such that it grows to match the size of the text labels within it. Each group uses a UIListLayout to align the text labels. The groups are then laid out using a UIListLayout in a parent frame.

Here is a repro:
DebugGuiRepro.rbxl (62.9 KB)

Expected behavior

I expect all the UI elements to be aligned correctly as they were yesterday.

5 Likes

Hi, thanks for reporting! This might be caused by flex layout + some layout optimizations that were rolled out yesterday.

Could you please share a link to the place with this issue? I can then disable these optimizations for your place.

Thanks!

1 Like

Does this mean I need to rewrite my Debug Gui module? Would be quite an annoyance if that was the case. Utilizing AutomaticSize and UIListLayouts means there’s zero layout logic I have to do manually.

Places that currently use it:

1 Like

My apologies for breaking your Debug Gui module, this is a bug on our side (in the layout pipeline)! So no need to rewrite your module.
We will fix the bug eventually, but in the meantime I will disable the layout optimizations for the games you posted.

1 Like

Sending a reply to confirm that the GUI is now functioning properly after you disabled the code change.

1 Like

This still seems to be happening when playing, even after the release of the flex features. When using AutomaticSize and padding, it ignores the padding in most cases, but the behaviour is normal when editing in Studio. Could we get an estimated time on when this issue will be fixed?

Hi, thanks for reporting this!

Just checking if you are noticing the AutomaticSize + padding issue occurring for new flex layouts, or if it is affecting existing non-flex UIListLayouts?

There is a bug reported for flex layouts + padding + AutomaticCanvasSize, just checking if this is the issue you are referring or is it different? Flex Features for UIListLayout Client Release - #44 by winpol

If possible, would you be able to post a screenshot or link to an example of the issue? That will help us narrow down where the bug is! Thanks!

When can I expect a fix for this? I use this paradigm a lot in my UIs.

Specifically this is happening for me on a TextButton inside of an existing non-flex UIListLayout, I have not used any of the flex features at all. I am using UIPadding inside of the button with AutomaticSize set to X, so it extends with the length of the text and provides padding on the sides for spacing.

I have multiple SurfaceGuis of the same thing in my place, and it only happens on some of them randomly.

This is how it appears while playing:
image
and this is how it should appear (the correct way):
image

This problem also seems to be happening in Studio now, but it can be temporarily fixed by removing and readding the UIPadding.

The “Info” frame also has AutomaticSize set to X and seems to be working fine, but the problem is happening with the TextButton not applying the UIPadding.
image

1 Like

Hi, thanks for providing more details!

If possible, could you share a repro file (rbxm or rbxl) for the UI with the bug please? I was not able to repro in Studio based on the info you provided. Thanks!

I was able to reproduce the bug in this file, so hopefully it should show up.
You may have to rejoin the place a couple of times, but it does happen.

UIPaddingBug.rbxl (61.4 KB)

1 Like

OK thanks for the file! I was able to repro in the Client. I’ll post here when we have an update on this!

1 Like

Hi @orange451 just wanted to update you that I turned on a fix for the layout bug in the debug UI in your original post! So flex layout should be enabled for the places you posted, with with the debug UI still functioning properly.

Could you please confirm the places/debug UI are working correctly when you have a chance? Thank you!

@idezye do you happen to remember if this padding bug was happening before flex layout was released? I tested with the flex flags off, and was still able to repro. So I’m wondering if this bug existed before flex was added?

Hey @stadium_parkour2,

I might jump in here just to let you know that I also experienced this issue with one of my UIs. I managed to fix it by readjusting the padding but the underlying bug should still be fixed, hence why I’m reporting it.

My UI previously looked like this:
image

And now, after the flex update it looks like this:
image

Repro file is attached:
repro.rbxm (13.2 KB)

1 Like

It seemed to be working fine when I was in the process of developing things on Studio, the first time I noticed it breaking things was on July 25th.

1 Like

Thanks for reporting this @bvetterdays, I’ll take a look!

@bvetterdays it looks like there are 2 instances with LayoutOrder=5, Spacer and Floor2. In this case I think we use the insertion order to break the tie. So I cut/pasted the Spacer instance so it is sorted after Floor2, and got the below result:

Does this fix your issue?

Also in your first screenshot, there are 18 tiles under Floor2, but in the repro file there are 12?

Oh, it does - thanks, that’s just me being stupid then :sweat_smile:

Apologies for wasting your time here.

Yep, but this doesn’t really matter - I had to manually insert the children into each ScrollingFrame in both the fixed and broken ones so I just did random amounts for each. The issue is just the padding, which was obviously just a result of the LayoutOrder mixing up when they were equal.

Thanks for your help here. At least it’s not another bug with the new flex feature! :slightly_smiling_face:

1 Like

Yes it is fixed now. I ran from the repro rbxl I provided.

1 Like