Merge pull request #2924 from mstrofnone/feat/desktop-render-import-follow-list-dialog

feat(desktop): wire Import Follow List dialog into UI
This commit is contained in:
Vitor Pamplona
2026-05-15 22:39:48 -04:00
committed by GitHub
3 changed files with 50 additions and 0 deletions
@@ -96,6 +96,7 @@ import com.vitorpamplona.amethyst.desktop.service.namecoin.LocalNamecoinService
import com.vitorpamplona.amethyst.desktop.subscriptions.DesktopRelaySubscriptionsCoordinator
import com.vitorpamplona.amethyst.desktop.ui.ComposeNoteDialog
import com.vitorpamplona.amethyst.desktop.ui.ConnectingRelaysScreen
import com.vitorpamplona.amethyst.desktop.ui.ImportFollowListDialog
import com.vitorpamplona.amethyst.desktop.ui.LoginScreen
import com.vitorpamplona.amethyst.desktop.ui.ZapFeedback
import com.vitorpamplona.amethyst.desktop.ui.auth.ForceLogoutDialog
@@ -629,6 +630,7 @@ fun main() {
onShowAppDrawer = { showAppDrawer = true },
replyToNote = replyToNote,
showImportFollowListDialog = showImportFollowListDialog,
onShowImportFollowListDialog = { showImportFollowListDialog = true },
onDismissImportFollowListDialog = { showImportFollowListDialog = false },
onRestartApp = { appRestartKey++ },
torManager = torManager,
@@ -659,6 +661,7 @@ fun App(
onShowAppDrawer: () -> Unit,
replyToNote: com.vitorpamplona.quartz.nip01Core.core.Event?,
showImportFollowListDialog: Boolean = false,
onShowImportFollowListDialog: () -> Unit = {},
onDismissImportFollowListDialog: () -> Unit = {},
onRestartApp: () -> Unit = {},
torManager: com.vitorpamplona.amethyst.desktop.tor.DesktopTorManager,
@@ -1013,7 +1016,21 @@ fun App(
com.vitorpamplona.amethyst.desktop.ui.deck.AppDrawerTab.FEEDS
onShowAppDrawer()
},
onShowImportFollowListDialog = onShowImportFollowListDialog,
)
// Import Follow List dialog (triggered from File menu /
// Cmd+Shift+I). Rendered inside this CompositionLocalProvider
// so LocalNamecoinService is available for .bit / d/ / id/
// identifier resolution.
if (showImportFollowListDialog) {
ImportFollowListDialog(
onDismiss = onDismissImportFollowListDialog,
relayManager = relayManager,
account = account,
localCache = localCache,
)
}
}
// Compose dialog
@@ -1116,6 +1133,7 @@ fun MainContent(
onShowReplyDialog: (com.vitorpamplona.quartz.nip01Core.core.Event) -> Unit,
onShowAppDrawer: () -> Unit,
onOpenFeedsDrawer: () -> Unit = onShowAppDrawer,
onShowImportFollowListDialog: () -> Unit = {},
) {
val snackbarHostState = remember { SnackbarHostState() }
val scope = rememberCoroutineScope()
@@ -1333,6 +1351,7 @@ fun MainContent(
onOpenFeedsDrawer = onOpenFeedsDrawer,
onShowComposeDialog = onShowComposeDialog,
onShowReplyDialog = onShowReplyDialog,
onShowImportFollowListDialog = onShowImportFollowListDialog,
onZapFeedback = onZapFeedback,
signerConnectionState = signerConnectionState,
lastPingTimeSec = lastPingTimeSec,
@@ -1369,6 +1388,7 @@ fun MainContent(
deckState.addColumn(DeckColumnType.Settings)
}
},
onShowImportFollowListDialog = onShowImportFollowListDialog,
signerConnectionState = signerConnectionState,
lastPingTimeSec = lastPingTimeSec,
torStatus = torStatus,
@@ -56,6 +56,7 @@ fun DeckSidebar(
onRemoveAccount: (String) -> Unit,
onAddColumn: () -> Unit,
onOpenSettings: () -> Unit,
onShowImportFollowListDialog: () -> Unit = {},
signerConnectionState: SignerConnectionState,
lastPingTimeSec: Long?,
torStatus: TorServiceStatus,
@@ -90,6 +91,14 @@ fun DeckSidebar(
)
}
IconButton(onClick = onShowImportFollowListDialog) {
Icon(
MaterialSymbols.PersonAdd,
contentDescription = "Import Follow List",
tint = MaterialTheme.colorScheme.onSurfaceVariant,
)
}
Spacer(Modifier.weight(1f))
BunkerHeartbeatIndicator(
@@ -95,6 +95,7 @@ fun SinglePaneLayout(
onOpenFeedsDrawer: () -> Unit = onOpenAppDrawer,
onShowComposeDialog: () -> Unit,
onShowReplyDialog: (com.vitorpamplona.quartz.nip01Core.core.Event) -> Unit,
onShowImportFollowListDialog: () -> Unit = {},
onZapFeedback: (ZapFeedback) -> Unit,
signerConnectionState: SignerConnectionState,
lastPingTimeSec: Long?,
@@ -178,6 +179,26 @@ fun SinglePaneLayout(
)
}
NavigationRailItem(
selected = false,
onClick = onShowImportFollowListDialog,
icon = {
Icon(
MaterialSymbols.PersonAdd,
contentDescription = "Import Follow List",
modifier = Modifier.size(22.dp),
)
},
label = {
Text(
"Import",
style = MaterialTheme.typography.labelSmall,
maxLines = 1,
)
},
colors = NavigationRailItemDefaults.colors(),
)
NavigationRailItem(
selected = false,
onClick = onOpenAppDrawer,