Support for "Overlay" visibility in ChildStack for Shared Transitions

Open
#994 6 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
kotlin
Domain
mobile-dev

Research direction

Start by reading the ChildStack shared-element transition and predictive-back visibility handling described in the issue. Compare how multiple items remain composed during the gesture with the settled state for transparent or overlay components. Done means the underlying child remains visible behind the active child without breaking the shared transition.

Written by the indexing model from the issue text.

Description

enhancement

When navigating between two components (e.g., GalleryComponent -> PhotoComponent) using a ChildStack with a shared element transition, the "underlying" component (GalleryComponent) is removed from the composition as soon as the transition completes.

This becomes problematic when the top-level component (PhotoComponent) has a transparent or semi-transparent background (e.g., a "hero" image view with a background alpha that the user can drag or swipe away). Currently, once the transition settles, the background becomes empty/black because the previous stack item is no longer present in the ChildStack's active state.

Expected Behavior

There should be a mechanism to keep the previous component in the composition when the current component is marked as an "overlay" or "transparent," allowing it to remain visible behind the active child.

Possible Solutions
  1. I tried to isolate PhotoComponent into a standalone ChildSlot and place both the ChildStack and ChildSlot inside a Box. While this successfully achieves the "overlap" effect, it breaks the shared element transition because the components reside in different AnimatedVisibilityScope contexts.
  2. Since the predictive back gesture already handles this visibility perfectly during the drag (rendering multiple items at once), could this logic be extended to the settled state for specific components?
Dominant language
Kotlin
Stars
2.9k
Forks
111
Avg merge
11h 28m
Merged PRs (30d)
26

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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.

More from arkivanov/Decompose

All issues in arkivanov/Decompose

Similar issues

More Kotlin issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.