Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard
sealed interface FeedIntent
Link copied to clipboard
data class FeedState(val availableTopics: List<Topic> = emptyList(), val selectedTopic: Topic = Topic.All, val feeds: Map<Topic, TopicFeed> = emptyMap(), val pendingBookmarkAction: PendingBookmarkAction? = null, val pendingBookmarkToggles: Set<String> = emptySet(), val isRefreshing: Boolean = false)

The feed is a 2D pager: horizontal across availableTopics, vertical (one card at a time) through each topic's posts. Each topic therefore keeps its own TopicFeed (posts, scroll position, pagination) so adjacent pager pages - which are composed simultaneously - show the right content.

Link copied to clipboard
class FeedViewModel(postsRepository: PostsRepository, authRepository: AuthRepository, bookmarkIdsStore: BookmarkIdsStore, topicPreferencesStore: TopicPreferencesStore, timeSource: TimeSource = TimeSource.Monotonic) : ViewModel
Link copied to clipboard
data class PendingBookmarkAction(val postId: String)
Link copied to clipboard
data class TopicFeed(val posts: List<Post> = emptyList(), val currentIndex: Int = 0, val nextCursor: String? = null, val isLoadingInitial: Boolean = false, val isLoadingMore: Boolean = false, val error: FeedError? = null, val fetchedAt: TimeMark? = null)

Functions

Link copied to clipboard
fun FeedNavHost(onRootChanged: (Boolean) -> Unit, viewModel: FeedViewModel = koinViewModel())

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 FeedScreen(state: FeedState, onIntent: (FeedIntent) -> Unit, onReadSourceClick: (String) -> Unit, onCardClick: (String) -> Unit, modifier: Modifier = Modifier, sharedTransition: SharedElementContext? = null)