Skip to content

[FIX/#143] 2차 qa#148

Merged
sohee6989 merged 8 commits intodevelopfrom
fix/#143-qa2
Jan 22, 2026
Merged

[FIX/#143] 2차 qa#148
sohee6989 merged 8 commits intodevelopfrom
fix/#143-qa2

Conversation

@sohee6989
Copy link
Contributor

@sohee6989 sohee6989 commented Jan 22, 2026

Related issue 🛠

Work Description ✏️

  • 2차 qa 반영

Screenshot 📸

Uncompleted Tasks 😅

  • N/A

To Reviewers 📢

Summary by CodeRabbit

  • Style

    • 색상 팔레트 톤 조정, 텍스트 스타일 및 프로필 이미지 크기/클립 개선, 화면 가로 중앙 정렬 적용
  • New Features

    • 미션 진행 UI에 게이지 단계(gaugeStep) 추가 및 표시 반영
    • 홈에서 캘린더 날짜로 이동하는 내비게이션 처리 추가
  • Bug Fixes

    • 게이지·인덱스 처리 안전성 향상 및 이미지 기본값 보강
  • Refactor

    • 스플래시 네비게이션 흐름 단순화

✏️ Tip: You can customize this high-level summary in your review settings.

@sohee6989 sohee6989 requested a review from a team as a code owner January 22, 2026 16:24
@sohee6989 sohee6989 linked an issue Jan 22, 2026 that may be closed by this pull request
@sohee6989 sohee6989 self-assigned this Jan 22, 2026
@sohee6989 sohee6989 added FIX🐛 오류 및 버그 수정 소희🍒 소희 담당 labels Jan 22, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 22, 2026

Walkthrough

색상 값 수정, 게이지 단계(gaugeStep) 계산 및 UI 전파, 게이지 타입 이미지 필드 논-널 전환, 레이아웃/정렬·modifier 조정, 홈 내 캘린더 네비게이션 분기 추가 등이 포함된 변경입니다.

Changes

Cohort / File(s) Summary
Design System & Theme
app/src/main/java/com/cherrish/android/core/designsystem/theme/Color.kt
gradation2 0xFFFAE0E6 → 0xFFFFE0E0, graStart 0xFFFFF7f7 → 0xFFFFEBEB 값 변경
Gauge Type
app/src/main/java/com/cherrish/android/presentation/home/type/CherrishGaugeType.kt
image 필드 nullable(Int?) → non-null(Int)로 변경; LEVEL0R.drawable.img_home_lv1 할당
Challenge Mission — ViewModel & UIState
app/src/main/java/com/cherrish/android/presentation/challenge/missionprogress/ChallengeMissionProgressViewModel.kt, .../ChallengeMissionProgressUiState.kt
ViewModel에 gaugeStep 계산(클램프 및 매핑) 추가, ChallengeMissionProgressUiStategaugeStep: Int 필드 추가 및 UI 상태에 포함
Challenge Mission — Composables
app/src/main/java/com/cherrish/android/presentation/challenge/component/ChallengeMissionProgressCherrygrowth.kt, .../ChallengeMissionProgressScreen.kt
관련 컴포저블에 gaugeStep: Int 파라미터 추가 및 호출부 전달; 기존 cherryType.step 사용을 gaugeStep으로 대체
Home — Navigation & ViewModel
app/src/main/java/com/cherrish/android/presentation/home/HomeScreen.kt, .../HomeViewModel.kt
HomeScreen에 캘린더 네비게이션 분기 추가(navigateToCalendar), HomeViewModel에서 level/safeIndex 도입 및 selectedIndex 계산 개선
Home — Challenge Section
app/src/main/java/com/cherrish/android/presentation/home/component/ChallengeSection.kt
기본 imageRes 변경(img_challenge_lv2img_challenge_lv1), hasChallenge 도입 및 렌더링 분기 정리; 함수 시그니처의 기본값 변경
Challenge Start Screen
app/src/main/java/com/cherrish/android/presentation/challenge/start/ChallengeStartScreen.kt
Column에 horizontalAlignment = Alignment.CenterHorizontally 적용; modifier 체인에 padding 유지
My Page
app/src/main/java/com/cherrish/android/presentation/mypage/MyPageScreen.kt, .../MyPageHeader.kt
텍스트에 typography 스타일 추가, 프로필 Image에 size(48.dp) 적용 후 clip(CircleShape)로 변경
Splash
app/src/main/java/com/cherrish/android/presentation/splash/SplashViewModel.kt
자동 로그인 분기 주석 처리 및 항상 NavigateToOnboarding을 emit하도록 변경

Sequence Diagram(s)

(생성 조건에 부합하지 않아 생략됨)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • sohee6989
  • hyeminililo
🚥 Pre-merge checks | ✅ 1 | ❌ 4
❌ Failed checks (1 warning, 3 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive 제목이 "[FIX/#143] 2차 qa"로 매우 간단하고 구체적인 내용이 부족하며, 실제 변경 사항을 명확하게 설명하지 못합니다. PR 제목을 더 구체적으로 수정하여 주요 변경 사항을 명확히 설명하는 것이 좋습니다. 예: "[FIX/#143] 색상 팔레트 및 UI 레이아웃 조정"
Linked Issues check ❓ Inconclusive 연결된 이슈 #143은 "2차 qa"라고만 명시되어 있고 구체적인 요구사항이 없어, PR의 변경 사항이 요구사항을 충족하는지 검증하기 어렵습니다. 연결된 이슈에서 "2차 qa" 항목이 구체적으로 무엇을 의미하는지 명확히 하고, 이 PR의 변경 사항과 어떻게 연관되는지 설명해야 합니다.
Out of Scope Changes check ❓ Inconclusive 이 PR은 색상 팔레트 업데이트, UI 상태 관리, 컴포지션 레이아웃 조정, 네비게이션 추가 등 다양한 변경을 포함하고 있으나, 연결된 이슈의 요구사항이 불명확하여 범위 외 변경을 판단하기 어렵습니다. 이슈 #143에서 "2차 qa" 피드백의 구체적 내용을 명확히 하여, 이 PR의 각 변경 사항이 요구사항에 부합하는지 확인해야 합니다.
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed PR 설명은 템플릿의 기본 구조를 따르고 있으나, "2차 qa 반영"이라는 매우 간단한 설명만 포함되어 있어 변경 사항의 세부 내용이 부족합니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
app/src/main/java/com/cherrish/android/presentation/home/component/ChallengeSection.kt (1)

96-103: gauges 비어있는 경우 예외 가능성 있습니다.

gauges.lastIndex가 -1일 때 coerceIn이 예외를 던집니다. 비어있는 리스트가 들어올 수 있다면 방어 로직이 필요합니다.

🛡️ 제안 수정
-    val safeStep = currentStep.coerceIn(0, gauges.lastIndex)
+    val safeStep = if (gauges.isNotEmpty()) {
+        currentStep.coerceIn(0, gauges.lastIndex)
+    } else {
+        0
+    }
🤖 Fix all issues with AI agents
In `@app/src/main/java/com/cherrish/android/presentation/home/HomeViewModel.kt`:
- Around line 43-59: The current code clamps selectedIndex to at least 1
(safeIndex) but leaves currentStep using the raw response.cherryLevel, causing
UI mismatch when level == 0; inside the _uiState.update ->
UiState.Success(HomeUiState(...)) block, compute a single clamped value (e.g.,
safeLevel) from response.cherryLevel using coerceIn(1,
CherrishGaugeType.entries.lastIndex) and use that same safeLevel for both
currentStep and selectedIndex (replace references to level/currentStep or
safeIndex accordingly) so both fields share the identical safe range.
🧹 Nitpick comments (3)
app/src/main/java/com/cherrish/android/presentation/mypage/component/MyPageHeader.kt (1)

34-40: contentScale 추가를 권장합니다.

sizeclip(CircleShape)를 함께 사용할 때, 원본 이미지의 비율이 1:1이 아닌 경우 원형 영역을 제대로 채우지 못할 수 있습니다. ContentScale.Crop을 추가하면 이미지가 원형 영역을 완전히 채우도록 보장할 수 있습니다.

♻️ 권장 수정 사항
+import androidx.compose.ui.layout.ContentScale
         Image(
             painter = painterResource(id = profileIcon),
             contentDescription = null,
             modifier = Modifier
                 .size(48.dp)
-                .clip(CircleShape)
+                .clip(CircleShape),
+            contentScale = ContentScale.Crop
         )
app/src/main/java/com/cherrish/android/presentation/splash/SplashViewModel.kt (1)

20-30: 임시 코드 정리 필요

자동 로그인이 임시 삭제된 상태에서 몇 가지 정리가 필요합니다:

  1. tokenManager.getId() 호출 결과(id)가 사용되지 않아 불필요한 연산입니다
  2. 주석 처리된 코드는 추후 복원 시점이 명확하지 않으면 삭제하는 것이 좋습니다

임시 변경이라면 TODO 주석을 추가하여 복원 시점을 명시하는 것을 권장합니다.

♻️ 제안: TODO 추가 또는 불필요 코드 제거
 fun isAutoLoginCheck() {
     viewModelScope.launch {
-        val id = tokenManager.getId()
         _sideEffect.emit(
+            // TODO: 자동 로그인 기능 복원 예정 (이슈 `#XXX`)
             SplashSideEffect.NavigateToOnboarding
-//                if (id != null) {
-//                    SplashSideEffect.NavigateToHome
-//                } else {
-//                    SplashSideEffect.NavigateToOnboarding
-//                }
         )
     }
 }
app/src/main/java/com/cherrish/android/presentation/challenge/missionprogress/ChallengeMissionProgressViewModel.kt (1)

100-110: stepForUi 매핑 로직 개선

firstOrNull과 fallback 패턴을 사용한 안전한 처리가 좋습니다. 다만 cherryLevel 0과 1이 모두 1로 매핑되는 이유가 명확하지 않아 추후 유지보수 시 혼란을 줄 수 있습니다.

간단한 주석을 추가하면 의도가 더 명확해집니다.

💡 제안: 매핑 의도 주석 추가
 private fun ChallengeMissionProgressResponseModel.toUiState(): ChallengeMissionProgressUiState {
+    // cherryLevel 0은 초기 상태이므로 UI에서는 level 1로 표시
     val stepForUi = when (cherryLevel) {
         0, 1 -> 1
         else -> cherryLevel
     }

Comment on lines +43 to 59
val level = response.cherryLevel
val safeIndex = level.coerceIn(
1,
CherrishGaugeType.entries.lastIndex
)
_uiState.update {
UiState.Success(
HomeUiState(
currentStep = response.cherryLevel,
currentStep = level,
gauges = CherrishGaugeType.entries.toImmutableList(),
challengeRate = response.challengeRate,
challengeName = response.challengeName,
todayDate = response.toTodayDateString(),
plans = response.recentProcedures.toImmutableList(),
upcomingPlans = response.upcomingProcedures.toImmutableList(),
selectedIndex = (response.cherryLevel - 1)
.coerceIn(0, CherrishGaugeType.entries.size - 1)
selectedIndex = safeIndex
)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

LEVEL0 포함 시 상태 불일치 가능성 있습니다.

현재 safeIndex가 최소 1로 고정되어 level=0일 때 selectedIndex가 1로 치우치고, currentStep은 0으로 남아 UI 상태가 어긋날 수 있습니다. 둘 다 같은 안전 범위를 공유하도록 정리하는 게 안전합니다.

🔧 제안 수정
-                val level = response.cherryLevel
-                val safeIndex = level.coerceIn(
-                    1,
-                    CherrishGaugeType.entries.lastIndex
-                )
+                val level = response.cherryLevel
+                val safeLevel = level.coerceIn(
+                    0,
+                    CherrishGaugeType.entries.lastIndex
+                )
 ...
-                            currentStep = level,
+                            currentStep = safeLevel,
 ...
-                            selectedIndex = safeIndex
+                            selectedIndex = safeLevel
🤖 Prompt for AI Agents
In `@app/src/main/java/com/cherrish/android/presentation/home/HomeViewModel.kt`
around lines 43 - 59, The current code clamps selectedIndex to at least 1
(safeIndex) but leaves currentStep using the raw response.cherryLevel, causing
UI mismatch when level == 0; inside the _uiState.update ->
UiState.Success(HomeUiState(...)) block, compute a single clamped value (e.g.,
safeLevel) from response.cherryLevel using coerceIn(1,
CherrishGaugeType.entries.lastIndex) and use that same safeLevel for both
currentStep and selectedIndex (replace references to level/currentStep or
safeIndex accordingly) so both fields share the identical safe range.

Copy link
Contributor

@nhyeonii nhyeonii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

어푸

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
app/src/main/java/com/cherrish/android/presentation/home/component/ChallengeSection.kt (1)

209-221: Preview 함수 이름이 실제 동작과 불일치합니다.

Preview_ChallengeSection_NoChallenge라는 이름이지만 challengeName = "아침 루틴"이 설정되어 있어 실제로는 챌린지가 있는 상태(hasChallenge = true)를 보여줍니다. NoChallenge 상태를 미리보기하려면 challengeName = null 또는 challengeName = ""로 설정해야 합니다.

🐛 NoChallenge 상태를 올바르게 미리보기하는 수정 제안
 `@Preview`(showBackground = true)
 `@Composable`
 private fun Preview_ChallengeSection_NoChallenge() {
     CherrishTheme {
         ChallengeSection(
-            imageRes = R.drawable.img_challenge_lv2,
+            imageRes = null,
             currentStep = 0,
             gauges = CherrishGaugeType.entries.toImmutableList(),
             onChallengeStartClick = {},
-            challengeName = "아침 루틴"
+            challengeName = null
         )
     }
 }
🤖 Fix all issues with AI agents
In
`@app/src/main/java/com/cherrish/android/presentation/challenge/missionprogress/ChallengeMissionProgressViewModel.kt`:
- Around line 101-110: The bug is that stepForCherry uses the raw cherryLevel
while gaugeStep is clamped, causing mismatched UI; change stepForCherry to base
itself on the clamped gaugeStep (use gaugeStep instead of cherryLevel) so both
gaugeStep and CherryType lookup (CherryType.entries.firstOrNull { it.step ==
stepForCherry } ?: CherryType.MONGRONG) use the same bounded value; ensure the
comparison uses the same numeric range and types as gaugeStep to avoid falling
back to MONGRONG unexpectedly.

In
`@app/src/main/java/com/cherrish/android/presentation/home/component/ChallengeSection.kt`:
- Around line 141-144: The currentStep coming from HomeViewModel (set from
response.cherryLevel) is not clamped and can produce incorrect states in
CherrishGaugeBar (its isActive logic uses gauge.step <= currentStep); fix this
by bounding currentStep before passing it into ChallengeSection/CherrishGaugeBar
(e.g., use currentStep.coerceIn(1, gauges.size) or equivalent) — update the code
that sets or forwards currentStep (HomeViewModel assignment and the
ChallengeSection invocation where currentStep is passed) so the value is
validated like safeIndex/StepProgressBar does.
🧹 Nitpick comments (1)
app/src/main/java/com/cherrish/android/presentation/home/component/ChallengeSection.kt (1)

76-81: NoChallengecurrentStep 파라미터 전달 방식 검토 필요.

NoChallenge가 항상 currentStep = 0으로 호출되므로, NoChallenge 컴포저블에서 currentStep 파라미터를 제거하고 내부에서 0을 직접 사용하는 것이 더 명확할 수 있습니다. 또는 향후 확장성을 위해 의도적으로 유지하는 것이라면 현재 상태도 괜찮습니다.

Comment on lines +101 to +110
val gaugeStep = cherryLevel.coerceIn(0, 4)

val stepForCherry = when (cherryLevel) {
0, 1 -> 1
else -> cherryLevel
}

val cherryType = CherryType.entries.firstOrNull { it.step == stepForCherry }
?: CherryType.MONGRONG

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

게이지 단계와 체리 타입 계산이 서로 불일치할 수 있습니다.

gaugeStep는 클램프되지만 stepForCherry는 원본 cherryLevel을 사용합니다. 범위를 벗어난 값이 오면 게이지는 최대인데 체리 타입은 기본값(MONGRONG)으로 떨어져 UI가 엇갈릴 수 있어요. 동일한 기준(클램프된 값)으로 정렬하는 편이 안전합니다.

🛠️ 제안 수정
-    val gaugeStep = cherryLevel.coerceIn(0, 4)
-
-    val stepForCherry = when (cherryLevel) {
+    val gaugeStep = cherryLevel.coerceIn(0, 4)
+
+    val stepForCherry = when (gaugeStep) {
         0, 1 -> 1
-        else -> cherryLevel
+        else -> gaugeStep
     }
🤖 Prompt for AI Agents
In
`@app/src/main/java/com/cherrish/android/presentation/challenge/missionprogress/ChallengeMissionProgressViewModel.kt`
around lines 101 - 110, The bug is that stepForCherry uses the raw cherryLevel
while gaugeStep is clamped, causing mismatched UI; change stepForCherry to base
itself on the clamped gaugeStep (use gaugeStep instead of cherryLevel) so both
gaugeStep and CherryType lookup (CherryType.entries.firstOrNull { it.step ==
stepForCherry } ?: CherryType.MONGRONG) use the same bounded value; ensure the
comparison uses the same numeric range and types as gaugeStep to avoid falling
back to MONGRONG unexpectedly.

Comment on lines 141 to 144
CherrishGaugeBar(
currentStep = safeStep,
currentStep = currentStep,
gauges = gauges
)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

# Find CherrishGaugeBar implementation
fd -e kt | xargs grep -l "fun CherrishGaugeBar" | head -5

Repository: TEAM-Cherrish/Cherrish-Android

Length of output: 169


🏁 Script executed:

# Find ChallengeSection.kt and examine the context around lines 141-144
fd "ChallengeSection.kt" -e kt

Repository: TEAM-Cherrish/Cherrish-Android

Length of output: 160


🏁 Script executed:

# Search for safeStep references to understand what was removed
rg "safeStep" -B 2 -A 2

Repository: TEAM-Cherrish/Cherrish-Android

Length of output: 2405


🏁 Script executed:

# Examine CherrishGaugeBar implementation
cat -n app/src/main/java/com/cherrish/android/core/designsystem/component/gaugebar/CherrishGaugeBar.kt

Repository: TEAM-Cherrish/Cherrish-Android

Length of output: 6359


🏁 Script executed:

# Examine Challenge composable around lines 141-144 in ChallengeSection.kt
sed -n '120,155p' app/src/main/java/com/cherrish/android/presentation/home/component/ChallengeSection.kt | cat -n

Repository: TEAM-Cherrish/Cherrish-Android

Length of output: 1163


🏁 Script executed:

# Search for Challenge composable function signature and currentStep initialization
sed -n '1,100p' app/src/main/java/com/cherrish/android/presentation/home/component/ChallengeSection.kt | cat -n

Repository: TEAM-Cherrish/Cherrish-Android

Length of output: 4374


🏁 Script executed:

# Check CherrishGaugeType to understand step values
fd "CherrishGaugeType" -e kt | head -3

Repository: TEAM-Cherrish/Cherrish-Android

Length of output: 156


🏁 Script executed:

# Look at ChallengeSection Challenge composable more thoroughly
sed -n '94,155p' app/src/main/java/com/cherrish/android/presentation/home/component/ChallengeSection.kt | cat -n

Repository: TEAM-Cherrish/Cherrish-Android

Length of output: 2119


🏁 Script executed:

# Search for how currentStep is derived in the call hierarchy
rg "Challenge\(" -B 3 -A 3 app/src/main/java/com/cherrish/android/presentation/home/component/ChallengeSection.kt

Repository: TEAM-Cherrish/Cherrish-Android

Length of output: 1018


🏁 Script executed:

# Examine CherrishGaugeType enum
cat -n app/src/main/java/com/cherrish/android/presentation/home/type/CherrishGaugeType.kt

Repository: TEAM-Cherrish/Cherrish-Android

Length of output: 662


🏁 Script executed:

# Check ChallengeSection function signature and default values for currentStep
sed -n '38,50p' app/src/main/java/com/cherrish/android/presentation/home/component/ChallengeSection.kt | cat -n

Repository: TEAM-Cherrish/Cherrish-Android

Length of output: 551


🏁 Script executed:

# Search for usages of ChallengeSection to see how currentStep is passed
rg "ChallengeSection\(" -B 2 -A 5 --type kt | head -50

Repository: TEAM-Cherrish/Cherrish-Android

Length of output: 100


🏁 Script executed:

# Check how currentStep values are generated/passed from ViewModels
rg "currentStep" --type-add 'kt:*.kt' -B 2 -A 2 app/src/main/java/com/cherrish/android/presentation/home | head -80

Repository: TEAM-Cherrish/Cherrish-Android

Length of output: 7865


🏁 Script executed:

# Look for usages of ChallengeSection in the codebase
fd -e kt | xargs grep -l "ChallengeSection" | head -5

Repository: TEAM-Cherrish/Cherrish-Android

Length of output: 231


🏁 Script executed:

# Examine HomeViewModel to see how currentStep (level) is set
sed -n '1,80p' app/src/main/java/com/cherrish/android/presentation/home/HomeViewModel.kt | cat -n

Repository: TEAM-Cherrish/Cherrish-Android

Length of output: 3564


🏁 Script executed:

# Check the complete flow - HomeScreen usage of currentStep
sed -n '1,120p' app/src/main/java/com/cherrish/android/presentation/home/HomeScreen.kt | cat -n

Repository: TEAM-Cherrish/Cherrish-Android

Length of output: 5062


🏁 Script executed:

# Check the git history or PR context - look for recent changes around safeStep
rg "safeStep" -B 5 -A 5 app/src/main/java/com/cherrish/android/core/designsystem/component/gaugebar/CherrishGaugeBar.kt

Repository: TEAM-Cherrish/Cherrish-Android

Length of output: 56


🏁 Script executed:

# Verify what values currentStep can actually receive at runtime
# Check HomeViewModel more carefully - does response.cherryLevel have validation?
cat -n app/src/main/java/com/cherrish/android/presentation/home/HomeViewModel.kt | grep -A 15 "loadHomeData"

Repository: TEAM-Cherrish/Cherrish-Android

Length of output: 921


🏁 Script executed:

# Check if there's any validation at the data layer for cherryLevel
fd -e kt | xargs grep -l "cherryLevel\|cherryLevel" | head -5

Repository: TEAM-Cherrish/Cherrish-Android

Length of output: 536


🏁 Script executed:

# Check the HomeResponseModel and HomeResponseDto for cherryLevel definition/validation
cat -n app/src/main/java/com/cherrish/android/data/model/HomeResponseModel.kt

Repository: TEAM-Cherrish/Cherrish-Android

Length of output: 2592


🏁 Script executed:

# Also check the DTO
cat -n app/src/main/java/com/cherrish/android/data/remote/dto/response/HomeResponseDto.kt

Repository: TEAM-Cherrish/Cherrish-Android

Length of output: 1466


🏁 Script executed:

# Final verification: Check if there's any validation in Challenge composable for currentStep
sed -n '94,110p' app/src/main/java/com/cherrish/android/presentation/home/component/ChallengeSection.kt | cat -n

Repository: TEAM-Cherrish/Cherrish-Android

Length of output: 653


currentStep 경계 검증 부족으로 인한 런타임 오류 가능성

HomeViewModel에서 currentStep이 백엔드 응답값(response.cherryLevel)으로 직접 설정되며, 경계 검증 없이 ChallengeSectionChallengeCherrishGaugeBar로 전달됩니다. CherrishGaugeBarisActive 로직(line 54: gauge.step <= currentStep)이 경계값을 처리하지 않으면:

  • currentStep ≤ 0: 모든 게이지가 비활성
  • currentStep > 4: 모든 게이지가 활성 (의도하지 않은 상태)

HomeViewModel 라인 44-46에서 safeIndex는 경계 처리되지만 currentStep은 처리되지 않습니다. StepProgressBar.kt와 유사하게 currentStep.coerceIn(1, gauges.size) 또는 동등한 검증이 필요합니다.

🤖 Prompt for AI Agents
In
`@app/src/main/java/com/cherrish/android/presentation/home/component/ChallengeSection.kt`
around lines 141 - 144, The currentStep coming from HomeViewModel (set from
response.cherryLevel) is not clamped and can produce incorrect states in
CherrishGaugeBar (its isActive logic uses gauge.step <= currentStep); fix this
by bounding currentStep before passing it into ChallengeSection/CherrishGaugeBar
(e.g., use currentStep.coerceIn(1, gauges.size) or equivalent) — update the code
that sets or forwards currentStep (HomeViewModel assignment and the
ChallengeSection invocation where currentStep is passed) so the value is
validated like safeIndex/StepProgressBar does.

@sohee6989 sohee6989 merged commit a7de57e into develop Jan 22, 2026
3 checks passed
@hyeminililo
Copy link
Contributor

잘하셨어요

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FIX🐛 오류 및 버그 수정 소희🍒 소희 담당

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FIX] 2차 qa

3 participants