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.