Conversation
WalkthroughJetpack Compose 기반의 다단계 세그먼트 프로그레스바 UI 컴포넌트가 추가되었습니다. 공개 함수 Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 분 Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
app/src/main/java/com/cherrish/android/presentation/calendar/procedure/component/StepProgressBar.kt (2)
43-47:when조건을 간소화할 수 있습니다.
index < safeStep과index == safeStep모두 동일한 값(1f)을 반환하므로index <= safeStep으로 통합할 수 있습니다.♻️ 제안된 수정
- val target = when { - index < safeStep -> 1f - index == safeStep -> 1f - else -> 0f - } + val target = if (index <= safeStep) 1f else 0f
58-71: Compose 컨벤션에 따라modifier파라미터 위치와 기본값을 수정하세요.Compose API 가이드라인에 따르면
modifier는 두 번째 파라미터로 위치하며 기본값Modifier를 가져야 합니다. 또한animateFloatAsState에label파라미터를 추가하면 Layout Inspector에서 애니메이션 디버깅이 용이해집니다.♻️ 제안된 수정
@Composable private fun StepSegment( + modifier: Modifier = Modifier, targetProgress: Float, - animate: Boolean, - modifier: Modifier + animate: Boolean ) { val progress by animateFloatAsState( targetValue = targetProgress.coerceIn(0f, 1f), animationSpec = if (animate) { tween(durationMillis = 1200, easing = FigmaGentleEasing) } else { tween(durationMillis = 0) - } + }, + label = "StepSegmentProgress" )
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
app/src/main/java/com/cherrish/android/presentation/calendar/procedure/component/StepProgressBar.kt
🧰 Additional context used
📓 Path-based instructions (1)
**/*.kt
⚙️ CodeRabbit configuration file
**/*.kt: - Jetpack Compose 구조, 상태 관리, recomposition 최적화에 집중
- ViewModel, UiState, 단방향 데이터 흐름 패턴 검토
- 불필요한 recomposition 가능성, remember/derivedStateOf 적절한 사용 확인
- 네이밍 컨벤션, 가독성, Google 권장 Android 아키텍처 준수 여부
Files:
app/src/main/java/com/cherrish/android/presentation/calendar/procedure/component/StepProgressBar.kt
🧠 Learnings (1)
📚 Learning: 2026-01-12T19:49:27.085Z
Learnt from: nhyeonii
Repo: TEAM-Cherrish/Cherrish-Android PR: 41
File: app/src/main/java/com/cherrish/android/presentation/challenge/ChallengeScreen.kt:30-39
Timestamp: 2026-01-12T19:49:27.085Z
Learning: When a Jetpack Compose screen composable receives a Scaffold paddingValues: PaddingValues parameter (commonly from Scaffold), apply it to the root container's modifier first (e.g., .padding(paddingValues)) before applying any additional padding. This ensures content respects system bars (status/navigation) and avoids layout overlap. This pattern should be followed across presentation screens under app/src/main/java/com/cherrish/android/presentation/ to maintain consistent insets handling.
Applied to files:
app/src/main/java/com/cherrish/android/presentation/calendar/procedure/component/StepProgressBar.kt
🔇 Additional comments (1)
app/src/main/java/com/cherrish/android/presentation/calendar/procedure/component/StepProgressBar.kt (1)
89-106: LGTM!Preview 구현이 잘 되어 있습니다.
mutableIntStateOf를 사용한 primitive 타입 최적화와 인터랙티브한 테스트 버튼 구성이 적절합니다.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In
@app/src/main/java/com/cherrish/android/presentation/calendar/procedure/component/StepProgressBar.kt:
- Around line 89-106: Preview is missing the CherrishTheme wrapper which
StepSegment relies on via CherrishTheme.colors; update the
StepProgressBarPreview composable to wrap its UI in CherrishTheme { ... } (so
StepProgressBar and StepSegment get the CompositionLocal colors) and ensure the
preview uses the themed wrapper around the Column and Button inside
StepProgressBarPreview.
🧹 Nitpick comments (1)
app/src/main/java/com/cherrish/android/presentation/calendar/procedure/component/StepProgressBar.kt (1)
43-47: 조건문 간소화를 고려해 보세요.
index < safeStep과index == safeStep모두1f를 반환하므로 하나의 조건으로 합칠 수 있습니다.♻️ 제안하는 수정
val target = when { - index < safeStep -> 1f - index == safeStep -> 1f + index <= safeStep -> 1f else -> 0f }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
app/src/main/java/com/cherrish/android/presentation/calendar/procedure/component/StepProgressBar.kt
🧰 Additional context used
📓 Path-based instructions (1)
**/*.kt
⚙️ CodeRabbit configuration file
**/*.kt: - Jetpack Compose 구조, 상태 관리, recomposition 최적화에 집중
- ViewModel, UiState, 단방향 데이터 흐름 패턴 검토
- 불필요한 recomposition 가능성, remember/derivedStateOf 적절한 사용 확인
- 네이밍 컨벤션, 가독성, Google 권장 Android 아키텍처 준수 여부
Files:
app/src/main/java/com/cherrish/android/presentation/calendar/procedure/component/StepProgressBar.kt
🧠 Learnings (1)
📚 Learning: 2026-01-12T19:49:27.085Z
Learnt from: nhyeonii
Repo: TEAM-Cherrish/Cherrish-Android PR: 41
File: app/src/main/java/com/cherrish/android/presentation/challenge/ChallengeScreen.kt:30-39
Timestamp: 2026-01-12T19:49:27.085Z
Learning: When a Jetpack Compose screen composable receives a Scaffold paddingValues: PaddingValues parameter (commonly from Scaffold), apply it to the root container's modifier first (e.g., .padding(paddingValues)) before applying any additional padding. This ensures content respects system bars (status/navigation) and avoids layout overlap. This pattern should be followed across presentation screens under app/src/main/java/com/cherrish/android/presentation/ to maintain consistent insets handling.
Applied to files:
app/src/main/java/com/cherrish/android/presentation/calendar/procedure/component/StepProgressBar.kt
🔇 Additional comments (2)
app/src/main/java/com/cherrish/android/presentation/calendar/procedure/component/StepProgressBar.kt (2)
29-29: LGTM!Material Design 표준 easing 값(0.4, 0.0, 0.2, 1.0)을 사용하여 자연스러운 애니메이션을 구현했습니다.
58-87: LGTM!
animateFloatAsState와 조건부animationSpec을 활용한 애니메이션 로직이 잘 구현되어 있습니다. 현재 단계만 애니메이션되고 나머지는 즉시 전환되는 UX가 적절합니다.
nhyeonii
left a comment
There was a problem hiding this comment.
LGTM ~~ 🚀🚀🚀🚀🚀 스텝 프로그레스바 깔끄맣다 !!! 너무 고생햇더여 최고 최고 🫰🫰🫰🫰
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In
@app/src/main/java/com/cherrish/android/presentation/calendar/procedure/component/StepProgressBar.kt:
- Line 37: totalStep can be 0 or negative causing coerceIn(0, totalStep - 1) to
produce an invalid upper bound; change the logic in StepProgressBar (where
safeStep is computed) to first compute a non-negative maxIndex (e.g., val
maxIndex = (totalStep - 1).coerceAtLeast(0)) or fallback totalStep to at least
1, then set safeStep = currentStep.coerceIn(0, maxIndex); also ensure any
downstream uses of totalStep/ safeStep handle the fallback consistently.
🧹 Nitpick comments (3)
app/src/main/java/com/cherrish/android/presentation/calendar/procedure/component/StepProgressBar.kt (3)
44-48: 중복 조건을 단순화할 수 있습니다.
index < safeStep와index == safeStep모두 동일한 값(1f)을 반환하므로 하나의 조건으로 합칠 수 있습니다.♻️ 제안된 수정
- val target = when { - index < safeStep -> 1f - index == safeStep -> 1f - else -> 0f - } + val target = if (index <= safeStep) 1f else 0f
59-64: Compose 컨벤션:modifier파라미터에 기본값을 추가하세요.Compose 컨벤션에 따르면
modifier파라미터는 기본값으로Modifier를 가져야 합니다. private 함수이지만 일관성 있는 패턴을 유지하는 것이 좋습니다.♻️ 제안된 수정
@Composable private fun StepSegment( targetProgress: Float, animate: Boolean, - modifier: Modifier + modifier: Modifier = Modifier ) {
65-72:animateFloatAsState에label파라미터 추가를 고려하세요.Layout Inspector에서 애니메이션 디버깅 시 유용한
label파라미터를 추가하면 개발 경험이 향상됩니다.♻️ 제안된 수정
val progress by animateFloatAsState( targetValue = targetProgress.coerceIn(0f, 1f), animationSpec = if (animate) { tween(durationMillis = 800, easing = FigmaGentleEasing) } else { tween(durationMillis = 0) - } + }, + label = "StepSegmentProgress" )
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
app/src/main/java/com/cherrish/android/presentation/calendar/procedure/component/StepProgressBar.kt
🧰 Additional context used
📓 Path-based instructions (1)
**/*.kt
⚙️ CodeRabbit configuration file
**/*.kt: - Jetpack Compose 구조, 상태 관리, recomposition 최적화에 집중
- ViewModel, UiState, 단방향 데이터 흐름 패턴 검토
- 불필요한 recomposition 가능성, remember/derivedStateOf 적절한 사용 확인
- 네이밍 컨벤션, 가독성, Google 권장 Android 아키텍처 준수 여부
Files:
app/src/main/java/com/cherrish/android/presentation/calendar/procedure/component/StepProgressBar.kt
🧠 Learnings (1)
📚 Learning: 2026-01-12T19:49:27.085Z
Learnt from: nhyeonii
Repo: TEAM-Cherrish/Cherrish-Android PR: 41
File: app/src/main/java/com/cherrish/android/presentation/challenge/ChallengeScreen.kt:30-39
Timestamp: 2026-01-12T19:49:27.085Z
Learning: When a Jetpack Compose screen composable receives a Scaffold paddingValues: PaddingValues parameter (commonly from Scaffold), apply it to the root container's modifier first (e.g., .padding(paddingValues)) before applying any additional padding. This ensures content respects system bars (status/navigation) and avoids layout overlap. This pattern should be followed across presentation screens under app/src/main/java/com/cherrish/android/presentation/ to maintain consistent insets handling.
Applied to files:
app/src/main/java/com/cherrish/android/presentation/calendar/procedure/component/StepProgressBar.kt
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: PR Build Check
- GitHub Check: PR Lint Check
🔇 Additional comments (1)
app/src/main/java/com/cherrish/android/presentation/calendar/procedure/component/StepProgressBar.kt (1)
90-110: LGTM!Preview 구현이 적절합니다.
mutableIntStateOf를 사용한 상태 관리와 인터랙티브한 테스트 버튼이 잘 구성되어 있습니다.
| currentStep: Int, | ||
| modifier: Modifier = Modifier | ||
| ) { | ||
| val safeStep = currentStep.coerceIn(0, totalStep - 1) |
There was a problem hiding this comment.
totalStep이 0 이하일 때 잠재적 문제가 있습니다.
totalStep이 0 또는 음수인 경우, coerceIn(0, totalStep - 1)은 잘못된 범위(예: coerceIn(0, -1))를 생성합니다. 방어적 처리를 추가하는 것이 좋습니다.
🛠️ 제안된 수정
fun StepProgressBar(
totalStep: Int,
currentStep: Int,
modifier: Modifier = Modifier
) {
+ if (totalStep <= 0) return
+
val safeStep = currentStep.coerceIn(0, totalStep - 1)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| val safeStep = currentStep.coerceIn(0, totalStep - 1) | |
| fun StepProgressBar( | |
| totalStep: Int, | |
| currentStep: Int, | |
| modifier: Modifier = Modifier | |
| ) { | |
| if (totalStep <= 0) return | |
| val safeStep = currentStep.coerceIn(0, totalStep - 1) | |
| // ... rest of the function | |
| } |
🤖 Prompt for AI Agents
In
@app/src/main/java/com/cherrish/android/presentation/calendar/procedure/component/StepProgressBar.kt
at line 37, totalStep can be 0 or negative causing coerceIn(0, totalStep - 1) to
produce an invalid upper bound; change the logic in StepProgressBar (where
safeStep is computed) to first compute a non-negative maxIndex (e.g., val
maxIndex = (totalStep - 1).coerceAtLeast(0)) or fallback totalStep to at least
1, then set safeStep = currentStep.coerceIn(0, maxIndex); also ensure any
downstream uses of totalStep/ safeStep handle the fallback consistently.
hyeminililo
left a comment
There was a problem hiding this comment.
굿굿 좋습니다아 ~~~!! 수고하셨습니당
| private fun StepSegment( | ||
| targetProgress: Float, | ||
| animate: Boolean, | ||
| modifier: Modifier |
There was a problem hiding this comment.
P1: 늦은 리뷰 죄송합니다.. modifier: Modifier = Modifier 기본 값 넣어주세욯ㅎㅎ
sohee6989
left a comment
There was a problem hiding this comment.
수고하셨습니다!
리뷰 단거 한개만 확인해주시면 감사하겟습니다!
| ) { | ||
| repeat(totalStep) { index -> | ||
| val target = when { | ||
| index < safeStep -> 1f |
There was a problem hiding this comment.
p2: 이거 index <= safeStep -> 1f로 써주면 더 가독성 좋을 듯 합니다!
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
app/src/main/java/com/cherrish/android/presentation/calendar/procedure/component/StepProgressBar.kt (2)
32-37:totalStep이 0 이하일 때의 방어 처리를 고려해 보세요.현재
totalStep이 0 또는 음수일 경우,coerceIn(0, totalStep - 1)이 예상치 못한 값을 반환하고repeat()이 아무것도 렌더링하지 않습니다. 호출부에서 항상 양수를 보장한다면 괜찮지만, 방어적으로require나 early return을 추가하는 것을 권장합니다.♻️ 선택적 방어 코드 예시
fun StepProgressBar( totalStep: Int, currentStep: Int, modifier: Modifier = Modifier ) { + if (totalStep <= 0) return + val safeStep = currentStep.coerceIn(0, totalStep - 1)
64-71:animateFloatAsState에label파라미터 추가를 권장합니다.Compose Layout Inspector에서 애니메이션을 디버깅할 때
label이 있으면 식별이 용이합니다. 필수는 아니지만 디버깅 편의를 위해 추가하는 것이 좋습니다.♻️ label 추가 예시
val progress by animateFloatAsState( targetValue = targetProgress.coerceIn(0f, 1f), animationSpec = if (animate) { tween(durationMillis = 800, easing = FigmaGentleEasing) } else { tween(durationMillis = 0) - } + }, + label = "StepSegmentProgress" )
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
app/src/main/java/com/cherrish/android/presentation/calendar/procedure/component/StepProgressBar.kt
🧰 Additional context used
📓 Path-based instructions (1)
**/*.kt
⚙️ CodeRabbit configuration file
**/*.kt: - Jetpack Compose 구조, 상태 관리, recomposition 최적화에 집중
- ViewModel, UiState, 단방향 데이터 흐름 패턴 검토
- 불필요한 recomposition 가능성, remember/derivedStateOf 적절한 사용 확인
- 네이밍 컨벤션, 가독성, Google 권장 Android 아키텍처 준수 여부
Files:
app/src/main/java/com/cherrish/android/presentation/calendar/procedure/component/StepProgressBar.kt
🧠 Learnings (1)
📚 Learning: 2026-01-12T19:49:27.085Z
Learnt from: nhyeonii
Repo: TEAM-Cherrish/Cherrish-Android PR: 41
File: app/src/main/java/com/cherrish/android/presentation/challenge/ChallengeScreen.kt:30-39
Timestamp: 2026-01-12T19:49:27.085Z
Learning: When a Jetpack Compose screen composable receives a Scaffold paddingValues: PaddingValues parameter (commonly from Scaffold), apply it to the root container's modifier first (e.g., .padding(paddingValues)) before applying any additional padding. This ensures content respects system bars (status/navigation) and avoids layout overlap. This pattern should be followed across presentation screens under app/src/main/java/com/cherrish/android/presentation/ to maintain consistent insets handling.
Applied to files:
app/src/main/java/com/cherrish/android/presentation/calendar/procedure/component/StepProgressBar.kt
🧬 Code graph analysis (1)
app/src/main/java/com/cherrish/android/presentation/calendar/procedure/component/StepProgressBar.kt (1)
app/src/main/java/com/cherrish/android/core/designsystem/theme/Theme.kt (1)
CherrishTheme(38-61)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: PR Build Check
- GitHub Check: PR Lint Check
🔇 Additional comments (2)
app/src/main/java/com/cherrish/android/presentation/calendar/procedure/component/StepProgressBar.kt (2)
89-111: LGTM!Preview 구현이 잘 되어 있습니다.
CherrishTheme래핑과mutableIntStateOf사용이 적절하며, 인터랙티브하게 스텝을 테스트할 수 있어 유용합니다.
73-86: 세그먼트 렌더링 구조가 적절합니다.
Box중첩 구조와fillMaxWidth(progress)를 활용한 프로그레스 표현이 깔끔합니다.RoundedCornerShape(76.dp)로 pill 형태를 만드는 것도 좋은 접근입니다.
Related issue 🛠
Work Description ✏️
Screenshot 📸
Uncompleted Tasks 😅
N/A
To Reviewers 📢
프로그레스 바 구현햇어요 뿌
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.