skiptools / skiptools/skip-ui

SkipUI is incomprehensible in Android Studio Layout Inspector

Open
#192 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

compose debugging
Dominant language
Swift
Stars
330
Forks
76
Avg merge
3h 6m
Merged PRs (30d)
1

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with skip init --appid=bundle.id project-name MyAppName, launch it in Android Studio, and open Layout Inspector. Start by tracing how SwiftUI body functions return ComposeBuilder objects and how SkipUI invokes ComposeBuilder.Compose(). Done means the component tree identifies views such as ContentView, WelcomeView, and ItemListView instead of indistinguishable Compose entries.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, swift
Domain
developer-experience, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.