@@ -28,6 +28,9 @@ import com.interlinedlist.android.feature.auth.ui.LoginRoute
2828import com.interlinedlist.android.feature.documents.ui.browser.DocumentsFolderRoute
2929import com.interlinedlist.android.feature.documents.ui.browser.DocumentsRoute
3030import com.interlinedlist.android.feature.documents.ui.editor.DocumentEditorRoute
31+ import com.interlinedlist.android.feature.integrations.ui.accounts.ConnectedAccountsRoute
32+ import com.interlinedlist.android.feature.integrations.ui.export.ExportRoute
33+ import com.interlinedlist.android.feature.integrations.ui.hub.IntegrationsRoute
3134import com.interlinedlist.android.feature.lists.ui.connections.ConnectionsRoute
3235import com.interlinedlist.android.feature.lists.ui.detail.ListDetailRoute
3336import com.interlinedlist.android.feature.lists.ui.list.ListsRoute
@@ -36,7 +39,13 @@ import com.interlinedlist.android.feature.lists.ui.watchers.WatchersRoute
3639import com.interlinedlist.android.feature.messages.ui.detail.MessageDetailRoute
3740import com.interlinedlist.android.feature.messages.ui.feed.MessagesRoute
3841import com.interlinedlist.android.feature.messages.ui.scheduled.ScheduledMessagesRoute
42+ import com.interlinedlist.android.feature.notifications.ui.NotificationsRoute
43+ import com.interlinedlist.android.feature.organizations.ui.detail.OrganizationDetailRoute
44+ import com.interlinedlist.android.feature.organizations.ui.list.OrganizationsRoute
3945import com.interlinedlist.android.feature.profile.ui.edit.EditProfileRoute
46+ import com.interlinedlist.android.feature.profile.ui.follow.FollowRequestsRoute
47+ import com.interlinedlist.android.feature.profile.ui.follow.FollowersRoute
48+ import com.interlinedlist.android.feature.profile.ui.follow.FollowingRoute
4049import com.interlinedlist.android.feature.profile.ui.profile.ProfileRoute
4150import com.interlinedlist.android.feature.profile.ui.profile.UserProfileRoute
4251import com.interlinedlist.android.feature.profile.ui.search.UserSearchRoute
@@ -48,8 +57,8 @@ object Routes {
4857 const val MAIN = " main"
4958
5059 // Top-level tabs (bottom navigation).
51- const val LISTS = " lists"
5260 const val MESSAGES = " messages"
61+ const val LISTS = " lists"
5362 const val DOCUMENTS = " documents"
5463 const val ACCOUNT = " account"
5564
@@ -67,11 +76,22 @@ object Routes {
6776 const val DOCUMENT_FOLDER = " documents/folder/{folderId}"
6877 const val DOCUMENT_EDITOR = " documents/editor/{documentId}"
6978
70- // Profile destinations. Distinct prefixes so a username can never collide
71- // with the edit/search routes.
79+ // Profile / following destinations. Distinct prefixes so a username can
80+ // never collide with the edit/search/list routes.
7281 const val PROFILE_EDIT = " editProfile"
7382 const val USER_SEARCH = " userSearch"
7483 const val USER_PROFILE = " user/{username}"
84+ const val FOLLOWERS = " followers/{username}"
85+ const val FOLLOWING = " following/{username}"
86+ const val FOLLOW_REQUESTS = " followRequests"
87+
88+ // Notifications / organizations / integrations (reached from the Account hub).
89+ const val NOTIFICATIONS = " notifications"
90+ const val ORGANIZATIONS = " organizations"
91+ const val ORGANIZATION_DETAIL = " organizations/{orgId}"
92+ const val INTEGRATIONS = " integrations"
93+ const val INTEGRATIONS_EXPORT = " integrations/export"
94+ const val INTEGRATIONS_ACCOUNTS = " integrations/accounts"
7595
7696 fun listDetail (id : String ) = " lists/$id "
7797 fun listSchema (id : String ) = " lists/$id /schema"
@@ -80,6 +100,9 @@ object Routes {
80100 fun documentFolder (id : String ) = " documents/folder/$id "
81101 fun documentEditor (id : String ) = " documents/editor/$id "
82102 fun userProfile (username : String ) = " user/$username "
103+ fun followers (username : String ) = " followers/$username "
104+ fun following (username : String ) = " following/$username "
105+ fun organization (orgId : String ) = " organizations/$orgId "
83106}
84107
85108/* *
@@ -168,6 +191,26 @@ private fun MainShell(onLoggedOut: () -> Unit) {
168191 startDestination = Routes .MESSAGES ,
169192 modifier = Modifier .padding(padding),
170193 ) {
194+ // ---- Messages ----
195+ composable(Routes .MESSAGES ) {
196+ MessagesRoute (
197+ onOpenMessage = { id -> tabNav.navigate(Routes .messageDetail(id)) },
198+ onOpenScheduled = { tabNav.navigate(Routes .MESSAGES_SCHEDULED ) },
199+ )
200+ }
201+ composable(
202+ Routes .MESSAGE_DETAIL ,
203+ arguments = listOf (navArgument(" messageId" ) { type = NavType .StringType }),
204+ ) {
205+ MessageDetailRoute (
206+ onBack = { tabNav.popBackStack() },
207+ onOpenMessage = { id -> tabNav.navigate(Routes .messageDetail(id)) },
208+ )
209+ }
210+ composable(Routes .MESSAGES_SCHEDULED ) {
211+ ScheduledMessagesRoute (onBack = { tabNav.popBackStack() })
212+ }
213+
171214 // ---- Lists ----
172215 composable(Routes .LISTS ) {
173216 ListsRoute (
@@ -206,26 +249,6 @@ private fun MainShell(onLoggedOut: () -> Unit) {
206249 ConnectionsRoute (onBack = { tabNav.popBackStack() })
207250 }
208251
209- // ---- Messages ----
210- composable(Routes .MESSAGES ) {
211- MessagesRoute (
212- onOpenMessage = { id -> tabNav.navigate(Routes .messageDetail(id)) },
213- onOpenScheduled = { tabNav.navigate(Routes .MESSAGES_SCHEDULED ) },
214- )
215- }
216- composable(
217- Routes .MESSAGE_DETAIL ,
218- arguments = listOf (navArgument(" messageId" ) { type = NavType .StringType }),
219- ) {
220- MessageDetailRoute (
221- onBack = { tabNav.popBackStack() },
222- onOpenMessage = { id -> tabNav.navigate(Routes .messageDetail(id)) },
223- )
224- }
225- composable(Routes .MESSAGES_SCHEDULED ) {
226- ScheduledMessagesRoute (onBack = { tabNav.popBackStack() })
227- }
228-
229252 // ---- Documents ----
230253 composable(Routes .DOCUMENTS ) {
231254 DocumentsRoute (
@@ -253,14 +276,20 @@ private fun MainShell(onLoggedOut: () -> Unit) {
253276 )
254277 }
255278
256- // ---- Account / Profile ----
279+ // ---- Account / Profile hub ----
257280 composable(Routes .ACCOUNT ) {
258281 // Sign-out reuses the existing auth-backed logout; the profile
259282 // module intentionally owns no session state.
260283 val logoutViewModel: HomeViewModel = hiltViewModel()
261284 ProfileRoute (
262285 onEditProfile = { tabNav.navigate(Routes .PROFILE_EDIT ) },
263286 onSearchUsers = { tabNav.navigate(Routes .USER_SEARCH ) },
287+ onOpenFollowers = { username -> tabNav.navigate(Routes .followers(username)) },
288+ onOpenFollowing = { username -> tabNav.navigate(Routes .following(username)) },
289+ onOpenRequests = { tabNav.navigate(Routes .FOLLOW_REQUESTS ) },
290+ onOpenNotifications = { tabNav.navigate(Routes .NOTIFICATIONS ) },
291+ onOpenOrganizations = { tabNav.navigate(Routes .ORGANIZATIONS ) },
292+ onOpenIntegrations = { tabNav.navigate(Routes .INTEGRATIONS ) },
264293 onSignOut = { logoutViewModel.logout(onLoggedOut) },
265294 )
266295 }
@@ -280,7 +309,72 @@ private fun MainShell(onLoggedOut: () -> Unit) {
280309 Routes .USER_PROFILE ,
281310 arguments = listOf (navArgument(" username" ) { type = NavType .StringType }),
282311 ) {
283- UserProfileRoute (onBack = { tabNav.popBackStack() })
312+ UserProfileRoute (
313+ onBack = { tabNav.popBackStack() },
314+ onOpenFollowers = { username -> tabNav.navigate(Routes .followers(username)) },
315+ onOpenFollowing = { username -> tabNav.navigate(Routes .following(username)) },
316+ )
317+ }
318+ composable(
319+ Routes .FOLLOWERS ,
320+ arguments = listOf (navArgument(" username" ) { type = NavType .StringType }),
321+ ) {
322+ FollowersRoute (
323+ onOpenUser = { username -> tabNav.navigate(Routes .userProfile(username)) },
324+ onBack = { tabNav.popBackStack() },
325+ )
326+ }
327+ composable(
328+ Routes .FOLLOWING ,
329+ arguments = listOf (navArgument(" username" ) { type = NavType .StringType }),
330+ ) {
331+ FollowingRoute (
332+ onOpenUser = { username -> tabNav.navigate(Routes .userProfile(username)) },
333+ onBack = { tabNav.popBackStack() },
334+ )
335+ }
336+ composable(Routes .FOLLOW_REQUESTS ) {
337+ FollowRequestsRoute (
338+ onOpenUser = { username -> tabNav.navigate(Routes .userProfile(username)) },
339+ onBack = { tabNav.popBackStack() },
340+ )
341+ }
342+
343+ // ---- Notifications ----
344+ composable(Routes .NOTIFICATIONS ) {
345+ NotificationsRoute (onBack = { tabNav.popBackStack() })
346+ }
347+
348+ // ---- Organizations ----
349+ composable(Routes .ORGANIZATIONS ) {
350+ OrganizationsRoute (
351+ onOpenOrg = { id -> tabNav.navigate(Routes .organization(id)) },
352+ onBack = { tabNav.popBackStack() },
353+ )
354+ }
355+ composable(
356+ Routes .ORGANIZATION_DETAIL ,
357+ arguments = listOf (navArgument(" orgId" ) { type = NavType .StringType }),
358+ ) {
359+ OrganizationDetailRoute (
360+ onBack = { tabNav.popBackStack() },
361+ onDeleted = { tabNav.popBackStack() },
362+ )
363+ }
364+
365+ // ---- Integrations & exports ----
366+ composable(Routes .INTEGRATIONS ) {
367+ IntegrationsRoute (
368+ onBack = { tabNav.popBackStack() },
369+ onOpenExport = { tabNav.navigate(Routes .INTEGRATIONS_EXPORT ) },
370+ onOpenConnectedAccounts = { tabNav.navigate(Routes .INTEGRATIONS_ACCOUNTS ) },
371+ )
372+ }
373+ composable(Routes .INTEGRATIONS_EXPORT ) {
374+ ExportRoute (onBack = { tabNav.popBackStack() })
375+ }
376+ composable(Routes .INTEGRATIONS_ACCOUNTS ) {
377+ ConnectedAccountsRoute (onBack = { tabNav.popBackStack() })
284378 }
285379 }
286380 }
0 commit comments