Conversation
- 초기단계일 때도 애니메이션 동작되도록 수정 - 뒤로 가는 애니메이션 추가
- ProcedureUiState lazyColumnBottomPadding 계산 로직 추가 - FilteringContent, FilteringWithSearchContent에 bottomPadding 파라미터 전달 - 바텀시트 표시 시 컨텐츠가 가려지지 않도록 동적 패딩 적용 - 화면 높이 기반으로 바텀시트 최대 높이(30%) 계산
|
Caution Review failedAn error occurred during the review process. Please try again later. Walkthrough달력 화면에 시술(Procedure) 플로우를 새로 추가하고, 라우트·스크린·뷰모델·UiState·도메인 모델·컴포넌트들을 도입·재배치했으며, 달력 쪽에는 사이드이펙트 기반 네비게이션(onNavigateToProcedure)과 NavController 확장(navigateToProcedure)을 연결했습니다. Changes
Sequence Diagram(s)sequenceDiagram
participant User as User
participant Calendar as CalendarRoute
participant VM_Cal as CalendarViewModel
participant Nav as NavController
participant Procedure as ProcedureRoute
participant VM_Proc as ProcedureViewModel
participant Sheet as DowntimeBottomSheet
User->>Calendar: 시술 추가 버튼 클릭
Calendar->>VM_Cal: onAddButtonClick()
VM_Cal-->>Calendar: emit CalendarSideEffect.NavigateToProcedure
Calendar->>Nav: navigateToProcedure()
Nav->>Procedure: compose ProcedureRoute
Procedure->>VM_Proc: collect uiState
VM_Proc-->>Procedure: uiState emit
User->>Procedure: 단계별 입력/선택
Procedure->>VM_Proc: onExistenceClick/onProcedureCardClick/onYearChange...
VM_Proc-->>Procedure: 업데이트된 uiState
Procedure->>Sheet: show DowntimeBottomSheet (필요 시)
User->>Sheet: downtime 선택 및 확인
Sheet->>VM_Proc: onDowntimeConfirm()
VM_Proc-->>Procedure: 업데이트된 uiState
User->>Procedure: 완료 -> onComplete -> navigateUp
Procedure->>Nav: popBackStack()
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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/procedure/ProcedureScreen.kt`:
- Around line 216-223: FilteringWithSearchContent의 onSearchAction이 TODO로 남아 있어
검색 버튼(액션)이 동작하지 않습니다; ProcedureScreen에서 해당 콜백을 ViewModel의 검색 핸들러로 연결하고
ViewModel에 검색 처리 로직을 구현하세요. 구체적으로는 ProcedureScreen의 FilteringWithSearchContent
호출에서 onSearchAction = viewModel::onSearchAction(또는 viewModel.searchProcedures)로
바꾸고, ViewModel에 onSearchAction(query: String) 또는 searchProcedures() 메서드를 추가해
uiState.query를 업데이트하고 procedureItems를 필터링 또는 검색 API 호출로 갱신하도록 상태 업데이트 로직을 구현하세요;
필요한 경우 선택된 카드(uiState.selectedProcedureCardIds)나 페이징/빈 상태 처리도 함께 업데이트하도록 하세요.
♻️ Duplicate comments (2)
app/src/main/java/com/cherrish/android/presentation/calendar/procedure/ProcedureScreen.kt (2)
54-57: Loading/Failure에서 사용자 피드백이 비어 있습니다.
Line 55-56에서Unit만 반환되어 로딩/실패 상태가 빈 화면으로 보입니다.
181-186: 외부modifier전달로 하위 레이아웃이 예기치 않게 영향받을 수 있습니다.
Line 185에서 외부modifier를 그대로 전달해 다른 콘텐츠와 일관성이 깨집니다. 내부용Modifier로 고정하는 편이 안전합니다.🛠️ 수정 제안
- modifier = modifier.padding(horizontal = 26.dp) + modifier = Modifier.padding(horizontal = 26.dp)
| FilteringWithSearchContent( | ||
| cardItems = uiState.procedureItems, | ||
| selectedCardIds = uiState.selectedProcedureCardIds, | ||
| onCardClick = onProcedureCardClick, | ||
| onSearchAction = { /* TODO */ }, | ||
| query = query, | ||
| onQueryChange = { query = it }, | ||
| bottomPadding = uiState.lazyColumnBottomPadding, |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
find . -type f -name "ProcedureScreen.kt" | head -20Repository: TEAM-Cherrish/Cherrish-Android
Length of output: 165
🏁 Script executed:
find . -type f -name "ProcedureViewModel.kt" | head -20Repository: TEAM-Cherrish/Cherrish-Android
Length of output: 168
🏁 Script executed:
find . -type f -name "ProcedureRoute.kt" | head -20Repository: TEAM-Cherrish/Cherrish-Android
Length of output: 56
🏁 Script executed:
cat -n ./app/src/main/java/com/cherrish/android/presentation/calendar/procedure/ProcedureScreen.kt | sed -n '210,230p'Repository: TEAM-Cherrish/Cherrish-Android
Length of output: 1299
🏁 Script executed:
grep -n "fun ProcedureRoute\|fun ProcedureScreen" ./app/src/main/java/com/cherrish/android/presentation/calendar/procedure/ProcedureScreen.kt | head -20Repository: TEAM-Cherrish/Cherrish-Android
Length of output: 120
🏁 Script executed:
grep -n "onSearchAction" ./app/src/main/java/com/cherrish/android/presentation/calendar/procedure/ProcedureScreen.ktRepository: TEAM-Cherrish/Cherrish-Android
Length of output: 142
🏁 Script executed:
grep -n "onSearchAction\|fun on" ./app/src/main/java/com/cherrish/android/presentation/calendar/procedure/ProcedureViewModel.kt | head -30Repository: TEAM-Cherrish/Cherrish-Android
Length of output: 676
🏁 Script executed:
cat -n ./app/src/main/java/com/cherrish/android/presentation/calendar/procedure/ProcedureScreen.kt | sed -n '42,95p'Repository: TEAM-Cherrish/Cherrish-Android
Length of output: 2552
🏁 Script executed:
cat -n ./app/src/main/java/com/cherrish/android/presentation/calendar/procedure/ProcedureScreen.kt | sed -n '97,120p'Repository: TEAM-Cherrish/Cherrish-Android
Length of output: 1166
🏁 Script executed:
wc -l ./app/src/main/java/com/cherrish/android/presentation/calendar/procedure/ProcedureViewModel.ktRepository: TEAM-Cherrish/Cherrish-Android
Length of output: 172
🏁 Script executed:
cat -n ./app/src/main/java/com/cherrish/android/presentation/calendar/procedure/ProcedureViewModel.kt | head -200Repository: TEAM-Cherrish/Cherrish-Android
Length of output: 8392
🏁 Script executed:
grep -n "onSearchAction\|fun on" ./app/src/main/java/com/cherrish/android/presentation/calendar/procedure/ProcedureViewModel.ktRepository: TEAM-Cherrish/Cherrish-Android
Length of output: 676
🏁 Script executed:
cat -n ./app/src/main/java/com/cherrish/android/presentation/calendar/procedure/ProcedureViewModel.kt | tail -150Repository: TEAM-Cherrish/Cherrish-Android
Length of output: 6158
검색 액션이 구현되지 않았습니다.
Line 220의 TODO로 인해 검색 기능이 동작하지 않습니다. ViewModel 핸들러를 연결하고 구현이 필요합니다.
🛠️ 수정 제안(ProcedureScreen/Route 연동)
@@
fun ProcedureRoute(
@@
onComplete: () -> Unit,
viewModel: ProcedureViewModel = hiltViewModel()
) {
@@
ProcedureScreen(
uiState = state.data,
onExistenceClick = viewModel::onExistenceClick,
onWorryClick = viewModel::onWorryClick,
onRecoveryOptionClick = viewModel::onRecoveryOptionClick,
onYearChange = viewModel::onYearChange,
onMonthChange = viewModel::onMonthChange,
onDayChange = viewModel::onDayChange,
onProcedureCardClick = viewModel::onProcedureCardClick,
+ onSearchAction = viewModel::onSearchAction,
onDowntimeClick = viewModel::onDowntimeClick,
@@
`@Composable`
fun ProcedureScreen(
uiState: ProcedureUiState,
onExistenceClick: (Int) -> Unit,
onWorryClick: (Long) -> Unit,
onRecoveryOptionClick: (Int) -> Unit,
onYearChange: (String) -> Unit,
onMonthChange: (String) -> Unit,
onDayChange: (String) -> Unit,
onProcedureCardClick: (Long) -> Unit,
+ onSearchAction: (String) -> Unit,
onDowntimeClick: (Long) -> Unit,
@@
ProcedureStep.FilteringWithSearch -> {
FilteringWithSearchContent(
cardItems = uiState.procedureItems,
selectedCardIds = uiState.selectedProcedureCardIds,
onCardClick = onProcedureCardClick,
- onSearchAction = { /* TODO */ },
+ onSearchAction = onSearchAction,
query = query,
onQueryChange = { query = it },
bottomPadding = uiState.lazyColumnBottomPadding,
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 24.dp)
)
}ViewModel에서 onSearchAction 함수를 구현하고 상태 업데이트 로직을 추가해야 합니다.
🤖 Prompt for AI Agents
In
`@app/src/main/java/com/cherrish/android/presentation/calendar/procedure/ProcedureScreen.kt`
around lines 216 - 223, FilteringWithSearchContent의 onSearchAction이 TODO로 남아 있어
검색 버튼(액션)이 동작하지 않습니다; ProcedureScreen에서 해당 콜백을 ViewModel의 검색 핸들러로 연결하고
ViewModel에 검색 처리 로직을 구현하세요. 구체적으로는 ProcedureScreen의 FilteringWithSearchContent
호출에서 onSearchAction = viewModel::onSearchAction(또는 viewModel.searchProcedures)로
바꾸고, ViewModel에 onSearchAction(query: String) 또는 searchProcedures() 메서드를 추가해
uiState.query를 업데이트하고 procedureItems를 필터링 또는 검색 API 호출로 갱신하도록 상태 업데이트 로직을 구현하세요;
필요한 경우 선택된 카드(uiState.selectedProcedureCardIds)나 페이징/빈 상태 처리도 함께 업데이트하도록 하세요.
| modifier = Modifier.padding(horizontal = 26.dp) | ||
| ) | ||
| } | ||
|
|
There was a problem hiding this comment.
넵넵!
근데 (단순 궁금) 혹시 밑에는 안 띄우셨는데 여기만 띄우신 이유가 있으실까요?!!
| if (uiState.showStepProgressBar) { | ||
| StepProgressBar( | ||
| totalStep = uiState.totalSteps, | ||
| currentStep = uiState.currentStepIndex, | ||
| modifier = Modifier | ||
| .fillMaxWidth() | ||
| .padding(horizontal = 26.dp) |
There was a problem hiding this comment.
p1: 이거 프로그레스 바가 없을때 처리 해주셔야 될 것 같아요!
있을 떄 없을 때의 위치 차이가 발생하고 있어요!
There was a problem hiding this comment.
패딩값 같은거 확인햇어요 꺄르르 우우 붐따
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Fix all issues with AI agents
In
`@app/src/main/java/com/cherrish/android/presentation/calendar/navigation/CalendarNavigator.kt`:
- Around line 1-10: CalendarNavigator.kt is missing its package declaration; add
the package line "package com.cherrish.android.presentation.calendar.navigation"
at the top of CalendarNavigator.kt and then update any imports in
MainAppState.kt and MainScreen.kt to reference symbols from that package (e.g.,
import com.cherrish.android.presentation.calendar.navigation.CalendarNavigator
or the specific composable/route symbols you use) so the compiler can resolve
the functions and routes correctly.
- Around line 12-15: Calendar data object is missing the `@Serializable`
annotation which breaks type-safe navigation used by composable<T>; add
`@Serializable` to the Calendar declaration so it matches Procedure (i.e.,
annotate the data object Calendar : MainTabRoute with `@Serializable`) to ensure
both Calendar and Procedure are serializable for composable<T>-based navigation.
In `@app/src/main/java/com/cherrish/android/presentation/main/MainAppState.kt`:
- Around line 20-21: MainAppState imports fail because CalendarNavigator.kt is
missing its package declaration; open CalendarNavigator.kt and add the package
line for com.cherrish.android.presentation.calendar.navigation at the top so the
symbols navigateToCalendar and navigateToProcedure are declared in that package
and MainAppState can import them as
com.cherrish.android.presentation.calendar.navigation.navigateToCalendar and
com.cherrish.android.presentation.calendar.navigation.navigateToProcedure.
There was a problem hiding this comment.
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/calendar/procedure/component/DowntimeBottomSheet.kt (1)
489-489: Preview 데이터에 오타가 있습니다.
downtimeEndDay의 값이"2023.08.1"로 되어 있는데,"2023.08.11"또는 일관된 형식이어야 할 것 같습니다.
🤖 Fix all issues with AI agents
In
`@app/src/main/java/com/cherrish/android/presentation/calendar/procedure/component/DowntimeBottomSheet.kt`:
- Around line 84-88: The DowntimeBottomSheet currently sets
downtimeGuideBubbleText to "" for DowntimeValidationType.INVALID which causes
DowntimeGuideBubble to render an empty bubble; update the logic so that when
validationType == DowntimeValidationType.INVALID (or
downtimeGuideBubbleText.isBlank()) you do not render DowntimeGuideBubble at all.
Locate the downtimeGuideBubbleText assignment and the place where
DowntimeGuideBubble is composed/used and change it to conditionally render the
DowntimeGuideBubble only when the text is non-blank (e.g., check validationType
!= DowntimeValidationType.INVALID or downtimeGuideBubbleText.isNotBlank()) so
the bubble is hidden instead of showing an empty frame.
🧹 Nitpick comments (1)
app/src/main/java/com/cherrish/android/presentation/calendar/procedure/component/DowntimeBottomSheet.kt (1)
377-381:NumberPicker가 public으로 선언되어 있습니다.다른 헬퍼 Composable들은
private으로 선언되어 있는데,NumberPicker만 public입니다. 외부에서 재사용할 계획이 아니라면private으로 변경하여 일관성을 유지하는 것이 좋습니다.♻️ 제안
`@Composable` -fun NumberPicker( +private fun NumberPicker( list: ImmutableList<Int>, state: LazyListState, flingBehavior: FlingBehavior, modifier: Modifier = Modifier ) {
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/CalendarScreen.kt`:
- Around line 31-35: The UI directly calls onNavigateToProcedure on button
clicks instead of routing the event through the ViewModel side-effect pipeline;
update the click handler to call viewModel.onAddButtonClick() so the ViewModel
emits CalendarSideEffect.NavigateToProcedure which is handled by
viewModel.sideEffect.collectLatestSideEffect { ... } that triggers
onNavigateToProcedure(), ensuring the side-effect flow using
CalendarSideEffect.NavigateToProcedure and the ViewModel method
onAddButtonClick() is used consistently.
In
`@app/src/main/java/com/cherrish/android/presentation/calendar/CalendarViewModel.kt`:
- Around line 243-249: The onAddButtonClick function is currently nested inside
loadDowntimeDetail which prevents it from being a callable public member of
CalendarViewModel; move the entire onAddButtonClick declaration out of the
loadDowntimeDetail block to the CalendarViewModel class scope (same level as
other public functions), keep its implementation using viewModelScope.launch and
_sideEffect.emit(CalendarSideEffect.NavigateToProcedure), and ensure its
visibility remains public so CalendarScreen can call
viewModel::onAddButtonClick.
♻️ Duplicate comments (2)
app/src/main/java/com/cherrish/android/presentation/calendar/procedure/ProcedureScreen.kt (2)
55-57: Loading 및 Failure 상태 처리가 필요합니다.
UiState.Loading과UiState.Failure에서 빈 처리(Unit)로 인해 사용자에게 피드백이 없습니다. 로딩 인디케이터나 에러 UI 표시를 추가해 주세요.
221-221: 검색 액션이 구현되지 않았습니다.
onSearchAction이 TODO로 남아 있어 검색 기능이 동작하지 않습니다. ViewModel 핸들러 연결이 필요합니다.
🧹 Nitpick comments (4)
app/src/main/java/com/cherrish/android/presentation/calendar/procedure/ProcedureUiState.kt (2)
221-232:DateTimeFormatter인스턴스가 매 접근마다 생성됩니다.
downtimeStartDay와downtimeEndDay가 접근될 때마다DateTimeFormatter.ofPattern("yyyy.MM.dd")가 새로 생성됩니다. Compose recomposition 중 반복 호출 시 불필요한 객체 생성이 발생합니다.♻️ 수정 제안
companion object에 formatter를 캐싱하세요:
companion object { + private val DATE_FORMATTER = DateTimeFormatter.ofPattern("yyyy.MM.dd") + val FakeNormal = ProcedureUiState(그리고 프로퍼티에서 재사용:
val downtimeStartDay: String get() { - val formatter = DateTimeFormatter.ofPattern("yyyy.MM.dd") - return LocalDate.now().format(formatter) + return LocalDate.now().format(DATE_FORMATTER) } val downtimeEndDay: String get() { val target = targetDate ?: return "" - val formatter = DateTimeFormatter.ofPattern("yyyy.MM.dd") - return target.format(formatter) + return target.format(DATE_FORMATTER) }
177-188:selectedProcedures가 매 접근마다 재계산됩니다.
get()패턴으로 인해 Composable 내에서 여러 번 접근 시filter,map,toImmutableList연산이 반복 수행될 수 있습니다. 현재 리스트 크기가 작아 영향은 미미하지만, 확장성을 고려하면 주의가 필요합니다.향후 리스트가 커지면
val초기화 또는 ViewModel에서 미리 계산하여 전달하는 방식을 고려해 주세요.app/src/main/java/com/cherrish/android/presentation/calendar/procedure/ProcedureScreen.kt (1)
129-134: 스크롤 중 과도한 상태 업데이트가 발생할 수 있습니다.
firstVisibleItemIndex가 변경될 때마다LaunchedEffect가 트리거되어 스크롤 중 매 프레임마다onDowntimePickerValueChange가 호출될 수 있습니다. 이는 불필요한 recomposition을 유발할 수 있습니다.♻️ 수정 제안
snapshotFlow를 사용하여 스크롤 완료 후 업데이트하도록 변경:- LaunchedEffect(downtimePickerState.firstVisibleItemIndex) { - if (uiState.showDowntimeBottomSheet) { - val newValue = downtimePickerState.firstVisibleItemIndex + 1 - onDowntimePickerValueChange(newValue) - } - } + LaunchedEffect(uiState.showDowntimeBottomSheet) { + if (uiState.showDowntimeBottomSheet) { + snapshotFlow { downtimePickerState.firstVisibleItemIndex } + .collect { index -> + onDowntimePickerValueChange(index + 1) + } + } + }추가로
import androidx.compose.runtime.snapshotFlow필요.app/src/main/java/com/cherrish/android/presentation/calendar/CalendarViewModel.kt (1)
36-37:asSharedFlow()를 사용하면 더 안전합니다.
uiState에서asStateFlow()를 사용한 것처럼 일관성을 위해asSharedFlow()를 사용하는 것을 권장합니다. 외부에서 실수로 emit하는 것을 방지할 수 있습니다.♻️ 제안하는 수정사항
private val _sideEffect = MutableSharedFlow<CalendarSideEffect>() - val sideEffect: SharedFlow<CalendarSideEffect> = _sideEffect + val sideEffect: SharedFlow<CalendarSideEffect> = _sideEffect.asSharedFlow()
asSharedFlowimport 추가:+import kotlinx.coroutines.flow.asSharedFlow
| fun onAddButtonClick() { | ||
| viewModelScope.launch { | ||
| _sideEffect.emit(CalendarSideEffect.NavigateToProcedure) | ||
| } | ||
| } |
There was a problem hiding this comment.
P1 : 허거덩 ㅇㅒ 지금 loadMonthlyCalendar에 잘못 들어가잇다 !! 요거 밖으로 뺴야할거가틍요 ㅜㅜ !!!!
| onCloseClick: () -> Unit, | ||
| modifier: Modifier = Modifier | ||
| ) { | ||
| var query by remember { mutableStateOf("") } |
There was a problem hiding this comment.
P2 : 요거 query를 상위로 호이스팅 해주느건 어떄요 !?! 아마 시술 검색 텍스트 필드에서 사용하는 것 같은데 query와 onQueryChange를 상태 호이스팅 해주는 것도 좋은거 같아요 ~~
|
소히 언니 구두 어푸 받앗습니당~~~~ 어푸어푸 💦🌊 |
…-view # Conflicts: # app/src/main/java/com/cherrish/android/presentation/main/MainActivity.kt


Related issue 🛠
Work Description ✏️
Screenshot 📸
Uncompleted Tasks 😅
N/A
To Reviewers 📢
드디어 완성햇어요
Summary by CodeRabbit
새 기능
UI 개선
기타
✏️ Tip: You can customize this high-level summary in your review settings.