Merge remote-tracking branch 'origin/claude/relaxed-gates-m0h15t' into claude/relaxed-gates-m0h15t

This commit is contained in:
Claude
2026-09-21 12:12:28 +00:00
3 changed files with 72 additions and 3 deletions
@@ -95,7 +95,16 @@ fun GeocachesScreen(
DisappearingScaffold(
isInvertedLayout = false,
topBar = { GeocachesTopBar(accountViewModel, nav) },
// The tab row belongs to the top bar, not to the content. DisappearingScaffold draws its
// content from the top of the window, behind the bar, so a tab row placed first in the
// content column lands under the status bar: invisible and untappable, which left Map,
// Hunts, Finds and Mine unreachable. DiscoveryScreen stacks its tabs the same way.
topBar = {
Column {
GeocachesTopBar(accountViewModel, nav)
GeocacheTabRow(pagerState)
}
},
bottomBar = {
AppBottomBar(Route.Geocaches(), nav, accountViewModel) { route ->
if (route is Route.Geocaches) {
@@ -117,8 +126,6 @@ fun GeocachesScreen(
accountViewModel = accountViewModel,
) {
Column(Modifier.fillMaxSize()) {
GeocacheTabRow(pagerState)
HorizontalPager(state = pagerState, modifier = Modifier.fillMaxSize(), userScrollEnabled = false) { page ->
when (GeocacheTab.entries[page]) {
GeocacheTab.NEARBY ->
@@ -40,6 +40,7 @@ import com.vitorpamplona.quartz.nip57Zaps.LnZapEvent
import com.vitorpamplona.quartz.nip58Badges.award.BadgeAwardEvent
import com.vitorpamplona.quartz.nip72ModCommunities.approval.CommunityPostApprovalEvent
import com.vitorpamplona.quartz.nipB1Bolt12Zaps.zap.Bolt12ZapEvent
import com.vitorpamplona.quartz.nipCCGeocaching.foundLog.GeocacheFoundLogEvent
import com.vitorpamplona.quartz.utils.mapOfSet
val RepliesAndReactionsToAddressesKinds1 =
@@ -55,6 +56,11 @@ val RepliesAndReactionsToAddressesKinds1 =
CommentEvent.KIND,
AttestationEvent.KIND,
BadgeAwardEvent.KIND,
// A NIP-CC found log points at the cache it claims with a lowercase `a`, which is how
// every client writing them today does it. Without this the cache screen asks for
// engagement on the listing and never for its finds, so a cache with logs sitting on a
// relay we are already connected to still reads "No one has logged this cache yet".
GeocacheFoundLogEvent.KIND,
)
val PostsAndChatMessagesToAddresses =
@@ -0,0 +1,56 @@
/*
* Copyright (c) 2025 Vitor Pamplona
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package com.vitorpamplona.amethyst.commons.relayClient.event.watchers
import com.vitorpamplona.amethyst.commons.model.AddressableNote
import com.vitorpamplona.quartz.nip01Core.core.Address
import com.vitorpamplona.quartz.nip01Core.relay.normalizer.RelayUrlNormalizer
import com.vitorpamplona.quartz.nipCCGeocaching.foundLog.GeocacheFoundLogEvent
import com.vitorpamplona.quartz.nipCCGeocaching.listing.GeocacheListingEvent
import kotlin.test.Test
import kotlin.test.assertTrue
class FilterRepliesAndReactionsToAddressesTest {
private val relay = RelayUrlNormalizer.normalizeOrNull("wss://one.example")!!
private val author = "b".repeat(64)
private fun addressable(address: Address) = AddressableNote(address).apply { addRelaySync(relay) }
/**
* A NIP-CC found log is the cache's history. It hangs off the listing by a lowercase `a`, the
* same tag the engagement watcher already asks about, but it is its own kind — so without
* 7516 in the kind list the cache screen asks for every reaction to a cache and never for its
* finds, and a cache with logs on a relay we are connected to still reads as unfound.
*/
@Test
fun asksForFoundLogsOfACache() {
val cache = addressable(Address(GeocacheListingEvent.KIND, author, "a-cache"))
val filters = filterRepliesAndReactionsToAddresses(listOf(cache), null)!!
val askingByAddress = filters.filter { it.filter.tags?.containsKey("a") == true }
assertTrue(
askingByAddress.any { GeocacheFoundLogEvent.KIND in (it.filter.kinds ?: emptyList()) },
"no filter asks for kind ${GeocacheFoundLogEvent.KIND} on the cache's address",
)
}
}