skiptools / skiptools/skip-ui

Asset images are loaded asynchronously on Android

Open
#154 16 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

https://github.com/skiptools/skip-ui/blob/6e2e63eb1fa2e8e998f3e5bea6012e272469b181/Sources/SkipUI/SkipUI/Components/Image.swift#L155

All asset images are being loaded with coil3.compose.SubcomposeAsyncImage.

As a result, when you navigate to the Image playground in the showcase, on Android, you see a layout shift as the asset images pop in, but on iOS, there isn't.

Ordinarily when using AsyncImage I'd use its placeholder: argument to prevent layout shift, but this is just a simple Image, so there's no way to use a placeholder.

Ideally, asset images should loaded synchronously by default. If not that, then there should be some way to load asset images synchronously. If not that, then there should at least be a way to provide a placeholder for asynchronously loaded asset images, and this should be documented.

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

Start at Sources/SkipUI/SkipUI/Components/Image.swift around line 155 and inspect how asset images use coil3.compose.SubcomposeAsyncImage on Android. Compare the Android behavior with the iOS implementation and the Image playground in the showcase. Done means the Android asset images no longer cause a layout shift, or the supported placeholder behavior is documented if synchronous loading is not possible.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.