协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
compose-state-and-effects【开发与工程】Use 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.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
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 |