Vitor Pamplona
2025-08-25 10:09:39 -04:00
parent d90618f7f3
commit 4baa5bf659
7 changed files with 16 additions and 10 deletions
@@ -240,6 +240,7 @@ fun NoteCompose(
WatchNoteEvent(
baseNote = baseNote,
accountViewModel = accountViewModel,
nav,
modifier,
) {
CheckHiddenFeedWatchBlockAndReport(
@@ -312,7 +313,7 @@ fun AcceptableNote(
}
is BadgeDefinitionEvent -> BadgeDisplay(baseNote = baseNote, accountViewModel)
else ->
LongPressToQuickAction(baseNote = baseNote, accountViewModel = accountViewModel) { showPopup ->
LongPressToQuickAction(baseNote = baseNote, accountViewModel = accountViewModel, nav) { showPopup ->
CheckNewAndRenderNote(
baseNote = baseNote,
modifier = modifier,
@@ -356,9 +357,9 @@ fun AcceptableNote(
nav = nav,
)
}
is BadgeDefinitionEvent -> BadgeDisplay(baseNote = baseNote, accountViewModel)
is BadgeDefinitionEvent -> BadgeDisplay(baseNote, accountViewModel)
else ->
LongPressToQuickAction(baseNote = baseNote, accountViewModel = accountViewModel) { showPopup ->
LongPressToQuickAction(baseNote, accountViewModel, nav) { showPopup ->
CheckNewAndRenderNote(
baseNote = baseNote,
modifier = modifier,
@@ -82,7 +82,6 @@ import com.vitorpamplona.amethyst.R
import com.vitorpamplona.amethyst.model.AddressableNote
import com.vitorpamplona.amethyst.model.Note
import com.vitorpamplona.amethyst.model.User
import com.vitorpamplona.amethyst.ui.navigation.navs.EmptyNav
import com.vitorpamplona.amethyst.ui.navigation.navs.INav
import com.vitorpamplona.amethyst.ui.navigation.routes.routeEditDraftTo
import com.vitorpamplona.amethyst.ui.painterRes
@@ -142,6 +141,7 @@ val externalLinkForNote = { note: Note ->
fun LongPressToQuickAction(
baseNote: Note,
accountViewModel: AccountViewModel,
nav: INav,
content: @Composable (() -> Unit) -> Unit,
) {
val popupExpanded = remember { mutableStateOf(false) }
@@ -153,7 +153,7 @@ fun LongPressToQuickAction(
note = baseNote,
onDismiss = { popupExpanded.value = false },
accountViewModel = accountViewModel,
nav = EmptyNav,
nav = nav,
)
}
}
@@ -29,6 +29,8 @@ import androidx.compose.ui.Modifier
import com.vitorpamplona.amethyst.model.Note
import com.vitorpamplona.amethyst.service.relayClient.reqCommand.event.observeNoteHasEvent
import com.vitorpamplona.amethyst.ui.actions.CrossfadeIfEnabled
import com.vitorpamplona.amethyst.ui.navigation.navs.EmptyNav.nav
import com.vitorpamplona.amethyst.ui.navigation.navs.INav
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
@OptIn(ExperimentalFoundationApi::class)
@@ -36,6 +38,7 @@ import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
fun WatchNoteEvent(
baseNote: Note,
accountViewModel: AccountViewModel,
nav: INav,
modifier: Modifier = Modifier,
shortPreview: Boolean = false,
onNoteEventFound: @Composable () -> Unit,
@@ -47,6 +50,7 @@ fun WatchNoteEvent(
LongPressToQuickAction(
baseNote = baseNote,
accountViewModel = accountViewModel,
nav = nav,
) { showPopup ->
BlankNote(
remember {
@@ -97,7 +97,7 @@ fun ChatroomMessageCompose(
onWantsToReply: (Note) -> Unit,
onWantsToEditDraft: (Note) -> Unit,
) {
WatchNoteEvent(baseNote = baseNote, accountViewModel = accountViewModel) {
WatchNoteEvent(baseNote = baseNote, accountViewModel = accountViewModel, nav) {
WatchBlockAndReport(
note = baseNote,
showHiddenWarning = false,
@@ -62,7 +62,7 @@ fun ChannelCardCompose(
accountViewModel: AccountViewModel,
nav: INav,
) {
WatchNoteEvent(baseNote = baseNote, accountViewModel = accountViewModel) {
WatchNoteEvent(baseNote = baseNote, accountViewModel = accountViewModel, nav) {
if (forceEventKind == null || baseNote.event?.kind == forceEventKind) {
CheckHiddenFeedWatchBlockAndReport(
note = baseNote,
@@ -94,7 +94,7 @@ fun NormalChannelCard(
accountViewModel: AccountViewModel,
nav: INav,
) {
LongPressToQuickAction(baseNote = baseNote, accountViewModel = accountViewModel) { showPopup ->
LongPressToQuickAction(baseNote, accountViewModel, nav) { showPopup ->
CheckNewAndRenderChannelCard(
baseNote,
routeForLastRead,
@@ -47,7 +47,7 @@ fun GalleryCardCompose(
nav: INav,
ratio: Float = 1.0f,
) {
WatchNoteEvent(baseNote = baseNote, accountViewModel = accountViewModel, shortPreview = true) {
WatchNoteEvent(baseNote = baseNote, accountViewModel = accountViewModel, nav, shortPreview = true) {
CheckHiddenFeedWatchBlockAndReport(
note = baseNote,
modifier = modifier,
@@ -395,6 +395,7 @@ fun NoteMaster(
WatchNoteEvent(
baseNote = baseNote,
accountViewModel = accountViewModel,
nav,
modifier,
) {
CheckHiddenFeedWatchBlockAndReport(
@@ -405,7 +406,7 @@ fun NoteMaster(
accountViewModel = accountViewModel,
nav = nav,
) { canPreview ->
LongPressToQuickAction(baseNote = baseNote, accountViewModel = accountViewModel) { showPopup ->
LongPressToQuickAction(baseNote, accountViewModel, nav) { showPopup ->
FullBleedNoteCompose(
baseNote,
modifier