Conversation
… feat/#16-calendar-view-component
Walkthrough캘린더 화면용 Jetpack Compose 컴포넌트(추가 버튼, 다운타임 상태 표시기, 절차 항목, 일정 카드), 관련 모델/유틸(ProcedureInfoModel, ProcedureType, DownTimeStatus, ProcedureUtil), 테마 색상(shadow) 및 플러스 아이콘 리소스가 추가되고 CalendarDisplayMode.Downtime에 selectedProcedureId가 도입되었습니다. Changes
Sequence Diagram(s)(생성 조건 미충족 — 생략) Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
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: 1
🤖 Fix all issues with AI agents
In
@app/src/main/java/com/cherrish/android/presentation/calendar/model/CalendarDisplayMode.kt:
- Around line 5-14: Add the @Immutable annotation to the sealed interface
CalendarDisplayMode so Compose can treat its implementations (the data classes
Normal and Downtime) as immutable; import androidx.compose.runtime.Immutable and
annotate the CalendarDisplayMode sealed interface declaration with @Immutable to
match CalendarDay, CalendarMonth, and ProcedureInfoModel.
🧹 Nitpick comments (15)
app/src/main/java/com/cherrish/android/presentation/calendar/util/CalendarCalculator.kt (1)
5-5: 의도(동일 요일=0 반환) 명시 + 반환 타입 명시 추천현재 구현은 “앞으로 진행” 기준으로 0..6을 반환하며(같은 요일이면 0), 계산 자체는 깔끔합니다. 다만 달력 로직에서 “다음 주 같은 요일”을 원해 7을 기대하는 케이스가 종종 있어, 의미를 KDoc로 고정하고 반환 타입을 명시해 두는 편이 안전합니다.
제안 diff
-fun DayOfWeek.daysUntil(other: DayOfWeek) = (other.value - value + 7) % 7 +/** + * Returns the number of days to reach [other] moving forward within a 7-day cycle. + * Range: 0..6 (returns 0 when [other] is the same as this day). + */ +fun DayOfWeek.daysUntil(other: DayOfWeek): Int = (other.value - value + 7) % 7app/src/main/java/com/cherrish/android/presentation/calendar/model/ProcedureType.kt (1)
3-6: KDoc 추가를 고려하세요.enum 클래스가 간단하지만, 여러 컴포넌트에서 사용되는 공용 모델이므로 각 상태의 의미를 명확히 하는 문서화가 유용합니다.
📝 KDoc 추가 예시
+/** + * 시술의 활성화 상태를 나타내는 타입 + */ enum class ProcedureType { + /** 활성 상태의 시술 */ ACTIVE, + /** 비활성 상태의 시술 */ INACTIVE }app/src/main/res/drawable/ic_plus.xml (1)
6-10: 테마 색상 적용을 고려하세요.아이콘의 색상이
#ffffff로 하드코딩되어 있어 다크 모드나 테마 변경 시 유연하게 대응하기 어렵습니다. 또한fillColor와strokeColor가 동일한 색상을 사용하고 있어 중복입니다.🎨 개선 방안
- Compose에서
Icon사용 시tint파라미터로 색상을 제어하거나fillColor를@android:color/white로 변경하여 시스템 색상 참조strokeColor제거 (fill만으로 충분한 경우)<path android:pathData="M12,5.9C12.225,5.9 12.441,5.99 12.601,6.149C12.76,6.309 12.85,6.525 12.85,6.75V11.15H17.25C17.475,11.15 17.691,11.24 17.851,11.399C18.01,11.559 18.1,11.775 18.1,12C18.1,12.225 18.01,12.441 17.851,12.601C17.691,12.76 17.475,12.85 17.25,12.85H12.85V17.25C12.85,17.475 12.76,17.691 12.601,17.851C12.441,18.01 12.225,18.1 12,18.1C11.775,18.1 11.559,18.01 11.399,17.851C11.24,17.691 11.15,17.475 11.15,17.25V12.85H6.75C6.525,12.85 6.309,12.76 6.149,12.601C5.99,12.441 5.9,12.225 5.9,12C5.9,11.775 5.99,11.559 6.149,11.399C6.309,11.24 6.525,11.15 6.75,11.15H11.15V6.75C11.15,6.525 11.24,6.309 11.399,6.149C11.559,5.99 11.775,5.9 12,5.9Z" - android:strokeWidth="0.2" - android:fillColor="#ffffff" - android:strokeColor="#ffffff"/> + android:fillColor="@android:color/white"/>AddProcedureButton에서
Icon(tint = ...)로 동적으로 색상을 지정하는 것을 권장합니다.app/src/main/res/drawable/ic_calendar_left.xml (1)
6-13: 테마 색상 사용을 권장합니다.
#1B1D1F색상이 하드코딩되어 있어 테마 변경 시 일관성을 유지하기 어렵습니다.fillColor와strokeColor가 동일하여 중복되며, Compose의Icontint로 색상을 제어하는 것이 더 유연합니다.🎨 리팩토링 제안
<path android:pathData="M14.854,6.146C15.049,6.342 15.049,6.658 14.854,6.854L9.207,12.5L14.854,18.146C15.049,18.342 15.049,18.658 14.854,18.854C14.658,19.049 14.342,19.049 14.146,18.854L8.146,12.854C7.951,12.658 7.951,12.342 8.146,12.146L14.146,6.146C14.342,5.951 14.658,5.951 14.854,6.146Z" - android:strokeLineJoin="round" - android:strokeWidth="0.4" - android:fillColor="#1B1D1F" android:fillType="evenOdd" - android:strokeColor="#1B1D1F" - android:strokeLineCap="round"/> + android:fillColor="@android:color/black"/>CalendarMonthHeader 등에서 사용 시
Icon(tint = MaterialTheme.colorScheme.onSurface)로 동적 색상을 적용하세요.app/src/main/res/drawable/ic_calendar_right.xml (1)
6-13: 테마 색상 사용을 권장합니다.
ic_calendar_left.xml과 동일하게#1B1D1F색상이 하드코딩되어 있습니다. 일관된 테마 적용을 위해 Compose의 tint 파라미터를 활용하는 것이 좋습니다.🎨 리팩토링 제안
<path android:pathData="M9.146,6.146C8.951,6.342 8.951,6.658 9.146,6.854L14.793,12.5L9.146,18.146C8.951,18.342 8.951,18.658 9.146,18.854C9.342,19.049 9.658,19.049 9.854,18.854L15.854,12.854C16.049,12.658 16.049,12.342 15.854,12.146L9.854,6.146C9.658,5.951 9.342,5.951 9.146,6.146Z" - android:strokeLineJoin="round" - android:strokeWidth="0.4" - android:fillColor="#1B1D1F" android:fillType="evenOdd" - android:strokeColor="#1B1D1F" - android:strokeLineCap="round"/> + android:fillColor="@android:color/black"/>CalendarMonthHeader에서 사용 시
Icon(tint = MaterialTheme.colorScheme.onSurface)로 테마 색상을 적용하세요.app/src/main/java/com/cherrish/android/presentation/calendar/util/ProcedureColors.kt (1)
7-12: Compose 안정성을 위해@Immutable어노테이션 추가를 권장합니다.
ProcedureColors는 Compose에서 사용되는 데이터 클래스이며 불변 속성만 포함하므로,@Immutable어노테이션을 추가하면 Compose의 스마트 리컴포지션 최적화를 활용할 수 있습니다.ProcedureInfoModel과 동일한 패턴입니다.♻️ 제안하는 수정
+import androidx.compose.runtime.Immutable + +@Immutable data class ProcedureColors( val background: Color, val border: Color, val text: Color, val divider: Color )app/src/main/java/com/cherrish/android/presentation/calendar/component/AddProcedureButton.kt (1)
66-66: 하드코딩된 문자열을 리소스로 추출하는 것을 권장합니다."시술 일정 추가하기" 문자열이 하드코딩되어 있습니다. 국제화(i18n) 및 유지보수성을 위해
strings.xml로 추출하는 것이 좋습니다.♻️ 제안하는 수정
res/values/strings.xml에 추가:<string name="add_procedure_schedule">시술 일정 추가하기</string>코드 수정:
+import androidx.compose.ui.res.stringResource + Text( - text = "시술 일정 추가하기", + text = stringResource(id = R.string.add_procedure_schedule), color = CherrishTheme.colors.gray0, style = CherrishTheme.typography.title2SB16 )app/src/main/java/com/cherrish/android/presentation/calendar/model/DownTimeStatus.kt (1)
3-10: 다국어 지원을 위해 문자열 리소스 사용을 고려하세요.현재 레이블이 하드코딩되어 있습니다. 향후 다국어 지원이 필요할 경우,
strings.xml리소스를 사용하는 것이 좋습니다. 한국어 전용 앱이라면 현재 구현도 괜찮습니다.app/src/main/java/com/cherrish/android/presentation/calendar/component/DaysOfWeekTitle.kt (1)
40-47: 하드코딩된Color.Black대신 테마 색상을 사용하세요.다른 컴포넌트들(
DownTimeStatusIndicator,CalendarMonthHeader)은CherrishTheme.colors를 사용하고 있습니다. 일관성과 다크 모드 지원을 위해 테마 색상 사용을 권장합니다.♻️ 수정 제안
Text( text = dayOfWeek.getDisplayName( TextStyle.SHORT, Locale.getDefault() ), textAlign = TextAlign.Center, - color = Color.Black + color = CherrishTheme.colors.gray1000 )app/src/main/java/com/cherrish/android/presentation/calendar/component/DownTimeStatusIndicator.kt (2)
50-61: 불필요한.padding(vertical = 3.dp)제거를 권장합니다.
Box에clip,background,border를 적용한 후padding을 추가해도 12dp 크기의 원형 점에는 시각적 효과가 없습니다. 이 패딩은 제거해도 됩니다.♻️ 수정 제안
Box( modifier = Modifier .size(12.dp) .clip(shape = CircleShape) .background(color = colors.background) .border( width = 1.dp, color = colors.border, shape = CircleShape ) - .padding(vertical = 3.dp) )
70-76: Preview 함수명이 실제 미리보기 대상과 일치하지 않습니다.
DownTimeStatusItemPreview는DownTimeStatusIndicator를 미리보기하고 있습니다. 명확성을 위해DownTimeStatusIndicatorPreview로 변경하는 것을 권장합니다.♻️ 수정 제안
@Preview @Composable -private fun DownTimeStatusItemPreview() { +private fun DownTimeStatusIndicatorPreview() { CherrishTheme { DownTimeStatusIndicator() } }app/src/main/java/com/cherrish/android/presentation/calendar/component/CalendarMonthHeader.kt (1)
44-51: getDisplayName() 호출을 remember로 최적화하는 것을 고려하세요.현재 구현에서는 매 recomposition마다
getDisplayName()과Locale.getDefault()가 호출됩니다. 헤더 컴포넌트는 자주 recompose될 수 있으므로, 다음과 같이 최적화를 고려해보세요:♻️ 제안하는 최적화
+ val monthText = remember(yearMonth) { + "${yearMonth.year}년 ${yearMonth.month.getDisplayName( + TextStyle.SHORT, + Locale.getDefault() + )}" + } + Text( - text = "${yearMonth.year}년 ${yearMonth.month.getDisplayName( - TextStyle.SHORT, - Locale.getDefault() - )}", + text = monthText, color = CherrishTheme.colors.gray1000, style = CherrishTheme.typography.title2M16 )app/src/main/java/com/cherrish/android/presentation/calendar/component/ProcedureScheduleCard.kt (1)
54-77: 리스트 렌더링 방식을 검토하세요.현재
forEachIndexed를 사용하여 아이템을 렌더링하고 있습니다. 시술 정보가 적을 때는 문제없지만, 아이템 수가 증가하면 성능 문제가 발생할 수 있습니다.고려사항:
- 아이템 수가 적고 스크롤이 필요 없다면 현재 구현 유지 가능
- 아이템 수가 많아질 가능성이 있다면
LazyColumn사용을 권장♻️ LazyColumn을 사용한 대안
+ LazyColumn( + modifier = modifier .fillMaxWidth() .dropShadow(...) .clip(shape = RoundedCornerShape(10.dp)) .background(color = CherrishTheme.colors.gray0, shape = RoundedCornerShape(10.dp)) - .padding(vertical = 18.dp, horizontal = 19.dp) - ) { + ) { + item { + Column(modifier = Modifier.padding(vertical = 18.dp, horizontal = 19.dp)) { - ScheduleHeader(displayMode = displayMode) + ScheduleHeader(displayMode = displayMode) - Spacer(modifier = Modifier.height(15.dp)) + Spacer(modifier = Modifier.height(15.dp)) + } + } - procedureInfo.forEachIndexed { index, procedure -> + itemsIndexed(procedureInfo) { index, procedure -> val procedureType = when (displayMode) { is CalendarDisplayMode.Normal -> ProcedureType.ACTIVE is CalendarDisplayMode.Downtime -> { if (displayMode.selectedProcedureId == procedure.procedureId) { ProcedureType.ACTIVE } else { ProcedureType.INACTIVE } } } - ProcedureInfoItem( + ProcedureInfoItem( + modifier = Modifier.padding(horizontal = 19.dp), procedureName = procedure.procedureName, procedureDay = procedure.procedureDay, downTimeDuration = procedure.downTimeDuration, procedureType = procedureType, onClick = { onClick(procedure.procedureId) } ) if (index < procedureInfo.lastIndex) { Spacer(modifier = Modifier.height(8.dp)) } } }app/src/main/java/com/cherrish/android/presentation/calendar/component/DayItem.kt (1)
40-43: onClick 내부의 중복 조건을 제거하세요.
noRippleClickable의enabled파라미터가 이미day is CalendarDay.Date로 설정되어 있으므로,onClick람다 내부의 타입 체크가 중복됩니다.enabled가false일 때는onClick이 호출되지 않습니다.🔧 제안하는 수정
.noRippleClickable( enabled = day is CalendarDay.Date, - onClick = { if (day is CalendarDay.Date) onDateClick(day.date) } + onClick = { onDateClick((day as CalendarDay.Date).date) } ),app/src/main/java/com/cherrish/android/presentation/calendar/component/ProcedureInfoItem.kt (1)
37-37: getProcedureColors 호출을 remember로 최적화하세요.색상 계산이 매 recomposition마다 실행되고 있습니다.
procedureType이나 테마 색상이 변경되지 않으면 동일한 결과를 반환하므로 메모이제이션이 필요합니다.♻️ 제안하는 최적화
+ val cherrishColors = CherrishTheme.colors + val colors = remember(procedureType, cherrishColors) { + getProcedureColors(procedureType, cherrishColors) + } - val colors = getProcedureColors(procedureType, CherrishTheme.colors)
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (23)
app/src/main/java/com/cherrish/android/presentation/calendar/component/AddProcedureButton.ktapp/src/main/java/com/cherrish/android/presentation/calendar/component/BasicCalendar.ktapp/src/main/java/com/cherrish/android/presentation/calendar/component/CalendarMonthHeader.ktapp/src/main/java/com/cherrish/android/presentation/calendar/component/CherrishCalendar.ktapp/src/main/java/com/cherrish/android/presentation/calendar/component/DayItem.ktapp/src/main/java/com/cherrish/android/presentation/calendar/component/DaysOfWeekTitle.ktapp/src/main/java/com/cherrish/android/presentation/calendar/component/DownTimeStatusIndicator.ktapp/src/main/java/com/cherrish/android/presentation/calendar/component/ProcedureInfoItem.ktapp/src/main/java/com/cherrish/android/presentation/calendar/component/ProcedureScheduleCard.ktapp/src/main/java/com/cherrish/android/presentation/calendar/model/CalendarDay.ktapp/src/main/java/com/cherrish/android/presentation/calendar/model/CalendarDisplayMode.ktapp/src/main/java/com/cherrish/android/presentation/calendar/model/CalendarMonth.ktapp/src/main/java/com/cherrish/android/presentation/calendar/model/DownTimeStatus.ktapp/src/main/java/com/cherrish/android/presentation/calendar/model/ProcedureInfoModel.ktapp/src/main/java/com/cherrish/android/presentation/calendar/model/ProcedureType.ktapp/src/main/java/com/cherrish/android/presentation/calendar/util/CalendarCalculator.ktapp/src/main/java/com/cherrish/android/presentation/calendar/util/DateExtensions.ktapp/src/main/java/com/cherrish/android/presentation/calendar/util/DownTimeColors.ktapp/src/main/java/com/cherrish/android/presentation/calendar/util/MonthData.ktapp/src/main/java/com/cherrish/android/presentation/calendar/util/ProcedureColors.ktapp/src/main/res/drawable/ic_calendar_left.xmlapp/src/main/res/drawable/ic_calendar_right.xmlapp/src/main/res/drawable/ic_plus.xml
🧰 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/model/ProcedureType.ktapp/src/main/java/com/cherrish/android/presentation/calendar/util/DownTimeColors.ktapp/src/main/java/com/cherrish/android/presentation/calendar/util/ProcedureColors.ktapp/src/main/java/com/cherrish/android/presentation/calendar/component/DaysOfWeekTitle.ktapp/src/main/java/com/cherrish/android/presentation/calendar/model/ProcedureInfoModel.ktapp/src/main/java/com/cherrish/android/presentation/calendar/model/CalendarDisplayMode.ktapp/src/main/java/com/cherrish/android/presentation/calendar/component/DownTimeStatusIndicator.ktapp/src/main/java/com/cherrish/android/presentation/calendar/util/DateExtensions.ktapp/src/main/java/com/cherrish/android/presentation/calendar/component/CalendarMonthHeader.ktapp/src/main/java/com/cherrish/android/presentation/calendar/model/CalendarDay.ktapp/src/main/java/com/cherrish/android/presentation/calendar/component/DayItem.ktapp/src/main/java/com/cherrish/android/presentation/calendar/component/ProcedureInfoItem.ktapp/src/main/java/com/cherrish/android/presentation/calendar/component/ProcedureScheduleCard.ktapp/src/main/java/com/cherrish/android/presentation/calendar/util/MonthData.ktapp/src/main/java/com/cherrish/android/presentation/calendar/component/BasicCalendar.ktapp/src/main/java/com/cherrish/android/presentation/calendar/util/CalendarCalculator.ktapp/src/main/java/com/cherrish/android/presentation/calendar/component/AddProcedureButton.ktapp/src/main/java/com/cherrish/android/presentation/calendar/model/DownTimeStatus.ktapp/src/main/java/com/cherrish/android/presentation/calendar/component/CherrishCalendar.ktapp/src/main/java/com/cherrish/android/presentation/calendar/model/CalendarMonth.kt
🧬 Code graph analysis (7)
app/src/main/java/com/cherrish/android/presentation/calendar/component/DaysOfWeekTitle.kt (2)
app/src/main/java/com/cherrish/android/core/designsystem/theme/Theme.kt (1)
CherrishTheme(38-61)app/src/main/java/com/cherrish/android/presentation/calendar/util/DateExtensions.kt (1)
daysOfWeek(9-13)
app/src/main/java/com/cherrish/android/presentation/calendar/component/DownTimeStatusIndicator.kt (2)
app/src/main/java/com/cherrish/android/presentation/calendar/util/DownTimeColors.kt (1)
getDowntimeColors(12-34)app/src/main/java/com/cherrish/android/core/designsystem/theme/Theme.kt (1)
CherrishTheme(38-61)
app/src/main/java/com/cherrish/android/presentation/calendar/component/CalendarMonthHeader.kt (1)
app/src/main/java/com/cherrish/android/core/designsystem/theme/Theme.kt (1)
CherrishTheme(38-61)
app/src/main/java/com/cherrish/android/presentation/calendar/component/ProcedureInfoItem.kt (2)
app/src/main/java/com/cherrish/android/presentation/calendar/util/ProcedureColors.kt (1)
getProcedureColors(14-32)app/src/main/java/com/cherrish/android/core/designsystem/theme/Theme.kt (1)
CherrishTheme(38-61)
app/src/main/java/com/cherrish/android/presentation/calendar/component/BasicCalendar.kt (3)
app/src/main/java/com/cherrish/android/presentation/calendar/util/MonthData.kt (1)
generateMonthData(53-61)app/src/main/java/com/cherrish/android/presentation/calendar/util/DateExtensions.kt (1)
daysOfWeek(9-13)app/src/main/java/com/cherrish/android/presentation/calendar/component/DaysOfWeekTitle.kt (1)
DaysOfWeekTitle(24-51)
app/src/main/java/com/cherrish/android/presentation/calendar/component/AddProcedureButton.kt (2)
app/src/main/java/com/cherrish/android/core/designsystem/component/button/CherrishBasicButton.kt (1)
CherrishBasicButton(19-42)app/src/main/java/com/cherrish/android/core/designsystem/theme/Theme.kt (1)
CherrishTheme(38-61)
app/src/main/java/com/cherrish/android/presentation/calendar/component/CherrishCalendar.kt (4)
app/src/main/java/com/cherrish/android/presentation/calendar/component/CalendarMonthHeader.kt (1)
CalendarMonthHeader(24-60)app/src/main/java/com/cherrish/android/presentation/calendar/component/BasicCalendar.kt (1)
BasicCalendar(24-58)app/src/main/java/com/cherrish/android/presentation/calendar/component/DayItem.kt (1)
DayItem(30-59)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 Lint Check
- GitHub Check: PR Build Check
🔇 Additional comments (15)
app/src/main/java/com/cherrish/android/presentation/calendar/model/CalendarMonth.kt (1)
6-10: 좋은 구조입니다!
@Immutable애노테이션을 사용하여 Compose의 recomposition 최적화를 적절히 활용하고 있습니다.YearMonth타입 사용과 간결한 데이터 클래스 구조가 적절합니다.app/src/main/java/com/cherrish/android/presentation/calendar/model/ProcedureInfoModel.kt (1)
5-11: 잘 구현되었습니다!
@Immutable어노테이션을 사용하여 Compose의 리컴포지션 최적화를 올바르게 지원하고 있으며, 데이터 클래스 구조도 명확합니다.app/src/main/java/com/cherrish/android/presentation/calendar/util/ProcedureColors.kt (1)
14-32: 색상 매핑 로직이 정확합니다.
ProcedureType에 따른 색상 매핑이 명확하며,when표현식이 모든 케이스를 처리하고 있습니다.app/src/main/java/com/cherrish/android/presentation/calendar/component/AddProcedureButton.kt (2)
37-43: 프레스 애니메이션이 올바르게 구현되었습니다.
interactionSource.collectIsPressedAsState()와animateFloatAsState를 사용한 스케일 애니메이션 구현이 Compose 모범 사례를 따르고 있습니다.
45-72: 버튼 구조와 스타일링이 적절합니다.
CherrishBasicButton을 활용하고 디자인 시스템의 색상과 타이포그래피를 일관되게 적용하고 있습니다.app/src/main/java/com/cherrish/android/presentation/calendar/util/DateExtensions.kt (2)
9-13: 주의 시작일 재정렬 로직이 정확합니다.
DayOfWeek.entries를 피벗 기준으로 재정렬하는 로직이 올바르게 구현되어 있습니다. 로케일 기반 주 시작일을 지원합니다.
15-27: 날짜 확장 함수들이 유용하고 명확합니다.
YearMonth와LocalDate에 대한 확장 함수 및 속성들이 캘린더 내비게이션과 날짜 계산을 간결하게 지원합니다.app/src/main/java/com/cherrish/android/presentation/calendar/component/BasicCalendar.kt (2)
32-42:remember를 올바르게 사용하여 불필요한 리컴포지션을 방지하고 있습니다.
yearMonth,displayMode,firstDayOfWeek변경 시에만 데이터를 재계산하도록 적절한 키를 지정했습니다. Compose 최적화 모범 사례를 따르고 있습니다.
60-87: 캘린더 그리드 레이아웃이 잘 구현되었습니다.
weight(1f)와aspectRatio(1f)를 사용하여 정사각형 셀을 구현하고,dayContent람다를 통해 유연한 컨텐츠 주입을 지원합니다. 컴포저블 구조가 명확합니다.app/src/main/java/com/cherrish/android/presentation/calendar/util/DownTimeColors.kt (1)
7-34: LGTM!
when표현식이 모든DownTimeStatus값을 exhaustive하게 처리하고 있어 향후 새로운 상태 추가 시 컴파일 에러로 누락을 방지합니다. 순수 함수로 잘 설계되었습니다.선택적으로
DownTimeColors데이터 클래스에@Immutable어노테이션을 추가하면 Compose 최적화에 도움이 될 수 있습니다.app/src/main/java/com/cherrish/android/presentation/calendar/model/CalendarDay.kt (1)
6-27: LGTM!
@Immutable어노테이션이 모든 sealed interface와 data class에 적절히 적용되어 Compose recomposition 최적화가 잘 되어 있습니다.Empty,Normal,Downtime변형을 통한 sealed hierarchy 설계가 깔끔합니다.app/src/main/java/com/cherrish/android/presentation/calendar/component/CherrishCalendar.kt (2)
23-53: LGTM!캘린더 컴포넌트가 잘 구성되어 있습니다:
CalendarMonthHeader,BasicCalendar,DayItem을 깔끔하게 조합yearMonth.previousMonth/nextMonth확장 함수를 활용한 월 네비게이션day is CalendarDay.Date && day.date == selectedDate스마트 캐스트를 활용한 선택 로직단방향 데이터 흐름 패턴(
onDateClick,onMonthChange콜백)이 잘 적용되었습니다.
55-103: Preview 함수들이 잘 작성되었습니다.
remember와mutableStateOf를 사용하여 인터랙티브 프리뷰를 올바르게 구현했습니다. Normal 모드와 Downtime 모드 모두 테스트할 수 있어 개발 시 유용합니다.app/src/main/java/com/cherrish/android/presentation/calendar/component/DayItem.kt (1)
101-104: remember를 활용한 색상 계산 최적화가 우수합니다.
day.status와cherrishColors를 키로 사용하여 다운타임 색상 계산을 메모이제이션하고 있습니다. 이는 불필요한 recomposition을 방지하는 좋은 패턴입니다.app/src/main/java/com/cherrish/android/presentation/calendar/util/MonthData.kt (1)
10-27: calendarMonth가 data class의 equals/hashCode/copy에서 제외됩니다.
MonthData가data class로 선언되어 있지만,calendarMonth는 primary constructor 외부에서 계산되는 프로퍼티이므로equals(),hashCode(),copy()에 포함되지 않습니다.영향:
- 동일한
month,inDays,displayMode를 가진 두 인스턴스는 동등하게 비교되지만, 실제로 다른calendarMonth값을 가질 수 있습니다 (구현상 불가능하지만 의미론적으로 일관성 부족).copy()를 사용하면calendarMonth가 재계산됩니다.권장사항:
- 의도된 설계라면 주석으로 명시
- 또는 일반
class로 변경 고려이것이 의도된 설계인지 확인해주세요. 만약
MonthData를 값 객체로 사용하지 않는다면data class대신 일반class를 사용하는 것이 더 명확할 수 있습니다.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
app/src/main/java/com/cherrish/android/presentation/calendar/util/ProcedureUtil.kt (2)
15-33: recomposition 최적화 고려 제안함수 로직은 올바르며 ACTIVE/INACTIVE 상태에 따라 명확한 색상 구분을 제공합니다.
이 함수는 Composable이 아니므로, 호출하는 Composable에서
remember를 사용하여 불필요한 재계산을 방지하는 것을 권장합니다. 예:remember(procedureType) { getProcedureColors(procedureType, colors) }또는 함수를
@Stable로 표시하거나ProcedureColors를@Immutable로 표시하여 Compose 컴파일러가 최적화를 더 잘 수행하도록 할 수 있습니다.♻️ 제안하는 개선사항
옵션 1: ProcedureColors를 @immutable로 표시
+import androidx.compose.runtime.Immutable + +@Immutable data class ProcedureColors( val background: Color, val border: Color, val text: Color, val divider: Color )옵션 2: 호출자에서 remember 사용 (호출하는 Composable 함수 내에서)
@Composable fun SomeComposable(procedureType: ProcedureType) { val colors = CherrishTheme.colors val procedureColors = remember(procedureType, colors) { getProcedureColors(procedureType, colors) } // procedureColors 사용 }Based on learnings from Jetpack Compose best practices on recomposition optimization.
35-47: 로직 검증 및 최적화 고려함수 로직이 정확합니다:
- Normal 모드에서는 모든 시술이 ACTIVE
- Downtime 모드에서는 선택된 시술만 ACTIVE
앞서
getProcedureColors와 마찬가지로, 이 함수를 Composable 내에서 호출할 때는remember를 사용하여 불필요한 재계산을 방지하는 것이 좋습니다.예시:
@Composable fun SomeComposable(displayMode: CalendarDisplayMode, procedureId: Long) { val procedureType = remember(displayMode, procedureId) { getProcedureType(displayMode, procedureId) } // procedureType 사용 }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
app/src/main/java/com/cherrish/android/core/designsystem/theme/Color.ktapp/src/main/java/com/cherrish/android/presentation/calendar/component/DownTimeStatusIndicator.ktapp/src/main/java/com/cherrish/android/presentation/calendar/component/ProcedureScheduleCard.ktapp/src/main/java/com/cherrish/android/presentation/calendar/util/ProcedureUtil.kt
🚧 Files skipped from review as they are similar to previous changes (2)
- app/src/main/java/com/cherrish/android/presentation/calendar/component/ProcedureScheduleCard.kt
- app/src/main/java/com/cherrish/android/presentation/calendar/component/DownTimeStatusIndicator.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/core/designsystem/theme/Color.ktapp/src/main/java/com/cherrish/android/presentation/calendar/util/ProcedureUtil.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 Lint Check
- GitHub Check: PR Build Check
🔇 Additional comments (5)
app/src/main/java/com/cherrish/android/core/designsystem/theme/Color.kt (4)
38-39: LGTM!shadow 색상 정의가 적절합니다.
.copy(alpha = 0.12f)패턴을 사용하여 투명도를 적용하는 것은 Compose에서 권장되는 방식입니다.
96-99: LGTM!
defaultCherrishColors에 shadow 초기화가 올바르게 추가되었습니다. 다른 색상 속성들과 동일한 패턴을 따르고 있습니다.
214-218: LGTM!Preview에 shadow 색상을 추가한 것은 좋은 관행입니다. 개발자가 새 색상을 시각적으로 확인할 수 있어 유용합니다.
66-69:shadow필드 추가가 안전하게 처리됨코드베이스 검토 결과,
CherrishColors데이터 클래스의shadow필드 추가는 안전하게 처리되었습니다. 유일한 직접 인스턴스화인defaultCherrishColors에서 이름 있는 매개변수를 통해shadow = shadow로 올바르게 포함되어 있으며, 다른 수동 인스턴스화는 없습니다. 모든 코드는LocalCherrishColorsProvider를 통해 이 기본 인스턴스를 사용하므로 컴파일 오류는 발생하지 않습니다.app/src/main/java/com/cherrish/android/presentation/calendar/util/ProcedureUtil.kt (1)
8-13: LGTM!시술 관련 색상을 그룹화하는 데이터 클래스가 적절합니다. 불변 속성을 사용하여 Compose의 상태 관리와 잘 맞습니다.
usuuhyn
left a comment
There was a problem hiding this comment.
수고하셨습니다 !! 짱짱 굿~ 👍😻 코멘트 확인 한번만 부탁드립니동~~
| status: DownTimeStatus, | ||
| modifier: Modifier = Modifier | ||
| ) { | ||
| val colors = getDowntimeColors(status, CherrishTheme.colors) |
There was a problem hiding this comment.
P4: 여기는 따로 remember로 캐싱하지 않으신 이유가 있을까용?? 나현님 코드 패턴 상 remember가 자주 쓰였던 것 같아서요 !!
There was a problem hiding this comment.
우하하 마자요.. 넣어두겟습니다 ㅎㅎ
| fun ProcedureInfoItem( | ||
| procedureName: String, | ||
| procedureDay: String, | ||
| downTimeDuration: Int?, |
There was a problem hiding this comment.
P2: 여기는 Int?로 받는데 ProcedureInfoModel은 Int로 고정이네요 !! 통일하지 않아도 상관 없는걸까용?
There was a problem hiding this comment.
예리햇다 !! Model을 바꾸어주어야합니다 ㅎㅎㅎ 최고 최고 고마웡이 !~~~
hyeminililo
left a comment
There was a problem hiding this comment.
코드를 다 읽어봤는데 너무 고생하신게 보이네용 ,,!! 수고하셨습니다 ! !
| modifier: Modifier = Modifier, | ||
| procedureType: ProcedureType = ProcedureType.ACTIVE | ||
| ) { | ||
| val colors = getProcedureColors(procedureType, CherrishTheme.colors) |
There was a problem hiding this comment.
p2: 여기도 위에 수현이가 코멘트 남겨준 것처럼 remember 써주기?!
| ) { | ||
| Text( | ||
| text = procedureDay, | ||
| style = CherrishTheme.typography.body3M12, |
There was a problem hiding this comment.
p1: 여기 날짜 폰트도 body3R12인 것 같아요! 확인 한 번 부탁드립니다!!
(틀렸으면 미리 죄송합니다..ㅎㅎ)
|
|
||
| when (displayMode) { | ||
| is CalendarDisplayMode.Downtime -> DownTimeStatusIndicator() | ||
| is CalendarDisplayMode.Normal -> { } |
There was a problem hiding this comment.
p1: 여기 + 아이콘 들어가야 되는거 아닌가요?!
(이거 추가된 부분이네요!! 확인 부탁드리니다!!)
There was a problem hiding this comment.
기디 추가사항이 바뀌어서 크게 리팩햇어요! 확인 부탁드립니동 ㅎㅎ
| ) | ||
| .clip(shape = RoundedCornerShape(10.dp)) | ||
| .background(color = CherrishTheme.colors.gray0, shape = RoundedCornerShape(10.dp)) | ||
| .padding(vertical = 18.dp, horizontal = 19.dp) |
There was a problem hiding this comment.
p1: 노말일 때, + 아이콘 넣으면서 여기 top 패딩 한 번 체크해주셔야 될 것 같아요!
다운타임일 때는 18.dp인데 노말일떄는 여기 아이콘 헤더 기준으로 16.dp이여서요!
There was a problem hiding this comment.
기디 추가사항이 바뀌어서 크게 리팩햇어요! 확인 부탁드립니동 ㅎㅎ
|
|
||
| Spacer(modifier = Modifier.height(16.dp)) | ||
|
|
||
| Column(verticalArrangement = Arrangement.spacedBy(8.dp)) { |
There was a problem hiding this comment.
p3: 여기 column 없애고 작성해도 되지 않나요??
verticalArrangement = Arrangement.spacedBy(8.dp) 이거 사용하시려고 column을 쓰신 것 같은데 나현님은 이 부분에서 성능보다는 컬럼간의 간격 코드를 제거하기 위해 성능depth를 하나더 가져가는 낫다고 보시나요??
의견이 궁금쓰합니다~!!
There was a problem hiding this comment.
칼럼 간의 간격 코드를 제거하는 것도 그렇고 맨 마지막 아이템과 카드 사이에는 8.dp의 패딩이 없어요. 그렇게 되면 if (!마지막 아이템) { 패딩 } 이런식으로 구현해야하는데 그렇게 되면 가독성도 떨어지고 여기에도 성능이 들어가는거라 각 아이템마다 조건 체크 → 실제로 더 많은 연산을 진행하게 됩니다!
| Spacer(modifier = Modifier.height(16.dp)) | ||
|
|
||
| Column(verticalArrangement = Arrangement.spacedBy(8.dp)) { | ||
| procedureInfo.forEach { procedure -> |
There was a problem hiding this comment.
LazyColumn으로 바뀌엇다능 ㅎㅎㅎㅎㅎㅎ
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/component/ProcedureScheduleCard.kt:
- Around line 52-58: The derived state in isLastItemVisible doesn't handle an
empty procedureInfo, so lastItemIndex becomes -1 and the comparison yields false
but still triggers the gradient; update the logic inside the derivedStateOf used
by isLastItemVisible to first check that procedureInfo.isNotEmpty() (or
lastItemIndex >= 0) and only then compute lastVisibleItem?.index ==
lastItemIndex, using listState/layoutInfo visibleItemsInfo as before; ensure the
final boolean is false for empty procedureInfo so the overlay won't show.
🧹 Nitpick comments (4)
app/src/main/java/com/cherrish/android/presentation/calendar/component/ProcedureScheduleCard.kt (4)
22-22: 사용되지 않는 import 제거 권장
setValue가 이 파일에서 사용되지 않습니다. 해당 import를 제거하는 것이 좋습니다.♻️ 수정 제안
-import androidx.compose.runtime.setValue
107-122: 매직 넘버를 상수로 추출 권장
146.dp가 하드코딩되어 있어 의도를 파악하기 어렵습니다. 명명된 상수로 추출하거나 의미를 설명하는 주석을 추가하면 유지보수성이 향상됩니다.
140-144: 문자열 리소스 사용 권장하드코딩된 문자열
"일정"대신strings.xml리소스를 사용하면 다국어 지원(i18n) 및 유지보수가 용이해집니다.
149-154: 접근성을 위한 contentDescription 추가 권장
contentDescription = null은 스크린 리더 사용자에게 버튼의 기능을 전달하지 못합니다. "시술 추가" 등의 설명을 추가하면 접근성이 향상됩니다.♻️ 수정 제안
Icon( imageVector = ImageVector.vectorResource(id = R.drawable.ic_plus), - contentDescription = null, + contentDescription = "시술 추가", // strings.xml 리소스 사용 권장 tint = CherrishTheme.colors.gray600, modifier = Modifier.noRippleClickable(onClick = onClick) )
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
app/src/main/java/com/cherrish/android/presentation/calendar/component/ProcedureInfoItem.ktapp/src/main/java/com/cherrish/android/presentation/calendar/component/ProcedureScheduleCard.ktapp/src/main/java/com/cherrish/android/presentation/calendar/model/ProcedureInfoModel.kt
🚧 Files skipped from review as they are similar to previous changes (1)
- app/src/main/java/com/cherrish/android/presentation/calendar/component/ProcedureInfoItem.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/model/ProcedureInfoModel.ktapp/src/main/java/com/cherrish/android/presentation/calendar/component/ProcedureScheduleCard.kt
🧬 Code graph analysis (1)
app/src/main/java/com/cherrish/android/presentation/calendar/component/ProcedureScheduleCard.kt (4)
app/src/main/java/com/cherrish/android/presentation/calendar/component/ProcedureInfoItem.kt (1)
ProcedureInfoItem(29-69)app/src/main/java/com/cherrish/android/presentation/calendar/util/ProcedureUtil.kt (1)
getProcedureType(35-47)app/src/main/java/com/cherrish/android/presentation/calendar/component/DownTimeStatusIndicator.kt (1)
DownTimeStatusIndicator(22-37)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 (3)
app/src/main/java/com/cherrish/android/presentation/calendar/model/ProcedureInfoModel.kt (1)
5-11: LGTM!
@Immutable어노테이션과 함께 모든 프로퍼티가val로 선언되어 Compose의 안정성 계약을 올바르게 준수하고 있습니다. 불필요한 recomposition을 방지하는 좋은 구조입니다.app/src/main/java/com/cherrish/android/presentation/calendar/component/ProcedureScheduleCard.kt (2)
42-104: 전반적인 Compose 구조가 우수합니다.
ImmutableList사용으로 리스트 안정성 확보rememberLazyListState와derivedStateOf의 적절한 조합key = { it.procedureId }를 통한 안정적인 아이템 키 사용- Recomposition 최적화를 위한 구조가 잘 적용되어 있습니다.
160-299: Preview 함수 구현 적절합니다.Normal 모드와 Downtime 모드 모두에 대한 Preview가 제공되어 있어 다양한 상황에서의 UI 확인이 가능합니다.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In
@app/src/main/java/com/cherrish/android/presentation/calendar/component/ProcedureScheduleCard.kt:
- Around line 174-179: The Icon inside ProcedureScheduleCard is clickable but
its contentDescription is null; update the Icon (the call to Icon with
ImageVector.vectorResource(id = R.drawable.ic_plus) and modifier =
Modifier.noRippleClickable(onClick = onClick)) to provide a meaningful
contentDescription (e.g., a localized string resource like "Add procedure" or
context-specific text) instead of null so screen readers announce its purpose;
use stringResource(...) to fetch the text and keep the description concise and
actionable.
- Around line 50-63: The isLastItemVisible remember block must include
procedureInfo as a key and guard against empty lists: change the remember for
isLastItemVisible to depend on procedureInfo (so it recomputes when the list
changes) and inside derivedStateOf return false immediately if procedureInfo is
empty (or compute lastItemIndex via procedureInfo.lastIndex and check
lastItemIndex >= 0) before comparing visibleItemsInfo.lastOrNull()?.index to the
last item index; this prevents stale size values and avoids treating -1 as a
valid index.
🧹 Nitpick comments (2)
app/src/main/java/com/cherrish/android/presentation/calendar/component/ProcedureScheduleCard.kt (2)
111-129: 빈 리스트일 때 그라데이션 오버레이가 잘못 표시될 수 있습니다.
procedureInfo가 비어있을 경우visibleItemsInfo도 비어있어isFirstItemVisible과isLastItemVisible모두false가 되어 불필요한 그라데이션이 표시됩니다. 빈 상태 처리 조건을 추가하는 것이 좋습니다.♻️ 수정 제안
- if (!isFirstItemVisible.value) { + if (procedureInfo.isNotEmpty() && !isFirstItemVisible.value) { Box( // ... ) } - if (!isLastItemVisible.value) { + if (procedureInfo.isNotEmpty() && !isLastItemVisible.value) { Box( // ... ) }
165-169: 하드코딩된 문자열을 string resource로 분리하는 것을 권장합니다.
"일정"문자열이 직접 코드에 작성되어 있습니다. 유지보수성과 향후 다국어 지원을 위해strings.xml에 정의하고stringResource()를 사용하는 것이 좋습니다.
📜 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/component/ProcedureScheduleCard.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/component/ProcedureScheduleCard.kt
🧬 Code graph analysis (1)
app/src/main/java/com/cherrish/android/presentation/calendar/component/ProcedureScheduleCard.kt (4)
app/src/main/java/com/cherrish/android/presentation/calendar/component/ProcedureInfoItem.kt (1)
ProcedureInfoItem(29-69)app/src/main/java/com/cherrish/android/presentation/calendar/util/ProcedureUtil.kt (1)
getProcedureType(35-47)app/src/main/java/com/cherrish/android/presentation/calendar/component/DownTimeStatusIndicator.kt (1)
DownTimeStatusIndicator(22-37)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 (1)
app/src/main/java/com/cherrish/android/presentation/calendar/component/ProcedureScheduleCard.kt (1)
92-108: LazyColumn 구현이 적절합니다.
ImmutableList사용과key = { it.procedureId }지정으로 리스트 안정성과 recomposition 최적화가 잘 적용되었습니다.
sohee6989
left a comment
There was a problem hiding this comment.
수고하셨습니다!!
저 ProcedureScheduleCard 부분 블러 처리 너무 수고하신 것 같네요~!!
색상값들이 다른게 있어서 확인 부탁드립니다~~!!
| ) | ||
| ProcedureType.INACTIVE -> ProcedureColors( | ||
| background = colors.gray100, | ||
| border = colors.gray400, |
There was a problem hiding this comment.
p1: inactive일 때 border가 없어요!
확인 부탁드립니다!
| background = colors.gray100, | ||
| border = colors.gray400, | ||
| text = colors.gray500, | ||
| divider = colors.gray500 |
There was a problem hiding this comment.
p1: divider 색상 gray400인 것 같아요!
확인 부탁드립니다!
There was a problem hiding this comment.
디쌤이 300이래요 ㅠㅠㅠ 반영해서 수정햇숩니다 ㅎㅎㅎㅎㅎ !!
| ProcedureType.ACTIVE -> ProcedureColors( | ||
| background = colors.gray0, | ||
| border = colors.gray500, | ||
| text = colors.gray800, |
There was a problem hiding this comment.
p1: gray900인 것 같습니다!
확인 부탁드립니다!
| colors: CherrishColors | ||
| ): ProcedureColors { | ||
| return when (procedureType) { | ||
| ProcedureType.ACTIVE -> ProcedureColors( |
There was a problem hiding this comment.
P1: 여기 지금 ACTIVE일 때 시술명은 gray900, 날짜는 gray800이여서 이것도 분기 넣어줘야 될 것 같습니다!
| Row( | ||
| modifier = modifier | ||
| .fillMaxWidth() | ||
| .height(40.dp), |
There was a problem hiding this comment.
p1: 여기 구두로 나눈 부분!
고정값 포기합시다...ㅋㅋㅋㅋ
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
app/src/main/java/com/cherrish/android/presentation/calendar/component/ProcedureInfoItem.kt (1)
138-144: Preview 데이터 일관성 검토 필요.
ACTIVE_NO_DOWNTIME타입에downTimeDuration = 5가 설정되어 있습니다.getProcedureType로직에 따르면ACTIVE_NO_DOWNTIME은downTimeDuration이null일 때만 반환됩니다. Preview가 실제 사용 사례와 일치하도록 수정하는 것이 좋습니다.♻️ 제안하는 수정
ProcedureInfoItem( procedureType = ProcedureType.ACTIVE_NO_DOWNTIME, procedureName = "레이저토닝", procedureDay = "1월 7일 수요일", - downTimeDuration = 5, + downTimeDuration = null, onClick = {} )app/src/main/java/com/cherrish/android/presentation/calendar/util/ProcedureUtil.kt (1)
47-66:Normal모드에서procedureId파라미터가 미사용입니다.
Normal모드 분기(52-57줄)에서procedureId파라미터가 사용되지 않고 있습니다.Downtime모드(60줄)에서는 필요하지만,Normal모드에서 불필요한 파라미터를 받는 것은 혼란을 줄 수 있습니다. 함수 시그니처를 정리하거나 의도를 주석으로 명시하는 것을 고려해 주세요.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
app/src/main/java/com/cherrish/android/presentation/calendar/component/ProcedureInfoItem.ktapp/src/main/java/com/cherrish/android/presentation/calendar/component/ProcedureScheduleCard.ktapp/src/main/java/com/cherrish/android/presentation/calendar/model/ProcedureType.ktapp/src/main/java/com/cherrish/android/presentation/calendar/util/ProcedureUtil.kt
🚧 Files skipped from review as they are similar to previous changes (2)
- app/src/main/java/com/cherrish/android/presentation/calendar/model/ProcedureType.kt
- app/src/main/java/com/cherrish/android/presentation/calendar/component/ProcedureScheduleCard.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/component/ProcedureInfoItem.ktapp/src/main/java/com/cherrish/android/presentation/calendar/util/ProcedureUtil.kt
🧬 Code graph analysis (1)
app/src/main/java/com/cherrish/android/presentation/calendar/component/ProcedureInfoItem.kt (2)
app/src/main/java/com/cherrish/android/presentation/calendar/util/ProcedureUtil.kt (1)
getProcedureColors(18-45)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 Lint Check
- GitHub Check: PR Build Check
🔇 Additional comments (5)
app/src/main/java/com/cherrish/android/presentation/calendar/util/ProcedureUtil.kt (2)
9-16: LGTM!
@Immutable어노테이션이 적절하게 적용되어 Compose 안정성 추론에 도움이 됩니다. 데이터 클래스 구조도 깔끔합니다.
18-45: LGTM!
when표현식이 모든ProcedureTypeenum 케이스를 exhaustive하게 처리하고 있으며, 색상 매핑 로직이 명확합니다.app/src/main/java/com/cherrish/android/presentation/calendar/component/ProcedureInfoItem.kt (3)
29-69: LGTM!
remember를 사용한 색상 캐싱이 적절하고, 컴포넌트 구조가 잘 분리되어 있습니다.procedureType과themeColors를 key로 사용하여 불필요한 recomposition을 방지하고 있습니다.
71-96: LGTM!
IntrinsicSize.Max를 사용하여VerticalDivider가 텍스트 높이에 맞게 조정되도록 처리한 부분이 좋습니다.
98-120: LGTM!다운타임 표시 로직(
downTimeDuration?.let { "다운타임 ${it}일" } ?: "-")이 null 처리를 적절하게 하고 있습니다.
|
수고하셨습니다람쥐 ~~~~ |
Related issue 🛠
Work Description ✏️
Screenshot 📸
Uncompleted Tasks 😅
To Reviewers 📢
캘린더 탭의 컴포넌트들 다 만들었어요! 다운 타임 컴포넌트 관련 색상이 필요해서 #15 불가피하게 캘린더 컴포넌트 브랜치 떙겨와서 작업했습니다! 캘린더 컴포넌트 머지된 후 드래프트 풀게요 ~~
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.