Bookmarks Module

← App map · The saved tab: every bookmarked article in the same staggered grid as For You, with an undo snackbar.

Screenshots scroll sideways · tap to enlarge

What it does

The grid lists only news resources you've bookmarked (observeAllBookmarked()), reusing the same newsFeed() composable as the For You module. Un-bookmarking a card doesn't remove it from the list right away: the view-model flips shouldDisplayUndoBookmark and remembers the id, the screen shows a snackbar with an Undo action, and only once the snackbar is dismissed without being undone does clearUndoState() run — the underlying setNewsResourceBookmarked(id, false) already happened, so the list re-filters itself out on the next observeAllBookmarked() emission. An empty list shows a dedicated illustration and caption instead of a blank grid.

Logic class diagram

No onboarding here — one repository pair feeds one state, plus two plain mutableStateOf fields for the undo snackbar.

Screen widget composition

A staggered grid of the same cards as For You, or one EmptyState in their place.

Un-bookmark, then undo sequence

The snackbar is the only thing standing between "removed" and "still there."

Key files