feat(nests): add visible kebab menu to room cards
Long-press on the cards already opened the standard NoteQuickActionMenu, but the affordance was hidden — especially on the compact ENDED card which has no visible interactive elements. Add an explicit MoreVert (VerticalDotsIcon) tap target that opens the same menu: - ENDED compact card: 40dp icon on the trailing edge of the row. - LIVE/SCHEDULED full card: 35dp icon in the existing SpaceHostAndReactions row, after Like and Zap. Both wire through the showQuickAction lambda from LongPressToQuickAction, so the icon and the long-press gesture trigger the exact same menu (share, copy, broadcast, report, block, delete) — no second popup-state plumbing. ObserveAndRenderSpace, RenderLiveSpacesThumb, and SpaceHostAndReactions gain an optional `onMore: (() -> Unit)?` parameter so other callers (e.g. existing live-stream surfaces that reuse SpaceHostAndReactions) keep their current rendering unchanged when they don't pass one.
This commit is contained in:
+25
-1
@@ -65,6 +65,7 @@ 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
|
||||||
@@ -76,6 +77,7 @@ 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.timeAgoNoDot
|
import com.vitorpamplona.amethyst.ui.note.timeAgoNoDot
|
||||||
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
|
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
|
||||||
@@ -97,6 +99,7 @@ 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
|
||||||
@@ -313,7 +316,7 @@ private fun NestFeedCard(
|
|||||||
note = baseNote,
|
note = baseNote,
|
||||||
accountViewModel = accountViewModel,
|
accountViewModel = accountViewModel,
|
||||||
) {
|
) {
|
||||||
ObserveAndRenderSpace(addressableNote, accountViewModel, nav)
|
ObserveAndRenderSpace(addressableNote, accountViewModel, nav, showQuickAction)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -412,6 +415,13 @@ private fun NestEndedCompactCard(
|
|||||||
overflow = TextOverflow.Ellipsis,
|
overflow = TextOverflow.Ellipsis,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ClickableBox(
|
||||||
|
modifier = Modifier.size(Size40dp),
|
||||||
|
onClick = showQuickAction,
|
||||||
|
) {
|
||||||
|
VerticalDotsIcon()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -456,6 +466,7 @@ 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) {
|
||||||
@@ -485,6 +496,7 @@ fun ObserveAndRenderSpace(
|
|||||||
baseNote,
|
baseNote,
|
||||||
accountViewModel,
|
accountViewModel,
|
||||||
nav,
|
nav,
|
||||||
|
onMore,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -583,6 +595,7 @@ 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(),
|
||||||
@@ -652,6 +665,7 @@ fun RenderLiveSpacesThumb(
|
|||||||
baseNote,
|
baseNote,
|
||||||
accountViewModel,
|
accountViewModel,
|
||||||
nav,
|
nav,
|
||||||
|
onMore,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -662,6 +676,7 @@ 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
|
||||||
@@ -722,6 +737,15 @@ fun SpaceHostAndReactions(
|
|||||||
accountViewModel = accountViewModel,
|
accountViewModel = accountViewModel,
|
||||||
nav = nav,
|
nav = nav,
|
||||||
)
|
)
|
||||||
|
if (onMore != null) {
|
||||||
|
Spacer(modifier = StdHorzSpacer)
|
||||||
|
ClickableBox(
|
||||||
|
modifier = Modifier.size(Size35dp),
|
||||||
|
onClick = onMore,
|
||||||
|
) {
|
||||||
|
VerticalDotsIcon()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user