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.
This commit is contained in:
Claude
2026-05-19 13:45:56 +00:00
parent d41cf6d75b
commit f2f02ab5cb
2 changed files with 14 additions and 9 deletions
@@ -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,
)
}
}
}
@@ -483,7 +483,7 @@ private fun FullBleedNoteCompose(
)
Column(
Modifier
modifier
.fillMaxWidth()
.padding(top = 10.dp),
) {