Add bookmark list addition/removal to the note dropdown menu.

This commit is contained in:
KotlinGeekDev
2025-11-26 22:25:59 +01:00
parent 5742968f4c
commit a0bff70dc2
2 changed files with 19 additions and 0 deletions
@@ -40,6 +40,7 @@ import androidx.compose.ui.text.AnnotatedString
import androidx.core.content.ContextCompat
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.vitorpamplona.amethyst.R
import com.vitorpamplona.amethyst.model.AddressableNote
import com.vitorpamplona.amethyst.model.Note
import com.vitorpamplona.amethyst.service.relayClient.reqCommand.user.observeUserBookmarks
import com.vitorpamplona.amethyst.service.relayClient.reqCommand.user.observeUserFollows
@@ -58,6 +59,7 @@ import com.vitorpamplona.amethyst.ui.stringRes
import com.vitorpamplona.amethyst.ui.theme.DividerThickness
import com.vitorpamplona.amethyst.ui.theme.Size24Modifier
import com.vitorpamplona.quartz.nip10Notes.TextNoteEvent
import com.vitorpamplona.quartz.nip23LongContent.LongTextNoteEvent
import com.vitorpamplona.quartz.nip36SensitiveContent.isSensitiveOrNSFW
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
@@ -297,6 +299,21 @@ fun NoteDropDownMenu(
)
}
HorizontalDivider(thickness = DividerThickness)
note.let {
val noteBookmarkType = if (note.event is LongTextNoteEvent) stringRes(R.string.article) else stringRes(R.string.post)
DropdownMenuItem(
text = { Text(stringRes(R.string.manage_bookmark_label, noteBookmarkType)) },
onClick = {
if (note.event is LongTextNoteEvent) {
val noteAddress = (note as AddressableNote).address
nav.nav(Route.ArticleBookmarkManagement(noteAddress))
} else {
nav.nav(Route.PostBookmarkManagement(note.idHex))
}
onDismiss()
},
)
}
if (state.isPrivateBookmarkNote) {
DropdownMenuItem(
text = { Text(stringRes(R.string.remove_from_private_bookmarks)) },
+2
View File
@@ -112,6 +112,7 @@
<string name="error_parsing_preview_for">"Error parsing preview for %1$s : %2$s"</string>
<string name="preview_card_image_for">"Preview Card Image for %1$s"</string>
<string name="article">Article</string>
<string name="new_channel">New Channel</string>
<string name="channel_name">Channel Name</string>
<string name="my_awesome_group">My Awesome Group</string>
@@ -406,6 +407,7 @@
<string name="private_articles_count">Private Articles(%1$s)</string>
<string name="public_articles_label">Public Articles</string>
<string name="public_articles_count">Public Articles(%1$s)</string>
<string name="manage_bookmark_label">Manage %1$s in Bookmark Lists</string>
<string name="wallet_connect_service">Wallet Connect Service</string>
<string name="wallet_connect_service_explainer">Authorizes a Nostr Secret to pay zaps without leaving the app. Keep the secret safe and use a private relay if possible</string>