Files
app/.cursor/rules/utils-preference.mdc
T
2026-04-21 14:49:30 +03:00

26 lines
824 B
Plaintext

---
description: Prefer utils package APIs when available
globs: "**/*.kt"
alwaysApply: true
---
# Utils Package Preference
When working with the Android/KMP codebase, prefer APIs from `com.pr0gramm3r101.utils` whenever possible.
## Clipboard
- Use `supportClipboardManagerImpl` (Composable) instead of `LocalClipboardManager` / `LocalClipboard`
- `SupportClipboardManager.setText(string: String)` is suspend; call from `scope.launch { }`
## String
- Use `String.toAnnotatedString()` for `AnnotatedString` conversion
## Modifier
- Use `Modifier.conditional` from `com.pr0gramm3r101.utils.Compose` for conditional modifiers
## CompositionLocal
- Use `CompositionLocal.invoke()` for `current` when available
## Other
- Check `Utils.kt`, `Compose.kt`, `Components.kt`, `Adaptive.kt` before implementing custom solutions