brainstorming
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).
compose-state-and-effectsUse when writing or reviewing Jetpack Compose state ownership, remember state, state hoisting, screen state holders, LaunchedEffect, DisposableEffect, SideEffect, Flow collection, navigation, snackbar, analytics, or focus requests.
Independent GitHub snapshot · Automated classification · Original documentation governs
Give every piece of UI state one lowest responsible owner, then run imperative work through the effect whose lifecycle follows that owner. Composition renders; state and effects make rendering change safely.
A screen-ownership review is incomplete until it names the plain, previewable content composable that receives immutable state and event callbacks separately from app wiring and composition-owned runtime objects.
@Preview
wrapper is optional and is not required for the state-driven boundary.
Before adding it, confirm the module declares its tooling; do not assume
Compose runtime or UI dependencies provide it. Respect the task's file
scope: do not add tooling or change build files unless authorized. If
Preview tooling is needed but unavailable within scope, omit the wrapper
and report the setup gap.@ReadOnlyComposable contracts to Compose performance.
For that contract, distinguish a read of snapshot State.value from an
operation that changes the composer; the state read alone is not a violation.| Signal | Read |
|---|---|
Bare local var, remember { mutableStateOf(...) }, state lists/maps, or reset state | Local state |
| State shared by siblings, UI state holders, ViewModel/component wiring, or previewable screen boundaries | State hoisting |
LaunchedEffect, DisposableEffect, SideEffect, snapshotFlow, rememberCoroutineScope, rememberUpdatedState, produceState, imperative requestFocus, callbacks, event Flow collection, snackbar, navigation, or analytics | Side effects |
| Focus ownership and keyboard/TV/D-pad behavior | Compose focus navigation |
| Tests or previews for the resulting UI contract | Compose UI testing patterns |