fix(nests): wire kebab to NoteDropDownMenu instead of QuickAction
The kebab on a NoteCompose card opens the comprehensive NoteDropDownMenu (Follow/Unfollow, Copy text/pubkey/note id, Share, Edit, Broadcast, Timestamp, Pin, Bookmark, Delete/Report) — not the smaller LongPressToQuickAction popup. The previous nests commit wired the kebab to the wrong menu. Replace the manual ClickableBox + VerticalDotsIcon + showQuickAction plumbing with the existing MoreOptionsButton composable, which already wraps the icon and triggers NoteDropDownMenu for both card variants. Long-press still opens NoteQuickActionMenu via the outer LongPressToQuickAction wrapper, matching NoteCompose's two-tier gesture model exactly. Drops the onMore parameter threading on ObserveAndRenderSpace, RenderLiveSpacesThumb, and SpaceHostAndReactions — MoreOptionsButton is self-contained, so the trailing optional parameter is no longer needed.
This commit is contained in:
+14
-24
@@ -65,7 +65,6 @@ import com.vitorpamplona.amethyst.model.LocalCache
|
|||||||
import com.vitorpamplona.amethyst.model.Note
|
import com.vitorpamplona.amethyst.model.Note
|
||||||
import com.vitorpamplona.amethyst.service.relayClient.reqCommand.event.observeNoteAndMap
|
import com.vitorpamplona.amethyst.service.relayClient.reqCommand.event.observeNoteAndMap
|
||||||
import com.vitorpamplona.amethyst.ui.actions.CrossfadeIfEnabled
|
import com.vitorpamplona.amethyst.ui.actions.CrossfadeIfEnabled
|
||||||
import com.vitorpamplona.amethyst.ui.components.ClickableBox
|
|
||||||
import com.vitorpamplona.amethyst.ui.components.SensitivityWarning
|
import com.vitorpamplona.amethyst.ui.components.SensitivityWarning
|
||||||
import com.vitorpamplona.amethyst.ui.layouts.rememberFeedContentPadding
|
import com.vitorpamplona.amethyst.ui.layouts.rememberFeedContentPadding
|
||||||
import com.vitorpamplona.amethyst.ui.navigation.navs.INav
|
import com.vitorpamplona.amethyst.ui.navigation.navs.INav
|
||||||
@@ -77,8 +76,8 @@ import com.vitorpamplona.amethyst.ui.note.LikeReaction
|
|||||||
import com.vitorpamplona.amethyst.ui.note.LongPressToQuickAction
|
import com.vitorpamplona.amethyst.ui.note.LongPressToQuickAction
|
||||||
import com.vitorpamplona.amethyst.ui.note.UserPicture
|
import com.vitorpamplona.amethyst.ui.note.UserPicture
|
||||||
import com.vitorpamplona.amethyst.ui.note.UsernameDisplay
|
import com.vitorpamplona.amethyst.ui.note.UsernameDisplay
|
||||||
import com.vitorpamplona.amethyst.ui.note.VerticalDotsIcon
|
|
||||||
import com.vitorpamplona.amethyst.ui.note.ZapReaction
|
import com.vitorpamplona.amethyst.ui.note.ZapReaction
|
||||||
|
import com.vitorpamplona.amethyst.ui.note.elements.MoreOptionsButton
|
||||||
import com.vitorpamplona.amethyst.ui.note.timeAgoNoDot
|
import com.vitorpamplona.amethyst.ui.note.timeAgoNoDot
|
||||||
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
|
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
|
||||||
import com.vitorpamplona.amethyst.ui.screen.loggedIn.chats.publicChannels.nip53LiveActivities.EndedFlag
|
import com.vitorpamplona.amethyst.ui.screen.loggedIn.chats.publicChannels.nip53LiveActivities.EndedFlag
|
||||||
@@ -99,7 +98,6 @@ import com.vitorpamplona.amethyst.ui.theme.QuoteBorder
|
|||||||
import com.vitorpamplona.amethyst.ui.theme.RowColSpacing
|
import com.vitorpamplona.amethyst.ui.theme.RowColSpacing
|
||||||
import com.vitorpamplona.amethyst.ui.theme.Size34dp
|
import com.vitorpamplona.amethyst.ui.theme.Size34dp
|
||||||
import com.vitorpamplona.amethyst.ui.theme.Size35dp
|
import com.vitorpamplona.amethyst.ui.theme.Size35dp
|
||||||
import com.vitorpamplona.amethyst.ui.theme.Size40dp
|
|
||||||
import com.vitorpamplona.amethyst.ui.theme.Size55dp
|
import com.vitorpamplona.amethyst.ui.theme.Size55dp
|
||||||
import com.vitorpamplona.amethyst.ui.theme.StdHorzSpacer
|
import com.vitorpamplona.amethyst.ui.theme.StdHorzSpacer
|
||||||
import com.vitorpamplona.amethyst.ui.theme.StdPadding
|
import com.vitorpamplona.amethyst.ui.theme.StdPadding
|
||||||
@@ -316,7 +314,7 @@ private fun NestFeedCard(
|
|||||||
note = baseNote,
|
note = baseNote,
|
||||||
accountViewModel = accountViewModel,
|
accountViewModel = accountViewModel,
|
||||||
) {
|
) {
|
||||||
ObserveAndRenderSpace(addressableNote, accountViewModel, nav, showQuickAction)
|
ObserveAndRenderSpace(addressableNote, accountViewModel, nav)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -416,12 +414,12 @@ private fun NestEndedCompactCard(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
ClickableBox(
|
Spacer(modifier = Modifier.width(8.dp))
|
||||||
modifier = Modifier.size(Size40dp),
|
MoreOptionsButton(
|
||||||
onClick = showQuickAction,
|
baseNote = baseNote,
|
||||||
) {
|
accountViewModel = accountViewModel,
|
||||||
VerticalDotsIcon()
|
nav = nav,
|
||||||
}
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -466,7 +464,6 @@ fun ObserveAndRenderSpace(
|
|||||||
baseNote: AddressableNote,
|
baseNote: AddressableNote,
|
||||||
accountViewModel: AccountViewModel,
|
accountViewModel: AccountViewModel,
|
||||||
nav: INav,
|
nav: INav,
|
||||||
onMore: (() -> Unit)? = null,
|
|
||||||
) {
|
) {
|
||||||
val card by observeNoteAndMap(baseNote, accountViewModel) {
|
val card by observeNoteAndMap(baseNote, accountViewModel) {
|
||||||
when (val noteEvent = it.event) {
|
when (val noteEvent = it.event) {
|
||||||
@@ -496,7 +493,6 @@ fun ObserveAndRenderSpace(
|
|||||||
baseNote,
|
baseNote,
|
||||||
accountViewModel,
|
accountViewModel,
|
||||||
nav,
|
nav,
|
||||||
onMore,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -595,7 +591,6 @@ fun RenderLiveSpacesThumb(
|
|||||||
baseNote: AddressableNote,
|
baseNote: AddressableNote,
|
||||||
accountViewModel: AccountViewModel,
|
accountViewModel: AccountViewModel,
|
||||||
nav: INav,
|
nav: INav,
|
||||||
onMore: (() -> Unit)? = null,
|
|
||||||
) {
|
) {
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
@@ -665,7 +660,6 @@ fun RenderLiveSpacesThumb(
|
|||||||
baseNote,
|
baseNote,
|
||||||
accountViewModel,
|
accountViewModel,
|
||||||
nav,
|
nav,
|
||||||
onMore,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -676,7 +670,6 @@ fun SpaceHostAndReactions(
|
|||||||
baseNote: AddressableNote,
|
baseNote: AddressableNote,
|
||||||
accountViewModel: AccountViewModel,
|
accountViewModel: AccountViewModel,
|
||||||
nav: INav,
|
nav: INav,
|
||||||
onMore: (() -> Unit)? = null,
|
|
||||||
) {
|
) {
|
||||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||||
val creator = baseNote.author
|
val creator = baseNote.author
|
||||||
@@ -737,15 +730,12 @@ fun SpaceHostAndReactions(
|
|||||||
accountViewModel = accountViewModel,
|
accountViewModel = accountViewModel,
|
||||||
nav = nav,
|
nav = nav,
|
||||||
)
|
)
|
||||||
if (onMore != null) {
|
Spacer(modifier = StdHorzSpacer)
|
||||||
Spacer(modifier = StdHorzSpacer)
|
MoreOptionsButton(
|
||||||
ClickableBox(
|
baseNote = baseNote,
|
||||||
modifier = Modifier.size(Size35dp),
|
accountViewModel = accountViewModel,
|
||||||
onClick = onMore,
|
nav = nav,
|
||||||
) {
|
)
|
||||||
VerticalDotsIcon()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user