skip icon indicating copy to clipboard operation
skip copied to clipboard

SkipUI is incomprehensible in Android Studio Layout Inspector

Open dfabulich opened this issue 8 months ago • 0 comments

Generate a basic project with skip init --appid=bundle.id project-name MyAppName and launch it in Android Studio. Open the Layout Inspector view.

Actual: The result is a nested view of indistinguishable Compose / ComposeContent / setValues calls. It's completely illegible.

Expected: There should be a Compose component in this view called "ContentView", "WelcomeView", "ItemListView", etc.

It gets even worse if you click the eyeball menu, "View Options for Component Tree", and uncheck "Show Compose as Callstack". That's normally the way you can see which components are nested inside other components, but if you turn that on, the components are nested so deeply that you can't read names of the components at all.

The problem is that the top-level SwiftUI structs are being transpiled to classes that are not, themselves, @Composable functions. Instead, the body functions of each View class returns ComposeBuilder objects. SkipUI will then call ComposeBuilder.Compose(), which is composable, but Layout Inspector just calls that component "Compose". And all "Compose" entries basically look the same.

Layout Inspector has no way of knowing that this call to Compose() is a WelcomeView and that call to Compose() is an ItemListView(). They're all just "Compose" components, making the Layout Inspector unusable.

Image

dfabulich avatar Apr 17 '25 02:04 dfabulich