~cytrogen/vbhelper

ref: fd45537bd5fd8870ed771a0d172aecc7040c3a25 vbhelper/.claude/rules/compose.md -rw-r--r-- 903 bytes
fd45537b — Cytrogen Replace README.md with Chinese README.org a month ago

#Compose UI Conventions

#Screen Structure

  • Screen composables receive NavController + a Controller interface (not impl)
  • Controller interfaces define callbacks and state flows for the screen
  • Do not use ViewModel — this project uses Controller pattern instead
  • Controllers use callback lambdas passed to composables, not StateFlow for events

#Material 3

  • Use Material 3 components (androidx.compose.material3.*)
  • Support dynamic color (Monet) on Android 12+ — avoid hardcoded colors
  • Use MaterialTheme.colorScheme and MaterialTheme.typography tokens

#State Management

  • Collect Flows as Compose state via collectAsState() or collectAsStateWithLifecycle()
  • Keep UI state in the Controller, not in the composable (except transient UI state like scroll position)
  • Composable functions should be stateless where possible — receive data and callbacks as parameters