Skip to content

Commit 354cd12

Browse files
Adronclaude
andcommitted
feat(lists): wire a Connections entry point on the Lists screen
Adds a Hub action to the Lists top bar that opens the connections screen (ConnectionsRoute was built and tested but previously unreachable). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent e3e7490 commit 354cd12

3 files changed

Lines changed: 21 additions & 2 deletions

File tree

app/src/main/java/com/interlinedlist/android/navigation/InterlinedListNavHost.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,10 @@ private fun MainShell(onLoggedOut: () -> Unit) {
170170
) {
171171
// ---- Lists ----
172172
composable(Routes.LISTS) {
173-
ListsRoute(onOpenList = { id -> tabNav.navigate(Routes.listDetail(id)) })
173+
ListsRoute(
174+
onOpenList = { id -> tabNav.navigate(Routes.listDetail(id)) },
175+
onOpenConnections = { tabNav.navigate(Routes.LIST_CONNECTIONS) },
176+
)
174177
}
175178
composable(
176179
Routes.LIST_DETAIL,

feature/lists/src/androidTest/kotlin/com/interlinedlist/android/feature/lists/ui/list/ListsScreenTest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class ListsScreenTest {
3131
ListsScreen(
3232
state = state,
3333
onOpenList = onOpenList,
34+
onOpenConnections = {},
3435
onSearchQueryChange = {},
3536
onLoadMore = {},
3637
onCreateList = {},

feature/lists/src/main/kotlin/com/interlinedlist/android/feature/lists/ui/list/ListsScreen.kt

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ import androidx.compose.foundation.lazy.LazyColumn
1414
import androidx.compose.foundation.lazy.items
1515
import androidx.compose.material.icons.Icons
1616
import androidx.compose.material.icons.filled.Add
17+
import androidx.compose.material.icons.filled.Hub
1718
import androidx.compose.material.icons.filled.Search
19+
import androidx.compose.material3.IconButton
1820
import androidx.compose.material3.Card
1921
import androidx.compose.material3.CircularProgressIndicator
2022
import androidx.compose.material3.ExperimentalMaterial3Api
@@ -57,13 +59,15 @@ object ListsTestTags {
5759
@Composable
5860
fun ListsRoute(
5961
onOpenList: (String) -> Unit,
62+
onOpenConnections: () -> Unit,
6063
modifier: Modifier = Modifier,
6164
viewModel: ListsViewModel = hiltViewModel(),
6265
) {
6366
val state by viewModel.uiState.collectAsStateWithLifecycle()
6467
ListsScreen(
6568
state = state,
6669
onOpenList = onOpenList,
70+
onOpenConnections = onOpenConnections,
6771
onSearchQueryChange = viewModel::onSearchQueryChange,
6872
onLoadMore = viewModel::loadMore,
6973
onCreateList = { title -> viewModel.createList(title, description = null, onCreated = { onOpenList(it.id) }) },
@@ -77,14 +81,24 @@ fun ListsRoute(
7781
fun ListsScreen(
7882
state: ListsUiState,
7983
onOpenList: (String) -> Unit,
84+
onOpenConnections: () -> Unit,
8085
onSearchQueryChange: (String) -> Unit,
8186
onLoadMore: () -> Unit,
8287
onCreateList: (String) -> Unit,
8388
modifier: Modifier = Modifier,
8489
) {
8590
Scaffold(
8691
modifier = modifier.fillMaxSize(),
87-
topBar = { TopAppBar(title = { Text("Lists") }) },
92+
topBar = {
93+
TopAppBar(
94+
title = { Text("Lists") },
95+
actions = {
96+
IconButton(onClick = onOpenConnections) {
97+
Icon(Icons.Default.Hub, contentDescription = "List connections")
98+
}
99+
},
100+
)
101+
},
88102
floatingActionButton = {
89103
if (!state.subscriptionRequired) {
90104
ExtendedFloatingActionButton(
@@ -286,6 +300,7 @@ private fun ListsScreenPreview() {
286300
),
287301
),
288302
onOpenList = {},
303+
onOpenConnections = {},
289304
onSearchQueryChange = {},
290305
onLoadMore = {},
291306
onCreateList = {},

0 commit comments

Comments
 (0)