Package-level declarations

Types

Link copied to clipboard
sealed interface AccountEffect
Link copied to clipboard
sealed interface AccountIntent
Link copied to clipboard
data class AccountState(val isLoggedIn: Boolean = false, val avatarUrl: String? = null, val bannerUrl: String? = null, val avatarUpload: ImageUploadState = ImageUploadState.Idle, val bannerUpload: ImageUploadState = ImageUploadState.Idle, val isRefreshing: Boolean = false, val pendingCrop: PendingCrop? = null, val avatarError: String? = null, val bannerError: String? = null, val deleteDataInProgress: Boolean = false, val deleteDataError: String? = null, val displayName: String? = null, val handle: String? = null, val email: String? = null, val bio: String? = null, val isVerified: Boolean = false, val savedCount: Int? = null, val followedTopics: List<Topic> = emptyList())
Link copied to clipboard
class AccountViewModel(authRepository: AuthRepository, profileRepository: ProfileRepository, followedTopics: StateFlow<Set<Topic>>, bookmarkIds: StateFlow<Set<String>>, userDataRepository: UserDataRepository) : ViewModel
Link copied to clipboard

Which profile image an in-progress pick/crop targets.

Link copied to clipboard
sealed interface LoginSheetEffect
Link copied to clipboard
sealed interface LoginSheetIntent
Link copied to clipboard
data class LoginSheetState(val isSubmitting: Boolean = false, val error: String? = null)
Link copied to clipboard
class LoginSheetViewModel(authRepository: AuthRepository, redirectFailures: SharedFlow<Unit>) : ViewModel
Link copied to clipboard
data class PendingCrop(val target: ImageTarget, val image: PickedImage)

A just-picked image awaiting the interactive crop step before it's uploaded.

Functions

Link copied to clipboard
fun AccountNavHost(onRootChanged: (Boolean) -> Unit, onDataDeleted: () -> Unit)

Owns only this tab's Navigation 3 backstack and content - the bottom chrome (bottom nav bar / rail) lives one level up in MainShell, which decides whether to show it from onRootChanged: each NavHost reports whether it's currently showing its own root screen (backstack depth 1), so MainShell can hide the shared bottom bar while any tab is showing a pushed detail screen.

Link copied to clipboard
fun AccountRoute(onSettingsClick: () -> Unit, onAvatarClick: () -> Unit, onBannerClick: () -> Unit, viewModel: AccountViewModel = koinViewModel(), modifier: Modifier = Modifier, avatarSharedTransition: SharedElementContext? = null, bannerSharedTransition: SharedElementContext? = null)
Link copied to clipboard
fun AccountScreen(state: AccountState, onIntent: (AccountIntent) -> Unit, onSignInClick: () -> Unit, onSettingsClick: () -> Unit, onAvatarClick: () -> Unit, onAvatarEditClick: () -> Unit, onBannerClick: () -> Unit, onBannerEditClick: () -> Unit, modifier: Modifier = Modifier, avatarSharedTransition: SharedElementContext? = null, bannerSharedTransition: SharedElementContext? = null)
Link copied to clipboard
fun ImageCropScreen(image: PickedImage, aspect: Float, circularMask: Boolean, onCancel: () -> Unit, onConfirm: (PickedImage) -> Unit, modifier: Modifier = Modifier)

Full-screen interactive cropper: the user pans and pinch-zooms image within a fixed aspect frame, and on confirm the framed region is cropped to source pixels and returned via onConfirm. circularMask draws the frame as a circle (avatars); the produced crop is still the frame's rectangle. If the image's dimensions can't be decoded, confirming passes the original through unchanged rather than blocking the user.

Link copied to clipboard
fun ImageEditSheet(onDismiss: () -> Unit, onTakePhoto: () -> Unit, onChooseFromGallery: () -> Unit, onRemove: () -> Unit?, cameraAvailable: Boolean = true)

Bottom sheet of actions for the avatar/banner edit badge: take a photo, choose from the gallery, or remove the current image. onRemove is null when there's nothing to remove (no current image), in which case that row is hidden. Each action is expected to dismiss the sheet via its callback at the call site.

Link copied to clipboard
fun ImageEditSheetContent(onTakePhoto: () -> Unit, onChooseFromGallery: () -> Unit, onRemove: () -> Unit?, modifier: Modifier = Modifier, cameraAvailable: Boolean = true)
Link copied to clipboard
fun ImageViewerScreen(imageUrl: String?, sharedElementKey: String, onBack: () -> Unit, onChangePhotoClick: () -> Unit, modifier: Modifier = Modifier, sharedTransition: SharedElementContext? = null)

Full-screen view of the current avatar or banner, reached by tapping either on AccountScreen. Shares a sharedTransition element keyed by sharedElementKey with the small thumbnail it expanded from (see AVATAR_SHARED_ELEMENT_KEY/BANNER_SHARED_ELEMENT_KEY).

Link copied to clipboard
fun LoginSheet(onDismiss: () -> Unit, onLoginSuccess: () -> Unit, viewModel: LoginSheetViewModel = koinViewModel())
Link copied to clipboard
fun LoginSheetContent(state: LoginSheetState, onAppleSignInClick: () -> Unit, onGithubSignInClick: () -> Unit, onGoogleSignInClick: () -> Unit, onNotNowClick: () -> Unit, modifier: Modifier = Modifier, isAppleSignInAvailable: Boolean = true)