Coverage Summary for Class: CategoryNavGraphKt (com.georgeci.moneysurfer.feature.category)
| Class |
Method, %
|
Branch, %
|
Line, %
|
Instruction, %
|
| CategoryNavGraphKt |
0%
(0/13)
|
0%
(0/8)
|
0%
(0/37)
|
0%
(0/543)
|
| CategoryNavGraphKt$categoryNavGraph$1$2$3$1 |
0%
(0/1)
|
|
0%
(0/1)
|
0%
(0/8)
|
| CategoryNavGraphKt$categoryNavGraph$1$2$4$1 |
0%
(0/1)
|
|
0%
(0/1)
|
0%
(0/8)
|
| CategoryNavGraphKt$categoryNavGraph$1$3$2$1 |
0%
(0/1)
|
|
0%
(0/1)
|
0%
(0/8)
|
| CategoryNavGraphKt$categoryNavGraph$1$3$3$1 |
0%
(0/1)
|
|
0%
(0/1)
|
0%
(0/8)
|
| CategoryNavGraphKt$categoryNavGraph$1$3$5$1 |
0%
(0/1)
|
|
0%
(0/1)
|
0%
(0/8)
|
| CategoryNavGraphKt$categoryNavGraph$1$4$5$1 |
0%
(0/1)
|
|
0%
(0/2)
|
0%
(0/12)
|
| CategoryNavGraphKt$categoryNavGraph$lambda$0$$inlined$entry$default$1 |
0%
(0/1)
|
|
| CategoryNavGraphKt$categoryNavGraph$lambda$0$$inlined$entry$default$2 |
0%
(0/1)
|
|
| CategoryNavGraphKt$categoryNavGraph$lambda$0$$inlined$entry$default$3 |
0%
(0/1)
|
|
| CategoryNavGraphKt$categoryNavGraph$lambda$0$$inlined$entry$default$4 |
0%
(0/1)
|
|
| CategoryNavGraphKt$categoryNavGraph$lambda$0$$inlined$entry$default$5 |
0%
(0/1)
|
|
| CategoryNavGraphKt$categoryNavGraph$lambda$0$$inlined$entry$default$6 |
0%
(0/1)
|
|
| CategoryNavGraphKt$categoryNavGraph$lambda$0$$inlined$entry$default$7 |
0%
(0/1)
|
|
| CategoryNavGraphKt$categoryNavGraph$lambda$0$$inlined$entry$default$8 |
0%
(0/1)
|
|
| Total |
0%
(0/27)
|
0%
(0/8)
|
0%
(0/44)
|
0%
(0/595)
|
package com.georgeci.moneysurfer.feature.category
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi
import com.georgeci.moneysurfer.domain.primitives.CategoryId
import com.georgeci.moneysurfer.domain.primitives.CategoryType
import com.georgeci.moneysurfer.feature.category.creation.CategoryCreationScreen
import com.georgeci.moneysurfer.feature.category.details.CategoryDetailsScreen
import com.georgeci.moneysurfer.feature.category.manage.CategoriesManageScreen
import com.georgeci.moneysurfer.feature.category.picker.CategoryChooserBottomSheet
import com.georgeci.moneysurfer.feature.category.picker.CategoryPickerVariant
import com.georgeci.moneysurfer.navigation.BottomSheetSceneStrategy
import com.georgeci.moneysurfer.navigation.CategoryPickerResultKey
import com.georgeci.moneysurfer.navigation.FeatureNavGraph
import com.georgeci.moneysurfer.navigation.NavDetailPlaceholder
import com.georgeci.moneysurfer.navigation.Route
import com.georgeci.moneysurfer.navigation.SurferPaneSceneStrategy
import io.github.irgaly.navigation3.resultstate.LocalNavigationResultProducer
import io.github.irgaly.navigation3.resultstate.setResult
@OptIn(ExperimentalMaterial3Api::class, ExperimentalMaterial3AdaptiveApi::class)
val categoryNavGraph: FeatureNavGraph = { navigator ->
entry<Route.CategoryCreation>(
metadata = SurferPaneSceneStrategy.detailPane(),
) {
CategoryCreationScreen(
categoryId = it.categoryId?.let(::CategoryId),
onNavigateBack = { navigator.pop() },
)
}
entry<Route.CategoriesManage>(
metadata = SurferPaneSceneStrategy.listPane(detailPlaceholder = { NavDetailPlaceholder() }),
) {
CategoriesManageScreen(
onNavigateBack = { navigator.pop() },
onNavigateToCategoryCreation = { navigator.push(Route.CategoryCreation()) },
onNavigateToCategoryEdit = { categoryId ->
navigator.push(Route.CategoryCreation(categoryId = categoryId.value))
},
onNavigateToCategoryDetails = { categoryId ->
navigator.push(Route.CategoryDetails(categoryId = categoryId.value))
},
)
}
entry<Route.CategoryDetails>(
metadata = SurferPaneSceneStrategy.detailPane(),
) { key ->
CategoryDetailsScreen(
categoryId = CategoryId(key.categoryId),
onNavigateBack = { navigator.pop() },
onNavigateToCategoryEdit = { categoryId ->
navigator.push(Route.CategoryCreation(categoryId = categoryId.value))
},
// A subcategory opens its own detail page rather than replacing this one, so Back
// walks back up the tree the user drilled down through.
onNavigateToCategoryDetails = { categoryId ->
navigator.push(Route.CategoryDetails(categoryId = categoryId.value))
},
onNavigateToTransactionCreation = { navigator.push(Route.TransactionCreation()) },
onNavigateToTransactionDetails = { transactionId ->
navigator.push(Route.TransactionDetails(transactionId.value))
},
)
}
entry<Route.CategoryChooser>(
metadata = BottomSheetSceneStrategy.bottomSheet(),
) { key ->
val resultProducer = LocalNavigationResultProducer.current
CategoryChooserBottomSheet(
selectedCategoryId = key.selectedCategoryId?.let { CategoryId(it) },
filterType = key.filterType?.let { runCatching { CategoryType.valueOf(it) }.getOrNull() },
variant = CategoryPickerVariant.fromRouteArg(key.variant),
onDismiss = { navigator.pop() },
onNavigateToCategoryCreation = {
navigator.replaceTop(Route.CategoryCreation())
},
onCategoryPicked = { picked ->
resultProducer.setResult(CategoryPickerResultKey, picked)
navigator.pop()
},
)
}
}