AGPL-3.0-only, a source link in the app, and everything on dev since #5 #6

Merged
bvandeusen merged 214 commits from dev into main 2026-10-21 21:40:00 -04:00
Showing only changes of commit 96e9fbfb3a - Show all commits
@@ -99,15 +99,7 @@ fun BoardScreen(
) {
val drawerState = rememberDrawerState(DrawerValue.Closed)
val scope = rememberCoroutineScope()
// Opening a tag's lens counts as using it, however it was opened: from the
// drawer, or a tag on a card (#5931).
val context = LocalContext.current
val tagViews = remember(context) { TagViews(context) }
var views by remember { mutableStateOf(tagViews.all()) }
LaunchedEffect(state.destination) {
(state.destination as? Destination.WithLabel)?.let { views = tagViews.record(it.id) }
}
val views = rememberTagViews(state.destination)
val snackbars = remember { SnackbarHostState() }
// Held HERE rather than on the card. A card lives in a lazy grid and is disposed
@@ -410,6 +402,21 @@ private fun SearchBar(
}
}
/**
* When each tag's lens was last opened here. Opening one counts as using it,
* however it was opened: from the drawer, or a tag on a card (#5931).
*/
@Composable
private fun rememberTagViews(destination: Destination): Map<String, Long> {
val context = LocalContext.current
val tagViews = remember(context) { TagViews(context) }
var views by remember { mutableStateOf(tagViews.all()) }
LaunchedEffect(destination) {
if (destination is Destination.WithLabel) views = tagViews.record(destination.id)
}
return views
}
@Composable
private fun NavigationDrawer(
current: Destination,