preserving-state-across-reloads

Installation
SKILL.md

Preserving State Across Reloads: keep edits inside HotSwan tier 1

Compose HotSwan applies every hot reload through three escalating tiers. Tier 1 (targeted recomposition) preserves the most: scroll position, navigation back stack, remember and rememberSaveable values, ViewModel state, lazy layout items, dialog and bottom sheet state. Tier 2 (composition reset) disposes and recreates compositions, dropping per-composable remember. Tier 3 (Activity.recreate()) restarts the Activity and only state held by ViewModel or SavedInstanceState survives.

The iteration loop is fastest and least surprising when every reload stays inside tier 1. This skill covers which edits trigger which tier, which state holders survive each tier, and how to hoist transient UI state when an edit must escalate.

When to use this skill

  • The developer reports "scroll jumped to top after a hot reload", "lost dialog state", "lazy column re-fetched", or "tab selection reset to zero".
  • The developer is about to refactor a composable and wants to know which recomposition scope the change touches.
  • The HotSwan tool window status shows a tier 2 or tier 3 reload and the developer wants to understand why it escalated.
  • The developer asks which state holders survive Activity.recreate() versus a composition reset.
  • The user mentions "tier 1", "tier 2", "tier 3", "composition reset", "HotSwan state preservation", or "rememberSaveable across reload".

When NOT to use this skill

Related skills

More from skydoves/compose-performance-skills

Installs
8
GitHub Stars
381
First Seen
Apr 29, 2026