From 34e5e7de5b5bd0b65f67c8b9bbadf4016650c0b3 Mon Sep 17 00:00:00 2001 From: KotlinGeekDev Date: Fri, 14 Nov 2025 19:38:48 +0100 Subject: [PATCH] Add bookmark groups option to side menu. Make them work by hooking them up in Account. --- .../java/com/vitorpamplona/amethyst/model/Account.kt | 2 ++ .../amethyst/ui/navigation/AppNavigation.kt | 3 +++ .../amethyst/ui/navigation/drawer/DrawerContent.kt | 9 +++++++++ .../amethyst/ui/navigation/routes/Routes.kt | 2 ++ amethyst/src/main/res/values/strings.xml | 2 ++ 5 files changed, 18 insertions(+) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/Account.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/Account.kt index 7747c59eb..894bd9f27 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/Account.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/Account.kt @@ -1784,6 +1784,7 @@ class Account( newNotesPreProcessor.runNew(newNotes) peopleLists.newNotes(newNotes) followLists.newNotes(newNotes) + labeledBookmarkLists.newNotes(newNotes) } } } @@ -1794,6 +1795,7 @@ class Account( newNotesPreProcessor.runDeleted(deletedNotes) peopleLists.deletedNotes(deletedNotes) followLists.deletedNotes(deletedNotes) + labeledBookmarkLists.deletedNotes(deletedNotes) } } } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/AppNavigation.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/AppNavigation.kt index b35f388b0..c13bd6124 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/AppNavigation.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/AppNavigation.kt @@ -57,6 +57,7 @@ import com.vitorpamplona.amethyst.ui.note.nip22Comments.ReplyCommentPostScreen import com.vitorpamplona.amethyst.ui.screen.AccountStateViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountSwitcherAndLeftDrawerLayout import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel +import com.vitorpamplona.amethyst.ui.screen.loggedIn.bookmarkgroups.list.ListOfBookmarkGroupsScreen import com.vitorpamplona.amethyst.ui.screen.loggedIn.bookmarks.BookmarkListScreen import com.vitorpamplona.amethyst.ui.screen.loggedIn.chats.privateDM.ChatroomByAuthorScreen import com.vitorpamplona.amethyst.ui.screen.loggedIn.chats.privateDM.ChatroomScreen @@ -129,6 +130,8 @@ fun AppNavigation( composableFromEndArgs { PeopleListScreen(it.dTag, accountViewModel, nav) } composableFromBottomArgs { EditPeopleListScreen(it.userToAdd, accountViewModel, nav) } + composableFromEnd { ListOfBookmarkGroupsScreen(accountViewModel, nav) } + composableFromBottomArgs { NewUserMetadataScreen(nav, accountViewModel) } composable { SearchScreen(accountViewModel, nav) } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/drawer/DrawerContent.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/drawer/DrawerContent.kt index 1f309d01c..12f2fe58f 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/drawer/DrawerContent.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/drawer/DrawerContent.kt @@ -48,6 +48,7 @@ import androidx.compose.material.icons.filled.AccountCircle import androidx.compose.material.icons.filled.Delete import androidx.compose.material.icons.outlined.BookmarkBorder import androidx.compose.material.icons.outlined.CloudUpload +import androidx.compose.material.icons.outlined.CollectionsBookmark import androidx.compose.material.icons.outlined.Drafts import androidx.compose.material.icons.outlined.GroupAdd import androidx.compose.material.icons.outlined.Key @@ -451,6 +452,14 @@ fun ListContent( route = Route.Bookmarks, ) + NavigationRow( + title = R.string.bookmark_groups, + icon = Icons.Outlined.CollectionsBookmark, + tint = MaterialTheme.colorScheme.onBackground, + nav = nav, + route = Route.BookmarkGroups, + ) + NavigationRow( title = R.string.drafts, icon = Icons.Outlined.Drafts, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/routes/Routes.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/routes/Routes.kt index fa30ee8b2..b3997b85b 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/routes/Routes.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/navigation/routes/Routes.kt @@ -46,6 +46,8 @@ sealed class Route { @Serializable object Bookmarks : Route() + @Serializable object BookmarkGroups : Route() + @Serializable object Drafts : Route() @Serializable object Settings : Route() diff --git a/amethyst/src/main/res/values/strings.xml b/amethyst/src/main/res/values/strings.xml index aee6b7f40..d780f1b94 100644 --- a/amethyst/src/main/res/values/strings.xml +++ b/amethyst/src/main/res/values/strings.xml @@ -387,6 +387,8 @@ Remove from Private Bookmarks Remove from Public Bookmarks + Bookmark Groups + Wallet Connect Service Authorizes a Nostr Secret to pay zaps without leaving the app. Keep the secret safe and use a private relay if possible Wallet Connect Pubkey