From a61ec2911c917ea9d8d766e48d5dd3ca8e089de0 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 1 Jul 2026 14:27:40 +0000 Subject: [PATCH] fix(podcasts): compact bookmark button, drop the confirmation toast MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - The bookmark toggle was a Material IconButton (48dp minimum touch target), so it stood taller than the titleLarge line it sits beside and broke the side-by-side alignment. Render it as a compact clickable glyph sized to a single title line (iconSize, default 20dp) so title and button align. - Drop the add/remove toast — the icon flipping filled/outline is enough feedback — and remove the now-unused strings. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01JGa1EM5KWyDo1o5Yr6sS18 --- .../ui/note/types/PodcastBookmarkButton.kt | 45 +++++++++++++------ amethyst/src/main/res/values/strings.xml | 2 - 2 files changed, 32 insertions(+), 15 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/PodcastBookmarkButton.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/PodcastBookmarkButton.kt index 7bda05e32f..6e33d108df 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/PodcastBookmarkButton.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/PodcastBookmarkButton.kt @@ -20,12 +20,21 @@ */ package com.vitorpamplona.amethyst.ui.note.types -import androidx.compose.material3.IconButton +import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.shape.CircleShape import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.runtime.remember +import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.semantics.Role +import androidx.compose.ui.unit.Dp +import androidx.compose.ui.unit.dp import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.vitorpamplona.amethyst.R import com.vitorpamplona.amethyst.commons.icons.symbols.Icon @@ -44,13 +53,18 @@ import com.vitorpamplona.amethyst.ui.stringRes * * Bookmarked state is read from the public bookmark id/address **sets** (not `List` * containment) so it reflects reliably for addressable notes and updates the moment the list - * changes; a toast confirms each add/remove so the action is never silent. + * changes — the icon flipping filled/outline is the feedback, no toast needed. + * + * Rendered as a compact clickable glyph (not a Material [androidx.compose.material3.IconButton], + * whose 48dp minimum touch target would stand taller than the title it sits beside). [iconSize] + * defaults to a single title line so it aligns when placed next to a show/episode title. */ @Composable fun PodcastBookmarkButton( note: Note, accountViewModel: AccountViewModel, modifier: Modifier = Modifier, + iconSize: Dp = 20.dp, ) { val bookmarkState = accountViewModel.account.bookmarkState @@ -66,17 +80,21 @@ fun PodcastBookmarkButton( } } - IconButton( - onClick = { - if (isBookmarked) { - accountViewModel.removePublicBookmark(note) - accountViewModel.toastManager.toast(R.string.bookmarks_title, R.string.podcast_bookmark_removed) - } else { - accountViewModel.addPublicBookmark(note) - accountViewModel.toastManager.toast(R.string.bookmarks_title, R.string.podcast_bookmark_added) - } - }, - modifier = modifier, + Box( + modifier = + modifier + .clip(CircleShape) + .clickable( + role = Role.Button, + onClick = { + if (isBookmarked) { + accountViewModel.removePublicBookmark(note) + } else { + accountViewModel.addPublicBookmark(note) + } + }, + ).padding(4.dp), + contentAlignment = Alignment.Center, ) { Icon( symbol = if (isBookmarked) MaterialSymbols.Bookmark else MaterialSymbols.BookmarkAdd, @@ -85,6 +103,7 @@ fun PodcastBookmarkButton( if (isBookmarked) R.string.remove_from_public_bookmarks else R.string.add_to_public_bookmarks, ), tint = if (isBookmarked) MaterialTheme.colorScheme.primary else MaterialTheme.colorScheme.onSurfaceVariant, + modifier = Modifier.size(iconSize), ) } } diff --git a/amethyst/src/main/res/values/strings.xml b/amethyst/src/main/res/values/strings.xml index 55cbee93e7..b8b2b2be5e 100644 --- a/amethyst/src/main/res/values/strings.xml +++ b/amethyst/src/main/res/values/strings.xml @@ -1011,8 +1011,6 @@ Value-for-Value %1$d%% Zaps to this are split between: - Added to your bookmarks - Removed from your bookmarks Host Co-host Editor