ROUTING: Placement 진입 경로 분기 (Personalization vs Monitoring)

빌드 106 적용: placementFromMonitoring 플래그 + enterPlacementFromMonitoring() /
backFromPlacementGuide() 헬퍼 추가. Personalization → Placement → Monitoring 정방향과
Monitoring → Placement 재진입 경로에서 Back 동작이 올바르게 분기되도록 일괄 정리.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-20 15:59:59 +09:00
parent 34bb446e0f
commit cb8500f6ce
3 changed files with 17 additions and 2 deletions
@@ -27,6 +27,8 @@ class AppState(private val context: Context) {
var isDevMode by mutableStateOf(false)
var piezoSettings by mutableStateOf(PiezoSettings())
var catheterCount = mutableIntStateOf(0)
// Placement 진입 경로 분기용 — Monitoring에서 재진입 시 true, Personalization에서 진입 시 false
var placementFromMonitoring by mutableStateOf(false)
private val storage = UserStorage.getInstance(context)
private val historyStore = MeasurementHistoryStore.getInstance(context)
@@ -125,6 +127,7 @@ class AppState(private val context: Context) {
fun personalizationComplete() {
storage.piezoSettings = piezoSettings
placementFromMonitoring = false
currentScreen = AppScreen.PLACEMENT_GUIDE
}
@@ -140,9 +143,21 @@ class AppState(private val context: Context) {
fun placementComplete() {
bladderLevel = BladderLevel(currentLevel = 0, catheterizationThreshold = bladderLevel.catheterizationThreshold)
storage.bladderLevel = 0
placementFromMonitoring = false
currentScreen = AppScreen.PIEZO_MONITORING
}
fun enterPlacementFromMonitoring() {
placementFromMonitoring = true
currentScreen = AppScreen.PLACEMENT_GUIDE
}
fun backFromPlacementGuide() {
currentScreen = if (placementFromMonitoring) AppScreen.PIEZO_MONITORING
else AppScreen.PIEZO_PERSONALIZATION
placementFromMonitoring = false
}
fun pinSet(pin: String) {
storage.pin = pin
storage.hasPin = true
@@ -96,7 +96,7 @@ fun MedilightApp(modifier: Modifier = Modifier) {
// 메인 플로우: Home → DeviceScan → Personalization → Placement → Monitoring
AppScreen.DEVICE_SCAN -> appState.currentScreen = AppScreen.HOME
AppScreen.PIEZO_PERSONALIZATION -> appState.currentScreen = AppScreen.DEVICE_SCAN
AppScreen.PLACEMENT_GUIDE -> appState.currentScreen = if (appState.isDeviceConnected) AppScreen.PIEZO_MONITORING else AppScreen.HOME
AppScreen.PLACEMENT_GUIDE -> appState.backFromPlacementGuide()
AppScreen.PIEZO_MONITORING -> appState.currentScreen = AppScreen.PLACEMENT_GUIDE
// 모니터링 하위 화면 → 모니터링
AppScreen.MEASUREMENT_HISTORY -> appState.currentScreen = AppScreen.PIEZO_MONITORING
@@ -158,7 +158,7 @@ fun PlacementGuideView(appState: AppState) {
.padding(horizontal = 24.dp, vertical = 16.dp),
verticalAlignment = Alignment.CenterVertically
) {
IconButton(onClick = { appState.currentScreen = if (appState.isDeviceConnected) com.example.medilightv2android.AppScreen.PIEZO_MONITORING else com.example.medilightv2android.AppScreen.HOME }) {
IconButton(onClick = { appState.backFromPlacementGuide() }) {
Icon(
Icons.AutoMirrored.Filled.ArrowBack,
contentDescription = "Back",