Skip to content

feat/better overlays - #147

Merged
eds2002 merged 11 commits into
mainfrom
feat/better-overlays
Aug 9, 2026
Merged

feat/better overlays#147
eds2002 merged 11 commits into
mainfrom
feat/better-overlays

Conversation

@eds2002

@eds2002 eds2002 commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Motivation

Overlays were originally introduced as a way to keep UI—such as navigation controls, onboarding actions, or persistent branding—floating above a stack while screens transition underneath. The original implementation worked, but it treated overlays as an extension of the regular screen stack and rebuilt much of the screen’s provider tree at the floating layer. This made overlays more expensive than necessary and introduced lifecycle problems, including state resetting when an overlay host remounted.

Animating overlays was also awkward. Users had to call useScreenAnimation() inside the overlay and manually recreate behavior that already belonged in the screen interpolator. Screens with overlays separated by ordinary screens had no clear transition relationship.

This change gives overlays their own sparse stack. Given:

A[] -> B -> C[] -> D -> E[]

the overlay transition order becomes:

A[] -> C[] -> E[]

The destination screen’s interpolator can now return an overlay slot to animate the adjacent overlays. Screens without overlays may also control the currently visible overlay without replacing it.

The floating host now reuses the animation and style stores created by the overlay’s owning screen instead of constructing another provider pipeline. This keeps overlays mounted while their route remains in the stack, preserves local component state, and allows useScreenAnimation() and transition styleIds to resolve against the correct owner.

The pull request also aligns repeated programmatic dismissals with gesture dismissals, narrows several provider subscriptions, adds lifecycle and adjacency coverage, and documents the new overlay contracts.

@netlify

netlify Bot commented Aug 9, 2026

Copy link
Copy Markdown

Deploy Preview for rnst-docs ready!

Name Link
🔨 Latest commit b8df804
🔍 Latest deploy log https://app.netlify.com/projects/rnst-docs/deploys/6a78876165f09e000811dfdf
😎 Deploy Preview https://deploy-preview-147--rnst-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@eds2002
eds2002 merged commit 0200626 into main Aug 9, 2026
6 checks passed
@eds2002
eds2002 deleted the feat/better-overlays branch August 9, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant