fix(concord): route taps on a Concord message to its channel

RouteMaker resolved Marmot and NIP-29 relay-group channel gatherers to their
chat screens but had no ConcordChannel branch, so tapping a Concord message
(from the Messages inbox row, a quoted note, go-to-conversation) fell through
to the generic thread view instead of opening the channel. Add the branch and
a routeFor(ConcordChannel) mirroring routeFor(RelayGroupChannel).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CzJ2Cwo8tg4oZq43oRa3ig
This commit is contained in:
Claude
2026-07-11 01:20:42 +00:00
parent 9771d24cba
commit 0fae8b4966
@@ -20,6 +20,7 @@
*/
package com.vitorpamplona.amethyst.ui.navigation.routes
import com.vitorpamplona.amethyst.commons.model.concord.ConcordChannel
import com.vitorpamplona.amethyst.commons.model.emphChat.EphemeralChatChannel
import com.vitorpamplona.amethyst.commons.model.marmotGroups.MarmotGroupChatroom
import com.vitorpamplona.amethyst.commons.model.nip28PublicChats.PublicChatChannel
@@ -84,6 +85,14 @@ fun routeFor(
return routeFor(relayGroup)
}
// Concord channel content (kind 9 chat, 1111 reply, 7 reaction) lands in LocalCache as a real
// Note attached to its ConcordChannel gatherer. Like the relay-group case above, route to the
// Concord channel screen instead of the generic thread view it would otherwise fall through to.
val concordChannel = note.inGatherers?.firstNotNullOfOrNull { it as? ConcordChannel }
if (concordChannel != null) {
return routeFor(concordChannel)
}
val noteEvent = note.event ?: return Route.EventRedirect(note.idHex)
if (noteEvent.isGroupScoped()) {
@@ -282,6 +291,8 @@ fun routeFor(note: RelayGroupChannel): Route = Route.RelayGroup(note.groupId.id,
fun routeFor(groupId: GroupId): Route = Route.RelayGroup(groupId.id, groupId.relayUrl.url)
fun routeFor(channel: ConcordChannel): Route = Route.Concord(channel.channelId.communityId, channel.channelId.channelId)
fun routeFor(user: User): Route.Profile = Route.Profile(user.pubkeyHex)
fun routeForUser(userHex: HexKey): Route.Profile = Route.Profile(userHex)