How to preview PropertyFields in the Builder

I picked back up a project I worked on a few years ago that’s using UI Toolkit for a pretty extensive editor. Back then I avoided using the UI builder because of how broken it used to be, and just generated the UI from code.

I figured I might give it a go, and it turns out that it’s much more stable these days! Which is great. No errors and Undo kinda works.

I did run into a problem with PropertyFields, though. If I add them, they have zero size so I can’t really tell what the editor will look like. I looked through what I could find of documentation, and it’s pretty clear what the problem is:

This is obviously a problem! The UI Builder is for designing UI! If I can’t see what the UI will look like, I might as well just hand-write the uxml anyway.

The obvious solution would be to have a drop-down to specify which kind of propertyType the PropertyField will have, and then rebuild the UI based on that. If that’s not possible, at least a preview of a generic object picker or whatever would allow us to style the size of the label and input field properly.

Is there a better way to do this? I guess I could just use eg. a TextField for text properties and then bind them manually, but that seems pretty crazily bad.

Oh, but the EnumField allowing you to enter the enum type in the Builder and then automatically updating is pretty kick-ass!