From f2f02ab5cb2fd2a8a6a24c10372386f596f63716 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 19 May 2026 13:45:56 +0000 Subject: [PATCH] fix(thread): restore long-press on root note + anchor popup to the card Two related fixes to the thread quick-action popup: - ThreadFeedView.FullBleedNoteCompose declared a `modifier` parameter that NoteMaster used to attach `combinedClickable(onLongClick = showPopup)`, but the body built a fresh `Modifier.fillMaxWidth().padding(top = 10.dp)` for its root Column and discarded the incoming modifier. Long-press on the root note in thread view never fired. Spread the incoming modifier onto the Column. - LongPressToQuickAction emitted the Popup as a sibling of the content with no wrapping layout. The Popup's `parentLayoutCoordinates` then resolved to the enclosing LazyColumn, so `alignment = Alignment.Center` centered the menu on the whole list (visually middle of the screen) instead of the long-pressed card. Wrap content + Popup in a Box so the popup's parent bounds match the note card. --- .../amethyst/ui/note/NoteQuickActionMenu.kt | 21 ++++++++++++------- .../loggedIn/threadview/ThreadFeedView.kt | 2 +- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteQuickActionMenu.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteQuickActionMenu.kt index 0f1b1bf97d..7591b7d582 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteQuickActionMenu.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteQuickActionMenu.kt @@ -24,6 +24,7 @@ import android.content.Intent import android.widget.Toast import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.IntrinsicSize import androidx.compose.foundation.layout.PaddingValues @@ -136,15 +137,19 @@ fun LongPressToQuickAction( ) { val popupExpanded = remember { mutableStateOf(false) } - content { popupExpanded.value = true } + // Box anchors the Popup to the note card; otherwise its parent resolves to the + // enclosing LazyColumn and `Alignment.Center` centers on the whole list. + Box { + content { popupExpanded.value = true } - if (popupExpanded.value) { - NoteQuickActionMenu( - note = baseNote, - onDismiss = { popupExpanded.value = false }, - accountViewModel = accountViewModel, - nav = nav, - ) + if (popupExpanded.value) { + NoteQuickActionMenu( + note = baseNote, + onDismiss = { popupExpanded.value = false }, + accountViewModel = accountViewModel, + nav = nav, + ) + } } } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/threadview/ThreadFeedView.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/threadview/ThreadFeedView.kt index d0e69096ef..9ee40ef80d 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/threadview/ThreadFeedView.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/threadview/ThreadFeedView.kt @@ -483,7 +483,7 @@ private fun FullBleedNoteCompose( ) Column( - Modifier + modifier .fillMaxWidth() .padding(top = 10.dp), ) {