From 35914cf24163dee695ae2098e690ac55093247d1 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 25 Jul 2026 04:24:16 +0000 Subject: [PATCH] fix(bottom-bar): make a pinned NIP-29 relay a proper bottom-nav tab MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A NIP-29 relay pinned to the bottom bar navigates to Route.RelayGroupServer (RelayGroupChannelListScreen), but that screen always drew a back arrow and never rendered a bottom bar — so tapping the pinned relay icon dropped the bottom nav and showed a back arrow, unlike every other bottom-nav root. Mirror the norm the analog Concord server screen already follows: read nav.canPop() once, show the back arrow only when pushed (drawer / another screen), and add an AppBottomBar keyed to the relay's own route. AppBottomBar hides itself on a bottom-nav root, so the relay now behaves both ways — a bottom-nav tab (bar visible, no arrow) when tapped from the bar, and a pushed detail (arrow, no bar) when opened from the drawer or elsewhere. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01BU7StQsshfjcaLDXTBtnB2 --- .../relayGroup/RelayGroupChannelListScreen.kt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/RelayGroupChannelListScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/RelayGroupChannelListScreen.kt index a9e693e432..c26cbd3390 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/RelayGroupChannelListScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/RelayGroupChannelListScreen.kt @@ -76,6 +76,7 @@ import com.vitorpamplona.amethyst.model.nip11RelayInfo.isRelaySignedRelayGroup import com.vitorpamplona.amethyst.model.nip11RelayInfo.looksLikeNonNip29Relay import com.vitorpamplona.amethyst.service.relayClient.reqCommand.user.observeUserName import com.vitorpamplona.amethyst.ui.components.RobohashFallbackAsyncImage +import com.vitorpamplona.amethyst.ui.navigation.bottombars.AppBottomBar import com.vitorpamplona.amethyst.ui.navigation.navs.INav import com.vitorpamplona.amethyst.ui.navigation.routes.Route import com.vitorpamplona.amethyst.ui.navigation.routes.routeFor @@ -256,6 +257,12 @@ fun RelayGroupChannelListScreen( val scope = rememberCoroutineScope() val showTorHint = torType != TorType.OFF && !isOnion && relay !in trustedRelays && connectTimedOut + // A pinned relay works both as a pushed detail (from the drawer or another screen) and as a + // bottom-nav tab. Read once here (it is @Composable): the back arrow shows only when pushed; + // as a bottom-nav root the bar below takes its place and the arrow hides. + val canPop = nav.canPop() + val selfRoute = remember(relay) { Route.RelayGroupServer(relay.url) } + Scaffold( topBar = { TopBarExtensibleWithBackButton( @@ -267,6 +274,7 @@ fun RelayGroupChannelListScreen( overflow = TextOverflow.Ellipsis, ) }, + showBackButton = canPop, popBack = nav::popBack, actions = { if (isBuzz) { @@ -279,6 +287,13 @@ fun RelayGroupChannelListScreen( }, ) }, + bottomBar = { + // Renders only when this is a bottom-nav root (AppBottomBar hides itself when canPop), + // so a pinned NIP-29 relay works both as a pushed detail and as a bottom-nav tab. + AppBottomBar(selfRoute, nav, accountViewModel) { route -> + if (route != selfRoute) nav.navBottomBar(route) + } + }, floatingActionButton = { FloatingActionButton(onClick = { nav.nav(Route.RelayGroupCreate(relay.url)) }, shape = CircleShape) { Icon(