Skip to content

Support for SkipFuseUI Animation Performance Fix (Android) - #500

Open
tifroz wants to merge 8 commits into
skiptools:mainfrom
tifroz:experimental_animation-performance
Open

Support for SkipFuseUI Animation Performance Fix (Android)#500
tifroz wants to merge 8 commits into
skiptools:mainfrom
tifroz:experimental_animation-performance

Conversation

@tifroz

@tifroz tifroz commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Thank you for contributing to the Skip project! Please review the contribution guide at https://skip.dev/docs/contributing/ for advice and guidance on making high-quality PRs.

Use this space to describe your change and add any labels (bug, enhancement, documentation, etc.) to help categorize your contribution.

Skip Pull Request Checklist:

  • REQUIRED: I have signed the Contributor Agreement
  • REQUIRED: I have tested my change locally with swift test
  • OPTIONAL: I have tested my change on an iOS simulator or device
  • OPTIONAL: I have tested my change on an Android emulator or device
  • REQUIRED: I have checked whether this change requires a corresponding update in the Skip Fuse UI repository (see Animation Performance Fix (Android) skip-fuse-ui#134)
  • OPTIONAL: I have added an example of any UI changes to the Showcase sample app

  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes.

Codex generated the code with supervision, UI tests conducted manually to validate performance improvements


Summary

This PR supports the SkipFuseUI addition of .androidEquatable() and .androidCompositionBoundary() APIs to protect UI view subtrees from excessive recomposing

  • Add Android-only equatable subtree reuse so unchanged views can skip repeated body evaluation.
  • Add retained Android composition boundaries for subtrees that need isolated Compose identity and lifecycle.
  • Preserve ForEach child identity through stack insertions, removals, and reordering.
  • Tighten bridged animation provenance, cancel in-flight animations on plain writes, and support explicit first-render animation sources.
  • Avoid a transient zero-sized placeholder for constrained resizable cached images.
  • Documentation update

Testing

  • Added AndroidEquatableTests coverage for unchanged and changed cache keys, ForEach identity, lazy stacks, environment values, hoisted state, actions, and bridged factories.
  • Added animation and transaction coverage for bridged provenance consumption and plain-write behavior.

Usage Example

struct ContactRow: View, Equatable {
    let contact: Contact

    var body: some View {
        Text(contact.name)
    }
}

ContactRow(contact: contact)
    .androidEquatable()

For non-Equatable views, provide an explicit cache key:

ContactRow(contact: contact, onSelect: onSelect)
    .androidEquatable(recomposeOverride: contact)

Use a retained composition boundary when a subtree needs separate hosting:

PlayerSurface(player: player)
    .androidCompositionBoundary(
        id: player.id.uuidString,
        inputs: String(player.renderRevision)
    )

API Shape

extension View where Self: Equatable {
    public func androidEquatable() -> some View
}

extension View {
    public func androidEquatable<RecomposeOverride: Equatable>(
        recomposeOverride: RecomposeOverride
    ) -> some View

    public func androidCompositionBoundary(
        id: String,
        inputs: String = ""
    ) -> some View
}

The bridge surface also gains lazy AndroidEquatableContent, AndroidCompositionBoundary projection lifecycle support, compositor transforms, and experimental first-render helpers for frame, offset, opacity, and scale.

Notes

SkipFuseUI skiptools/skip-fuse-ui#134 depends on this PR

tifroz added 7 commits July 29, 2026 12:36
- preserve ForEach and stack composition identity
- improve equatable content caching and bridge equality
- support explicit first-render animation sources
- prevent animation provenance from leaking between modifiers
- document Android rendering performance APIs
@cla-bot cla-bot Bot added the cla-signed label Jul 29, 2026
@tifroz tifroz changed the title Experimental animation performance Support for SkipFuseUI Animation Performance Fix (Android) Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant