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( WatchNoteEvent(
baseNote = baseNote, baseNote = baseNote,
accountViewModel = accountViewModel, accountViewModel = accountViewModel,
nav,
modifier, modifier,
) { ) {
CheckHiddenFeedWatchBlockAndReport( CheckHiddenFeedWatchBlockAndReport(
@@ -312,7 +313,7 @@ fun AcceptableNote(
} }
is BadgeDefinitionEvent -> BadgeDisplay(baseNote = baseNote, accountViewModel) is BadgeDefinitionEvent -> BadgeDisplay(baseNote = baseNote, accountViewModel)
else -> else ->
LongPressToQuickAction(baseNote = baseNote, accountViewModel = accountViewModel) { showPopup -> LongPressToQuickAction(baseNote = baseNote, accountViewModel = accountViewModel, nav) { showPopup ->
CheckNewAndRenderNote( CheckNewAndRenderNote(
baseNote = baseNote, baseNote = baseNote,
modifier = modifier, modifier = modifier,
@@ -356,9 +357,9 @@ fun AcceptableNote(
nav = nav, nav = nav,
) )
} }
is BadgeDefinitionEvent -> BadgeDisplay(baseNote = baseNote, accountViewModel) is BadgeDefinitionEvent -> BadgeDisplay(baseNote, accountViewModel)
else -> else ->
LongPressToQuickAction(baseNote = baseNote, accountViewModel = accountViewModel) { showPopup -> LongPressToQuickAction(baseNote, accountViewModel, nav) { showPopup ->
CheckNewAndRenderNote( CheckNewAndRenderNote(
baseNote = baseNote, baseNote = baseNote,
modifier = modifier, modifier = modifier,
@@ -82,7 +82,6 @@ import com.vitorpamplona.amethyst.R
import com.vitorpamplona.amethyst.model.AddressableNote import com.vitorpamplona.amethyst.model.AddressableNote
import com.vitorpamplona.amethyst.model.Note import com.vitorpamplona.amethyst.model.Note
import com.vitorpamplona.amethyst.model.User 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.navs.INav
import com.vitorpamplona.amethyst.ui.navigation.routes.routeEditDraftTo import com.vitorpamplona.amethyst.ui.navigation.routes.routeEditDraftTo
import com.vitorpamplona.amethyst.ui.painterRes import com.vitorpamplona.amethyst.ui.painterRes
@@ -142,6 +141,7 @@ val externalLinkForNote = { note: Note ->
fun LongPressToQuickAction( fun LongPressToQuickAction(
baseNote: Note, baseNote: Note,
accountViewModel: AccountViewModel, accountViewModel: AccountViewModel,
nav: INav,
content: @Composable (() -> Unit) -> Unit, content: @Composable (() -> Unit) -> Unit,
) { ) {
val popupExpanded = remember { mutableStateOf(false) } val popupExpanded = remember { mutableStateOf(false) }
@@ -153,7 +153,7 @@ fun LongPressToQuickAction(
note = baseNote, note = baseNote,
onDismiss = { popupExpanded.value = false }, onDismiss = { popupExpanded.value = false },
accountViewModel = accountViewModel, 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.model.Note
import com.vitorpamplona.amethyst.service.relayClient.reqCommand.event.observeNoteHasEvent import com.vitorpamplona.amethyst.service.relayClient.reqCommand.event.observeNoteHasEvent
import com.vitorpamplona.amethyst.ui.actions.CrossfadeIfEnabled 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 import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
@OptIn(ExperimentalFoundationApi::class) @OptIn(ExperimentalFoundationApi::class)
@@ -36,6 +38,7 @@ import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
fun WatchNoteEvent( fun WatchNoteEvent(
baseNote: Note, baseNote: Note,
accountViewModel: AccountViewModel, accountViewModel: AccountViewModel,
nav: INav,
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
shortPreview: Boolean = false, shortPreview: Boolean = false,
onNoteEventFound: @Composable () -> Unit, onNoteEventFound: @Composable () -> Unit,
@@ -47,6 +50,7 @@ fun WatchNoteEvent(
LongPressToQuickAction( LongPressToQuickAction(
baseNote = baseNote, baseNote = baseNote,
accountViewModel = accountViewModel, accountViewModel = accountViewModel,
nav = nav,
) { showPopup -> ) { showPopup ->
BlankNote( BlankNote(
remember { remember {
@@ -97,7 +97,7 @@ fun ChatroomMessageCompose(
onWantsToReply: (Note) -> Unit, onWantsToReply: (Note) -> Unit,
onWantsToEditDraft: (Note) -> Unit, onWantsToEditDraft: (Note) -> Unit,
) { ) {
WatchNoteEvent(baseNote = baseNote, accountViewModel = accountViewModel) { WatchNoteEvent(baseNote = baseNote, accountViewModel = accountViewModel, nav) {
WatchBlockAndReport( WatchBlockAndReport(
note = baseNote, note = baseNote,
showHiddenWarning = false, showHiddenWarning = false,
@@ -62,7 +62,7 @@ fun ChannelCardCompose(
accountViewModel: AccountViewModel, accountViewModel: AccountViewModel,
nav: INav, nav: INav,
) { ) {
WatchNoteEvent(baseNote = baseNote, accountViewModel = accountViewModel) { WatchNoteEvent(baseNote = baseNote, accountViewModel = accountViewModel, nav) {
if (forceEventKind == null || baseNote.event?.kind == forceEventKind) { if (forceEventKind == null || baseNote.event?.kind == forceEventKind) {
CheckHiddenFeedWatchBlockAndReport( CheckHiddenFeedWatchBlockAndReport(
note = baseNote, note = baseNote,
@@ -94,7 +94,7 @@ fun NormalChannelCard(
accountViewModel: AccountViewModel, accountViewModel: AccountViewModel,
nav: INav, nav: INav,
) { ) {
LongPressToQuickAction(baseNote = baseNote, accountViewModel = accountViewModel) { showPopup -> LongPressToQuickAction(baseNote, accountViewModel, nav) { showPopup ->
CheckNewAndRenderChannelCard( CheckNewAndRenderChannelCard(
baseNote, baseNote,
routeForLastRead, routeForLastRead,
@@ -47,7 +47,7 @@ fun GalleryCardCompose(
nav: INav, nav: INav,
ratio: Float = 1.0f, ratio: Float = 1.0f,
) { ) {
WatchNoteEvent(baseNote = baseNote, accountViewModel = accountViewModel, shortPreview = true) { WatchNoteEvent(baseNote = baseNote, accountViewModel = accountViewModel, nav, shortPreview = true) {
CheckHiddenFeedWatchBlockAndReport( CheckHiddenFeedWatchBlockAndReport(
note = baseNote, note = baseNote,
modifier = modifier, modifier = modifier,
@@ -395,6 +395,7 @@ fun NoteMaster(
WatchNoteEvent( WatchNoteEvent(
baseNote = baseNote, baseNote = baseNote,
accountViewModel = accountViewModel, accountViewModel = accountViewModel,
nav,
modifier, modifier,
) { ) {
CheckHiddenFeedWatchBlockAndReport( CheckHiddenFeedWatchBlockAndReport(
@@ -405,7 +406,7 @@ fun NoteMaster(
accountViewModel = accountViewModel, accountViewModel = accountViewModel,
nav = nav, nav = nav,
) { canPreview -> ) { canPreview ->
LongPressToQuickAction(baseNote = baseNote, accountViewModel = accountViewModel) { showPopup -> LongPressToQuickAction(baseNote, accountViewModel, nav) { showPopup ->
FullBleedNoteCompose( FullBleedNoteCompose(
baseNote, baseNote,
modifier modifier