[FEAT/#35] 루틴 챌린지 및 Todo 미션 컴포넌트 구현 #72
Conversation
- ChallengeMissionCardChip LazyColumn으로 수정
- ktLint 실행 - isSelected = true인 상태에서 한 번 더 눌렀을 떄 원래로 바뀌도록 구현
Walkthrough루틴·미션 선택용 불변 모델과 UI 상태를 추가하고, 두 개의 신규 Composable(ChallengeRoutineOnboardingBody, ChallengeMissionOnboardingBody)을 도입했습니다. 기존 Changes
Sequence Diagram(s)sequenceDiagram
participant User as User
participant RoutineBody as ChallengeRoutineOnboardingBody
participant MissionBody as ChallengeMissionOnboardingBody
participant Callback as onItemClick
participant State as UIState
User->>RoutineBody: 루틴 칩 클릭
RoutineBody->>Callback: onItemClick(itemId)
Callback->>State: 선택 상태 업데이트
State->>RoutineBody: recomposition (updated items)
RoutineBody->>User: 렌더링 갱신
User->>MissionBody: 미션 항목 클릭
MissionBody->>Callback: onItemClick(itemId)
Callback->>State: 선택 상태 업데이트
State->>MissionBody: recomposition (updated items)
MissionBody->>User: 렌더링 갱신
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 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 |
|
|
||
| @Composable | ||
| fun ChallengeMissionOnboardingBody( | ||
| items: List<ChallengeMissionUiState>, |
There was a problem hiding this comment.
추가로 여기에 바로 uiState를 넘겨주기보다는 스크린 상위에서 한번만 uiState를 넘겨주는 방향이 더 맞을 것 같아요 이 컴포넌트 필요한 값만 내려주는 형태가 사용하지 않는 uiState의 정보들을 가지고 있을 필요가 없기 때문에 더 적합할 것 같습니다 !
There was a problem hiding this comment.
넵 두 리뷰 다 수정해서 리팩토링 진행하겠습니다 !
| verticalArrangement = Arrangement.spacedBy(space = 8.dp), | ||
| modifier = Modifier.fillMaxWidth() | ||
| ) { | ||
| itemsIndexed(items = items) { index, item -> |
There was a problem hiding this comment.
넵 반영해서 수정하겠습니다 !
|
|
||
| @Composable | ||
| fun ChallengeRoutineOnboardingBody( | ||
| items: List<ChallengeRoutineUiState>, |
There was a problem hiding this comment.
여기도 uiState 전체 보다는 필요한 정보들만 받을 수 잇도록 수정해주세요 ~~
| @@ -0,0 +1,6 @@ | |||
| package com.cherrish.android.presentation.challenge.routine.model | |||
|
|
|||
There was a problem hiding this comment.
아니 점점 줄임말로 말해주시네요 감사합니다아 ~ 😙
| @Immutable | ||
| data class ChallengeRoutineUiState( | ||
| val routine: String = "", | ||
|
|
| @@ -0,0 +1,6 @@ | |||
| package com.cherrish.android.presentation.challenge.mission.model | |||
|
|
|||
| ) | ||
|
|
||
| data class ChallengeMissionScreenUiState( | ||
| val missions: List<ChallengeMissionUiState> |
| val isSelected: Boolean = false | ||
| ) | ||
|
|
||
| data class ChallengeMissionScreenUiState( |
|
|
||
| import com.cherrish.android.presentation.challenge.mission.model.ChallengeMissionModel | ||
|
|
||
| data class ChallengeMissionUiState( |
There was a problem hiding this comment.
이 부분도 수정하겠습니다아 ~~
nhyeonii
left a comment
There was a problem hiding this comment.
수고하셨습ㄴㅣ다 ~~ 리뷰 확인 후 반영 부탁드릴게요!
|
|
||
| @Composable | ||
| fun ChallengeMissionOnboardingBody( | ||
| items: List<ChallengeMissionUiState>, |
There was a problem hiding this comment.
추가로 여기에 바로 uiState를 넘겨주기보다는 스크린 상위에서 한번만 uiState를 넘겨주는 방향이 더 맞을 것 같아요 이 컴포넌트 필요한 값만 내려주는 형태가 사용하지 않는 uiState의 정보들을 가지고 있을 필요가 없기 때문에 더 적합할 것 같습니다 !
|
|
||
| @Composable | ||
| fun ChallengeRoutineOnboardingBody( | ||
| items: List<ChallengeRoutineUiState>, |
There was a problem hiding this comment.
여기도 uiState 전체 보다는 필요한 정보들만 받을 수 잇도록 수정해주세요 ~~
| verticalArrangement = Arrangement.spacedBy(space = 12.dp), | ||
| modifier = Modifier.fillMaxWidth() | ||
| ) { | ||
| itemsIndexed(items) { index, item -> |
|
|
||
| import com.cherrish.android.presentation.challenge.mission.model.ChallengeMissionModel | ||
|
|
||
| data class ChallengeMissionUiState( |
There was a problem hiding this comment.
P1 : UiState는 화면 당 하나만 나타나도록 수정해주세요! 화면 상태가 여러 UiState로 분산되면 흐름을 파악하기 어렵고 상태 동기화 비용이 커질 수 있어요!
There was a problem hiding this comment.
넵 하나의 State로 묶을게요!!
- ChallengeMissionUiState 내 선택한 미션을 관리하는 missions는 불필요하고 뷰모델에서 처리할 수 있을 것 같아 삭제
Related issue 🛠
Work Description ✏️
Screenshot 📸
루틴 챌린지 온보딩 바디
Screen_recording_20260116_180228.mp4
Todo 챌린지 미션
Screen_recording_20260116_204241.mp4
Uncompleted Tasks 😅
To Reviewers 📢
중간에 브랜치를 바꿔서 다시 적용을 해서 커밋명 순서가 조금 다를 수 있습니다 빠른 피드백 환영입니다유 ~~~☺️
Summary by CodeRabbit
릴리스 노트
New Features
Style
✏️ Tip: You can customize this high-level summary in your review settings.