Repository: android/compose-samples
Issue: [Jetsnack]: Navigate case LazyColumn last element partially visible.

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Is there a StackOverflow question about this issue?

- [X] I have searched StackOverflow

### Is this an issue related to one of the samples?

- [X] Yes, this is a specific issue related to this samples repo.

### Sample app

Jetsnack

### What happened?

1. Scroll a LazyColumn to bottom. 
2. Click on any element in the LazyColumn. It navigate me to the detail page. 
3. Press back button, it back to the LazyColumn page but not at bottom position. The last element in LazyCoumn is partially visible, I expect it is fully visible.

here's my bug reproduction screen recording.

https://github.com/android/compose-samples/assets/78646351/1bca7436-0afb-4b07-9aa7-9bae3aa6e7a8





### Relevant logcat output

_No response_

### Code of Conduct

- [X] I agree to follow this project's Code of Conduct

Changed files:
Jetsnack/app/src/main/java/com/example/jetsnack/ui/home/cart/Cart.kt, Jetsnack/app/src/main/java/com/example/jetsnack/ui/home/Profile.kt, Jetsnack/app/src/main/java/com/example/jetsnack/ui/components/Scaffold.kt, Jetsnack/app/src/main/java/com/example/jetsnack/ui/home/Home.kt, Jetsnack/app/src/main/java/com/example/jetsnack/ui/JetsnackApp.kt, Jetsnack/app/src/main/java/com/example/jetsnack/ui/JetsnackAppState.kt, Jetsnack/app/src/main/java/com/example/jetsnack/ui/home/search/Search.kt, Jetsnack/app/src/main/java/com/example/jetsnack/ui/home/FilterScreen.kt, Jetsnack/app/src/main/java/com/example/jetsnack/ui/home/Feed.kt

diff --git a/Jetsnack/app/src/main/java/com/example/jetsnack/ui/JetsnackApp.kt b/Jetsnack/app/src/main/java/com/example/jetsnack/ui/JetsnackApp.kt
index 401e6b12..f1df7551 100644
--- a/Jetsnack/app/src/main/java/com/example/jetsnack/ui/JetsnackApp.kt
+++ b/Jetsnack/app/src/main/java/com/example/jetsnack/ui/JetsnackApp.kt
@@ -16,11 +16,7 @@
 
 package com.example.jetsnack.ui
 
-import androidx.compose.foundation.layout.padding
-import androidx.compose.foundation.layout.systemBarsPadding
-import androidx.compose.material.SnackbarHost
 import androidx.compose.runtime.Composable
-import androidx.compose.ui.Modifier
 import androidx.navigation.NavBackStackEntry
 import androidx.navigation.NavGraphBuilder
 import androidx.navigation.NavType
@@ -28,60 +24,40 @@ import androidx.navigation.compose.NavHost
 import androidx.navigation.compose.composable
 import androidx.navigation.navArgument
 import androidx.navigation.navigation
-import com.example.jetsnack.ui.components.JetsnackScaffold
-import com.example.jetsnack.ui.components.JetsnackSnackbar
 import com.example.jetsnack.ui.home.HomeSections
-import com.example.jetsnack.ui.home.JetsnackBottomBar
 import com.example.jetsnack.ui.home.addHomeGraph
+import com.example.jetsnack.ui.navigation.MainDestinations
+import com.example.jetsnack.ui.navigation.rememberJetsnackNavController
 import com.example.jetsnack.ui.snackdetail.SnackDetail
 import com.example.jetsnack.ui.theme.JetsnackTheme
 
 @Composable
 fun JetsnackApp() {
     JetsnackTheme {
-        val appState = rememberJetsnackAppState()
-        JetsnackScaffold(
-            bottomBar = {
-                if (appState.shouldShowBottomBar) {
-                    JetsnackBottomBar(
-                        tabs = appState.bottomBarTabs,
-                        currentRoute = appState.currentRoute!!,
-                        navigateToRoute = appState::navigateToBottomBarRoute
-                    )
-                }
-            },
-            snackbarHost = {
-                SnackbarHost(
-                    hostState = it,
-                    modifier = Modifier.systemBarsPadding(),
-                    snackbar = { snackbarData -> JetsnackSnackbar(snackbarData) }
-                )
-            },
-            scaffoldState = appState.scaffoldState
-        ) { innerPaddingModifier ->
-            NavHost(
-                navController = appState.navController,
-                startDestination = MainDestinations.HOME_ROUTE,
-                modifier = Modifier.padding(innerPaddingModifier)
-            ) {
-                jetsnackNavGraph(
-                    onSnackSelected = appState::navigateToSnackDetail,
-                    upPress = appState::upPress
-                )
-            }
+        val jetsnackNavController = rememberJetsnackNavController()
+        NavHost(
+            navController = jetsnackNavController.navController,
+            startDestination = MainDestinations.HOME_ROUTE
+        ) {
+            jetsnackNavGraph(
+                onSnackSelected = jetsnackNavController::navigateToSnackDetail,
+                upPress = jetsnackNavController::upPress,
+                onNavigateToRoute = jetsnackNavController::navigateToBottomBarRoute
+            )
         }
     }
 }
 
 private fun NavGraphBuilder.jetsnackNavGraph(
     onSnackSelected: (Long, NavBackStackEntry) -> Unit,
-    upPress: () -> Unit
+    upPress: () -> Unit,
+    onNavigateToRoute: (String) -> Unit
 ) {
     navigation(
         route = MainDestinations.HOME_ROUTE,
         startDestination = HomeSections.FEED.route
     ) {
-        addHomeGraph(onSnackSelected)
+        addHomeGraph(onSnackSelected, onNavigateToRoute)
     }
     composable(
         "${MainDestinations.SNACK_DETAIL_ROUTE}/{${MainDestinations.SNACK_ID_KEY}}",
diff --git a/Jetsnack/app/src/main/java/com/example/jetsnack/ui/components/Scaffold.kt b/Jetsnack/app/src/main/java/com/example/jetsnack/ui/components/Scaffold.kt
index 337a02d8..4789085a 100644
--- a/Jetsnack/app/src/main/java/com/example/jetsnack/ui/components/Scaffold.kt
+++ b/Jetsnack/app/src/main/java/com/example/jetsnack/ui/components/Scaffold.kt
@@ -16,10 +16,10 @@
 
 package com.example.jetsnack.ui.components
 
+import android.content.res.Resources
 import androidx.compose.foundation.layout.ColumnScope
 import androidx.compose.foundation.layout.PaddingValues
 import androidx.compose.material.DrawerDefaults
-import androidx.compose.material.ExperimentalMaterialApi
 import androidx.compose.material.FabPosition
 import androidx.compose.material.MaterialTheme
 import androidx.compose.material.Scaffold
@@ -28,16 +28,24 @@ import androidx.compose.material.SnackbarHost
 import androidx.compose.material.SnackbarHostState
 import androidx.compose.material.rememberScaffoldState
 import androidx.compose.runtime.Composable
+import androidx.compose.runtime.ReadOnlyComposable
+import androidx.compose.runtime.Stable
+import androidx.compose.runtime.remember
+import androidx.compose.runtime.rememberCoroutineScope
 import androidx.compose.ui.Modifier
 import androidx.compose.ui.graphics.Color
 import androidx.compose.ui.graphics.Shape
+import androidx.compose.ui.platform.LocalConfiguration
+import androidx.compose.ui.platform.LocalContext
 import androidx.compose.ui.unit.Dp
+import com.example.jetsnack.model.SnackbarManager
 import com.example.jetsnack.ui.theme.JetsnackTheme
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.launch
 
 /**
  * Wrap Material [androidx.compose.material.Scaffold] and set [JetsnackTheme] colors.
  */
-@OptIn(ExperimentalMaterialApi::class)
 @Composable
 fun JetsnackScaffold(
     modifier: Modifier = Modifier,
@@ -78,3 +86,55 @@ fun JetsnackScaffold(
         content = content
     )
 }
+
+/**
+ * Remember and creates an instance of [JetsnackScaffoldState]
+ */
+@Composable
+fun rememberJetsnackScaffoldState(
+    scaffoldState: ScaffoldState = rememberScaffoldState(),
+    snackbarManager: SnackbarManager = SnackbarManager,
+    resources: Resources = resources(),
+    coroutineScope: CoroutineScope = rememberCoroutineScope()
+): JetsnackScaffoldState = remember(scaffoldState, snackbarManager, resources, coroutineScope) {
+    JetsnackScaffoldState(scaffoldState, snackbarManager, resources, coroutineScope)
+}
+
+/**
+ * Responsible for holding [ScaffoldState], handles the logic of showing snackbar messages
+ */
+@Stable
+class JetsnackScaffoldState(
+    val scaffoldState: ScaffoldState,
+    private val snackbarManager: SnackbarManager,
+    private val resources: Resources,
+    coroutineScope: CoroutineScope
+) {
+    // Process snackbars coming from SnackbarManager
+    init {
+        coroutineScope.launch {
+            snackbarManager.messages.collect { currentMessages ->
+                if (currentMessages.isNotEmpty()) {
+                    val message = currentMessages[0]
+                    val text = resources.getText(message.messageId)
+                    // Notify the SnackbarManager so it can remove the current message from the list
+                    snackbarManager.setMessageShown(message.id)
+                    // Display the snackbar on the screen. `showSnackbar` is a function
+                    // that suspends until the snackbar disappears from the screen
+                    scaffoldState.snackbarHostState.showSnackbar(text.toString())
+                }
+            }
+        }
+    }
+}
+
+/**
+ * A composable function that returns the [Resources]. It will be recomposed when `Configuration`
+ * gets updated.
+ */
+@Composable
+@ReadOnlyComposable
+private fun resources(): Resources {
+    LocalConfiguration.current
+    return LocalContext.current.resources
+}
diff --git a/Jetsnack/app/src/main/java/com/example/jetsnack/ui/home/Feed.kt b/Jetsnack/app/src/main/java/com/example/jetsnack/ui/home/Feed.kt
index e1d4a98e..e699965e 100644
--- a/Jetsnack/app/src/main/java/com/example/jetsnack/ui/home/Feed.kt
+++ b/Jetsnack/app/src/main/java/com/example/jetsnack/ui/home/Feed.kt
@@ -18,7 +18,6 @@ package com.example.jetsnack.ui.home
 
 import android.content.res.Configuration
 import androidx.compose.animation.AnimatedVisibility
-import androidx.compose.animation.ExperimentalAnimationApi
 import androidx.compose.animation.expandVertically
 import androidx.compose.animation.fadeIn
 import androidx.compose.animation.fadeOut
@@ -30,6 +29,7 @@ import androidx.compose.foundation.layout.Spacer
 import androidx.compose.foundation.layout.WindowInsets
 import androidx.compose.foundation.layout.add
 import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.padding
 import androidx.compose.foundation.layout.statusBars
 import androidx.compose.foundation.layout.windowInsetsTopHeight
 import androidx.compose.foundation.lazy.LazyColumn
@@ -49,6 +49,7 @@ import com.example.jetsnack.model.SnackCollection
 import com.example.jetsnack.model.SnackRepo
 import com.example.jetsnack.ui.components.FilterBar
 import com.example.jetsnack.ui.components.JetsnackDivider
+import com.example.jetsnack.ui.components.JetsnackScaffold
 import com.example.jetsnack.ui.components.JetsnackSurface
 import com.example.jetsnack.ui.components.SnackCollection
 import com.example.jetsnack.ui.theme.JetsnackTheme
@@ -56,16 +57,28 @@ import com.example.jetsnack.ui.theme.JetsnackTheme
 @Composable
 fun Feed(
     onSnackClick: (Long) -> Unit,
+    onNavigateToRoute: (String) -> Unit,
     modifier: Modifier = Modifier
 ) {
     val snackCollections = remember { SnackRepo.getSnacks() }
     val filters = remember { SnackRepo.getFilters() }
-    Feed(
-        snackCollections,
-        filters,
-        onSnackClick,
-        modifier
-    )
+    JetsnackScaffold(
+        bottomBar = {
+            JetsnackBottomBar(
+                tabs = HomeSections.values(),
+                currentRoute = HomeSections.FEED.route,
+                navigateToRoute = onNavigateToRoute
+            )
+        },
+        modifier = modifier
+    ) { paddingValues ->
+        Feed(
+            snackCollections,
+            filters,
+            onSnackClick,
+            Modifier.padding(paddingValues)
+        )
+    }
 }
 
 @Composable
@@ -75,7 +88,6 @@ private fun Feed(
     onSnackClick: (Long) -> Unit,
     modifier: Modifier = Modifier
 ) {
-
     JetsnackSurface(modifier = modifier.fillMaxSize()) {
         Box {
             SnackCollectionList(snackCollections, filters, onSnackClick)
@@ -84,7 +96,6 @@ private fun Feed(
     }
 }
 
-@OptIn(ExperimentalAnimationApi::class)
 @Composable
 private fun SnackCollectionList(
     snackCollections: List<SnackCollection>,
@@ -136,6 +147,6 @@ private fun SnackCollectionList(
 @Composable
 fun HomePreview() {
     JetsnackTheme {
-        Feed(onSnackClick = { })
+        Feed(onSnackClick = { }, onNavigateToRoute = { })
     }
 }
diff --git a/Jetsnack/app/src/main/java/com/example/jetsnack/ui/home/FilterScreen.kt b/Jetsnack/app/src/main/java/com/example/jetsnack/ui/home/FilterScreen.kt
index bd6510b8..cfcf1ebf 100644
--- a/Jetsnack/app/src/main/java/com/example/jetsnack/ui/home/FilterScreen.kt
+++ b/Jetsnack/app/src/main/java/com/example/jetsnack/ui/home/FilterScreen.kt
@@ -16,7 +16,6 @@
 
 package com.example.jetsnack.ui.home
 
-import androidx.compose.animation.ExperimentalAnimationApi
 import androidx.compose.foundation.layout.Column
 import androidx.compose.foundation.layout.Row
 import androidx.compose.foundation.layout.fillMaxSize
@@ -44,7 +43,6 @@ import androidx.compose.runtime.mutableStateOf
 import androidx.compose.runtime.remember
 import androidx.compose.runtime.setValue
 import androidx.compose.ui.Modifier
-import androidx.compose.ui.draw.alpha
 import androidx.compose.ui.graphics.vector.ImageVector
 import androidx.compose.ui.res.stringResource
 import androidx.compose.ui.text.style.TextAlign
@@ -60,7 +58,6 @@ import com.example.jetsnack.ui.theme.JetsnackTheme
 import com.google.accompanist.flowlayout.FlowMainAxisAlignment
 import com.google.accompanist.flowlayout.FlowRow
 
-@OptIn(ExperimentalAnimationApi::class)
 @Composable
 fun FilterScreen(
     onDismiss: () -> Unit
@@ -94,7 +91,7 @@ fun FilterScreen(
                         )
                     },
                     actions = {
-                        var resetEnabled = sortState != defaultFilter
+                        val resetEnabled = sortState != defaultFilter
                         IconButton(
                             onClick = { /* TODO: Open search */ },
                             enabled = resetEnabled
diff --git a/Jetsnack/app/src/main/java/com/example/jetsnack/ui/home/Home.kt b/Jetsnack/app/src/main/java/com/example/jetsnack/ui/home/Home.kt
index c0c7a9a1..3d344b29 100644
--- a/Jetsnack/app/src/main/java/com/example/jetsnack/ui/home/Home.kt
+++ b/Jetsnack/app/src/main/java/com/example/jetsnack/ui/home/Home.kt
@@ -77,19 +77,20 @@ import java.util.Locale
 
 fun NavGraphBuilder.addHomeGraph(
     onSnackSelected: (Long, NavBackStackEntry) -> Unit,
+    onNavigateToRoute: (String) -> Unit,
     modifier: Modifier = Modifier
 ) {
     composable(HomeSections.FEED.route) { from ->
-        Feed(onSnackClick = { id -> onSnackSelected(id, from) }, modifier)
+        Feed(onSnackClick = { id -> onSnackSelected(id, from) }, onNavigateToRoute, modifier)
     }
     composable(HomeSections.SEARCH.route) { from ->
-        Search(onSnackClick = { id -> onSnackSelected(id, from) }, modifier)
+        Search(onSnackClick = { id -> onSnackSelected(id, from) }, onNavigateToRoute, modifier)
     }
     composable(HomeSections.CART.route) { from ->
-        Cart(onSnackClick = { id -> onSnackSelected(id, from) }, modifier)
+        Cart(onSnackClick = { id -> onSnackSelected(id, from) }, onNavigateToRoute, modifier)
     }
     composable(HomeSections.PROFILE.route) {
-        Profile(modifier)
+        Profile(onNavigateToRoute, modifier)
     }
 }
 
diff --git a/Jetsnack/app/src/main/java/com/example/jetsnack/ui/home/Profile.kt b/Jetsnack/app/src/main/java/com/example/jetsnack/ui/home/Profile.kt
index a179eb78..04d3ab14 100644
--- a/Jetsnack/app/src/main/java/com/example/jetsnack/ui/home/Profile.kt
+++ b/Jetsnack/app/src/main/java/com/example/jetsnack/ui/home/Profile.kt
@@ -36,35 +36,51 @@ import androidx.compose.ui.text.style.TextAlign
 import androidx.compose.ui.tooling.preview.Preview
 import androidx.compose.ui.unit.dp
 import com.example.jetsnack.R
+import com.example.jetsnack.ui.components.JetsnackScaffold
 import com.example.jetsnack.ui.theme.JetsnackTheme
 
 @Composable
-fun Profile(modifier: Modifier = Modifier) {
-    Column(
-        horizontalAlignment = Alignment.CenterHorizontally,
+fun Profile(
+    onNavigateToRoute: (String) -> Unit,
+    modifier: Modifier = Modifier
+) {
+    JetsnackScaffold(
+        bottomBar = {
+            JetsnackBottomBar(
+                tabs = HomeSections.values(),
+                currentRoute = HomeSections.PROFILE.route,
+                navigateToRoute = onNavigateToRoute
+            )
+        },
         modifier = modifier
-            .fillMaxSize()
-            .wrapContentSize()
-            .padding(24.dp)
-    ) {
-        Image(
-            painterResource(R.drawable.empty_state_search),
-            contentDescription = null
-        )
-        Spacer(Modifier.height(24.dp))
-        Text(
-            text = stringResource(R.string.work_in_progress),
-            style = MaterialTheme.typography.subtitle1,
-            textAlign = TextAlign.Center,
-            modifier = Modifier.fillMaxWidth()
-        )
-        Spacer(Modifier.height(16.dp))
-        Text(
-            text = stringResource(R.string.grab_beverage),
-            style = MaterialTheme.typography.body2,
-            textAlign = TextAlign.Center,
-            modifier = Modifier.fillMaxWidth()
-        )
+    ) { paddingValues ->
+        Column(
+            horizontalAlignment = Alignment.CenterHorizontally,
+            modifier = Modifier
+                .fillMaxSize()
+                .wrapContentSize()
+                .padding(24.dp)
+                .padding(paddingValues)
+        ) {
+            Image(
+                painterResource(R.drawable.empty_state_search),
+                contentDescription = null
+            )
+            Spacer(Modifier.height(24.dp))
+            Text(
+                text = stringResource(R.string.work_in_progress),
+                style = MaterialTheme.typography.subtitle1,
+                textAlign = TextAlign.Center,
+                modifier = Modifier.fillMaxWidth()
+            )
+            Spacer(Modifier.height(16.dp))
+            Text(
+                text = stringResource(R.string.grab_beverage),
+                style = MaterialTheme.typography.body2,
+                textAlign = TextAlign.Center,
+                modifier = Modifier.fillMaxWidth()
+            )
+        }
     }
 }
 
@@ -74,6 +90,6 @@ fun Profile(modifier: Modifier = Modifier) {
 @Composable
 fun ProfilePreview() {
     JetsnackTheme {
-        Profile()
+        Profile(onNavigateToRoute = { })
     }
 }
diff --git a/Jetsnack/app/src/main/java/com/example/jetsnack/ui/home/cart/Cart.kt b/Jetsnack/app/src/main/java/com/example/jetsnack/ui/home/cart/Cart.kt
index abb7a469..dea58816 100644
--- a/Jetsnack/app/src/main/java/com/example/jetsnack/ui/home/cart/Cart.kt
+++ b/Jetsnack/app/src/main/java/com/example/jetsnack/ui/home/cart/Cart.kt
@@ -17,7 +17,6 @@
 package com.example.jetsnack.ui.home.cart
 
 import android.content.res.Configuration.UI_MODE_NIGHT_YES
-import androidx.compose.animation.ExperimentalAnimationApi
 import androidx.compose.animation.core.animateDpAsState
 import androidx.compose.animation.core.animateFloatAsState
 import androidx.compose.foundation.background
@@ -37,6 +36,7 @@ import androidx.compose.foundation.layout.heightIn
 import androidx.compose.foundation.layout.padding
 import androidx.compose.foundation.layout.size
 import androidx.compose.foundation.layout.statusBars
+import androidx.compose.foundation.layout.systemBarsPadding
 import androidx.compose.foundation.layout.width
 import androidx.compose.foundation.layout.windowInsetsTopHeight
 import androidx.compose.foundation.layout.wrapContentHeight
@@ -47,6 +47,7 @@ import androidx.compose.foundation.shape.CircleShape
 import androidx.compose.material.Icon
 import androidx.compose.material.IconButton
 import androidx.compose.material.MaterialTheme
+import androidx.compose.material.SnackbarHost
 import androidx.compose.material.Surface
 import androidx.compose.material.Text
 import androidx.compose.material.icons.Icons
@@ -77,11 +78,16 @@ import com.example.jetsnack.model.SnackCollection
 import com.example.jetsnack.model.SnackRepo
 import com.example.jetsnack.ui.components.JetsnackButton
 import com.example.jetsnack.ui.components.JetsnackDivider
+import com.example.jetsnack.ui.components.JetsnackScaffold
+import com.example.jetsnack.ui.components.JetsnackSnackbar
 import com.example.jetsnack.ui.components.JetsnackSurface
 import com.example.jetsnack.ui.components.QuantitySelector
 import com.example.jetsnack.ui.components.SnackCollection
 import com.example.jetsnack.ui.components.SnackImage
+import com.example.jetsnack.ui.components.rememberJetsnackScaffoldState
 import com.example.jetsnack.ui.home.DestinationBar
+import com.example.jetsnack.ui.home.HomeSections
+import com.example.jetsnack.ui.home.JetsnackBottomBar
 import com.example.jetsnack.ui.theme.AlphaNearOpaque
 import com.example.jetsnack.ui.theme.JetsnackTheme
 import com.example.jetsnack.ui.utils.formatPrice
@@ -89,20 +95,41 @@ import com.example.jetsnack.ui.utils.formatPrice
 @Composable
 fun Cart(
     onSnackClick: (Long) -> Unit,
+    onNavigateToRoute: (String) -> Unit,
     modifier: Modifier = Modifier,
     viewModel: CartViewModel = viewModel(factory = CartViewModel.provideFactory())
 ) {
     val orderLines by viewModel.orderLines.collectAsStateWithLifecycle()
     val inspiredByCart = remember { SnackRepo.getInspiredByCart() }
-    Cart(
-        orderLines = orderLines,
-        removeSnack = viewModel::removeSnack,
-        increaseItemCount = viewModel::increaseSnackCount,
-        decreaseItemCount = viewModel::decreaseSnackCount,
-        inspiredByCart = inspiredByCart,
-        onSnackClick = onSnackClick,
+    val jetsnackScaffoldState = rememberJetsnackScaffoldState()
+    JetsnackScaffold(
+        bottomBar = {
+            JetsnackBottomBar(
+                tabs = HomeSections.values(),
+                currentRoute = HomeSections.CART.route,
+                navigateToRoute = onNavigateToRoute
+            )
+        },
+        snackbarHost = {
+            SnackbarHost(
+                hostState = it,
+                modifier = Modifier.systemBarsPadding(),
+                snackbar = { snackbarData -> JetsnackSnackbar(snackbarData) }
+            )
+        },
+        scaffoldState = jetsnackScaffoldState.scaffoldState,
         modifier = modifier
-    )
+    ) { paddingValues ->
+        Cart(
+            orderLines = orderLines,
+            removeSnack = viewModel::removeSnack,
+            increaseItemCount = viewModel::increaseSnackCount,
+            decreaseItemCount = viewModel::decreaseSnackCount,
+            inspiredByCart = inspiredByCart,
+            onSnackClick = onSnackClick,
+            modifier = Modifier.padding(paddingValues)
+        )
+    }
 }
 
 @Composable
@@ -132,7 +159,6 @@ fun Cart(
     }
 }
 
-@OptIn(ExperimentalAnimationApi::class)
 @Composable
 private fun CartContent(
     orderLines: List<OrderLine>,
diff --git a/Jetsnack/app/src/main/java/com/example/jetsnack/ui/home/search/Search.kt b/Jetsnack/app/src/main/java/com/example/jetsnack/ui/home/search/Search.kt
index 18127e20..89894753 100644
--- a/Jetsnack/app/src/main/java/com/example/jetsnack/ui/home/search/Search.kt
+++ b/Jetsnack/app/src/main/java/com/example/jetsnack/ui/home/search/Search.kt
@@ -60,46 +60,63 @@ import com.example.jetsnack.model.SearchSuggestionGroup
 import com.example.jetsnack.model.Snack
 import com.example.jetsnack.model.SnackRepo
 import com.example.jetsnack.ui.components.JetsnackDivider
+import com.example.jetsnack.ui.components.JetsnackScaffold
 import com.example.jetsnack.ui.components.JetsnackSurface
+import com.example.jetsnack.ui.home.HomeSections
+import com.example.jetsnack.ui.home.JetsnackBottomBar
 import com.example.jetsnack.ui.theme.JetsnackTheme
 import com.example.jetsnack.ui.utils.mirroringBackIcon
 
 @Composable
 fun Search(
     onSnackClick: (Long) -> Unit,
+    onNavigateToRoute: (String) -> Unit,
     modifier: Modifier = Modifier,
     state: SearchState = rememberSearchState()
 ) {
-    JetsnackSurface(modifier = modifier.fillMaxSize()) {
-        Column {
-            Spacer(modifier = Modifier.statusBarsPadding())
-            SearchBar(
-                query = state.query,
-                onQueryChange = { state.query = it },
-                searchFocused = state.focused,
-                onSearchFocusChange = { state.focused = it },
-                onClearQuery = { state.query = TextFieldValue("") },
-                searching = state.searching
+    JetsnackScaffold(
+        bottomBar = {
+            JetsnackBottomBar(
+                tabs = HomeSections.values(),
+                currentRoute = HomeSections.SEARCH.route,
+                navigateToRoute = onNavigateToRoute
             )
-            JetsnackDivider()
-
-            LaunchedEffect(state.query.text) {
-                state.searching = true
-                state.searchResults = SearchRepo.search(state.query.text)
-                state.searching = false
-            }
-            when (state.searchDisplay) {
-                SearchDisplay.Categories -> SearchCategories(state.categories)
-                SearchDisplay.Suggestions -> SearchSuggestions(
-                    suggestions = state.suggestions,
-                    onSuggestionSelect = { suggestion -> state.query = TextFieldValue(suggestion) }
-                )
-                SearchDisplay.Results -> SearchResults(
-                    state.searchResults,
-                    state.filters,
-                    onSnackClick
+        },
+        modifier = modifier
+    ) { paddingValues ->
+        JetsnackSurface(modifier = Modifier.fillMaxSize().padding(paddingValues)) {
+            Column {
+                Spacer(modifier = Modifier.statusBarsPadding())
+                SearchBar(
+                    query = state.query,
+                    onQueryChange = { state.query = it },
+                    searchFocused = state.focused,
+                    onSearchFocusChange = { state.focused = it },
+                    onClearQuery = { state.query = TextFieldValue("") },
+                    searching = state.searching
                 )
-                SearchDisplay.NoResults -> NoResults(state.query.text)
+                JetsnackDivider()
+
+                LaunchedEffect(state.query.text) {
+                    state.searching = true
+                    state.searchResults = SearchRepo.search(state.query.text)
+                    state.searching = false
+                }
+                when (state.searchDisplay) {
+                    SearchDisplay.Categories -> SearchCategories(state.categories)
+                    SearchDisplay.Suggestions -> SearchSuggestions(
+                        suggestions = state.suggestions,
+                        onSuggestionSelect = { suggestion ->
+                            state.query = TextFieldValue(suggestion)
+                        }
+                    )
+                    SearchDisplay.Results -> SearchResults(
+                        state.searchResults,
+                        state.filters,
+                        onSnackClick
+                    )
+                    SearchDisplay.NoResults -> NoResults(state.query.text)
+                }
             }
         }
     }
diff --git a/Jetsnack/app/src/main/java/com/example/jetsnack/ui/JetsnackAppState.kt b/Jetsnack/app/src/main/java/com/example/jetsnack/ui/navigation/JetsnackNavController.kt
similarity index 50%
rename from Jetsnack/app/src/main/java/com/example/jetsnack/ui/JetsnackAppState.kt
rename to Jetsnack/app/src/main/java/com/example/jetsnack/ui/navigation/JetsnackNavController.kt
index 0e25cdc0..5861d429 100644
--- a/Jetsnack/app/src/main/java/com/example/jetsnack/ui/JetsnackAppState.kt
+++ b/Jetsnack/app/src/main/java/com/example/jetsnack/ui/navigation/JetsnackNavController.kt
@@ -14,29 +14,17 @@
  * limitations under the License.
  */
 
-package com.example.jetsnack.ui
+package com.example.jetsnack.ui.navigation
 
-import android.content.res.Resources
-import androidx.compose.material.ScaffoldState
-import androidx.compose.material.rememberScaffoldState
 import androidx.compose.runtime.Composable
-import androidx.compose.runtime.ReadOnlyComposable
 import androidx.compose.runtime.Stable
 import androidx.compose.runtime.remember
-import androidx.compose.runtime.rememberCoroutineScope
-import androidx.compose.ui.platform.LocalConfiguration
-import androidx.compose.ui.platform.LocalContext
 import androidx.lifecycle.Lifecycle
 import androidx.navigation.NavBackStackEntry
 import androidx.navigation.NavDestination
 import androidx.navigation.NavGraph
 import androidx.navigation.NavHostController
-import androidx.navigation.compose.currentBackStackEntryAsState
 import androidx.navigation.compose.rememberNavController
-import com.example.jetsnack.model.SnackbarManager
-import com.example.jetsnack.ui.home.HomeSections
-import kotlinx.coroutines.CoroutineScope
-import kotlinx.coroutines.launch
 
 /**
  * Destinations used in the [JetsnackApp].
@@ -48,61 +36,22 @@ object MainDestinations {
 }
 
 /**
- * Remembers and creates an instance of [JetsnackAppState]
+ * Remembers and creates an instance of [JetsnackNavController]
  */
 @Composable
-fun rememberJetsnackAppState(
-    scaffoldState: ScaffoldState = rememberScaffoldState(),
-    navController: NavHostController = rememberNavController(),
-    snackbarManager: SnackbarManager = SnackbarManager,
-    resources: Resources = resources(),
-    coroutineScope: CoroutineScope = rememberCoroutineScope()
-) =
-    remember(scaffoldState, navController, snackbarManager, resources, coroutineScope) {
-        JetsnackAppState(scaffoldState, navController, snackbarManager, resources, coroutineScope)
-    }
+fun rememberJetsnackNavController(
+    navController: NavHostController = rememberNavController()
+): JetsnackNavController = remember(navController) {
+    JetsnackNavController(navController)
+}
 
 /**
- * Responsible for holding state related to [JetsnackApp] and containing UI-related logic.
+ * Responsible for holding UI Navigation logic.
  */
 @Stable
-class JetsnackAppState(
-    val scaffoldState: ScaffoldState,
+class JetsnackNavController(
     val navController: NavHostController,
-    private val snackbarManager: SnackbarManager,
-    private val resources: Resources,
-    coroutineScope: CoroutineScope
 ) {
-    // Process snackbars coming from SnackbarManager
-    init {
-        coroutineScope.launch {
-            snackbarManager.messages.collect { currentMessages ->
-                if (currentMessages.isNotEmpty()) {
-                    val message = currentMessages[0]
-                    val text = resources.getText(message.messageId)
-
-                    // Display the snackbar on the screen. `showSnackbar` is a function
-                    // that suspends until the snackbar disappears from the screen
-                    scaffoldState.snackbarHostState.showSnackbar(text.toString())
-                    // Once the snackbar is gone or dismissed, notify the SnackbarManager
-                    snackbarManager.setMessageShown(message.id)
-                }
-            }
-        }
-    }
-
-    // ----------------------------------------------------------
-    // BottomBar state source of truth
-    // ----------------------------------------------------------
-
-    val bottomBarTabs = HomeSections.values()
-    private val bottomBarRoutes = bottomBarTabs.map { it.route }
-
-    // Reading this attribute will cause recompositions when the bottom bar needs shown, or not.
-    // Not all routes need to show the bottom bar.
-    val shouldShowBottomBar: Boolean
-        @Composable get() = navController
-            .currentBackStackEntryAsState().value?.destination?.route in bottomBarRoutes
 
     // ----------------------------------------------------------
     // Navigation state source of truth
@@ -156,14 +105,3 @@ private val NavGraph.startDestination: NavDestination?
 private tailrec fun findStartDestination(graph: NavDestination): NavDestination {
     return if (graph is NavGraph) findStartDestination(graph.startDestination!!) else graph
 }
-
-/**
- * A composable function that returns the [Resources]. It will be recomposed when `Configuration`
- * gets updated.
- */
-@Composable
-@ReadOnlyComposable
-private fun resources(): Resources {
-    LocalConfiguration.current
-    return LocalContext.current.resources
-}