From 18fb75285ec208a26ba3360ff25f3298e1ff3c5e Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 23 May 2026 19:27:19 +0000 Subject: [PATCH 1/2] fix: keep reaction icons evenly distributed when Share is disabled The reaction row gave every item except the last a `Modifier.weight()`, which made the last item collapse to its natural width and hug the right edge of the content area. With Share (icon-only) as the default last item, all icons appeared evenly distributed. When the user disabled Share, the last weighted slot moved to Zap. Zap renders icon + counter, so its natural-width row took more space at the right and pulled the rightmost icon away from where the other icons sat (each at the left of a now-wider weighted slice), leaving the row looking unbalanced. Give every reaction an equal weighted slice so icons sit at the left of their slice regardless of which reactions are enabled. The unused space at the end of the last slice naturally provides the right-side padding where Share used to sit. --- .../com/vitorpamplona/amethyst/ui/note/ReactionsRow.kt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/ReactionsRow.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/ReactionsRow.kt index 5e7cdaf2b6..00a4481b0c 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/ReactionsRow.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/ReactionsRow.kt @@ -387,7 +387,6 @@ private fun GenericInnerReactionRow( renderReaction: @Composable (ReactionRowItem) -> Unit, ) { val enabledReactions = remember(reactions) { reactions.filter { it.enabled } } - val lastIndex = enabledReactions.lastIndex Row( verticalAlignment = CenterVertically, @@ -403,14 +402,12 @@ private fun GenericInnerReactionRow( } } - enabledReactions.forEachIndexed { index, item -> - val isLast = index == lastIndex + enabledReactions.forEach { item -> val itemWeight = if (item.action == ReactionRowAction.Reply) weightTwo else 1f - val mod = if (isLast) Modifier else Modifier.weight(itemWeight) Row( verticalAlignment = CenterVertically, horizontalArrangement = RowColSpacing, - modifier = mod, + modifier = Modifier.weight(itemWeight), ) { renderReaction(item) } From 99b7ca76be336afe8932fb14c0e472529ad83d34 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 23 May 2026 21:06:42 +0000 Subject: [PATCH 2/2] fix: only skip the weighted slice for an icon-only last reaction MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous attempt weighted every item, which made even Share collapse to the left of its slice instead of pinning to the right edge. Restore the natural-width carve-out for the last item, but gate it on `!showCounter` — Share/Pay have no counter so they stay flush against the right padding as before; Zap/Like/etc. become weighted when last so the counter doesn't sprawl out to the edge and the row stays balanced. --- .../vitorpamplona/amethyst/ui/note/ReactionsRow.kt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/ReactionsRow.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/ReactionsRow.kt index 00a4481b0c..e99817bec8 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/ReactionsRow.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/ReactionsRow.kt @@ -387,6 +387,7 @@ private fun GenericInnerReactionRow( renderReaction: @Composable (ReactionRowItem) -> Unit, ) { val enabledReactions = remember(reactions) { reactions.filter { it.enabled } } + val lastIndex = enabledReactions.lastIndex Row( verticalAlignment = CenterVertically, @@ -402,12 +403,19 @@ private fun GenericInnerReactionRow( } } - enabledReactions.forEach { item -> + enabledReactions.forEachIndexed { index, item -> + // Skip the weighted slice for the rightmost item only when it has no counter + // (e.g. Share / Pay) — those are icon-only, so letting them collapse to natural + // width pins them flush against the right padding. If the rightmost item carries + // a counter (Zap / Like / etc.), keep it weighted so its icon stays at the left + // of an equal-width slice and the counter doesn't get pushed to the edge. + val isLastIconOnly = index == lastIndex && !item.showCounter val itemWeight = if (item.action == ReactionRowAction.Reply) weightTwo else 1f + val mod = if (isLastIconOnly) Modifier else Modifier.weight(itemWeight) Row( verticalAlignment = CenterVertically, horizontalArrangement = RowColSpacing, - modifier = Modifier.weight(itemWeight), + modifier = mod, ) { renderReaction(item) }