Open
Conversation
Jetpack Compose 마이그레이션의 일환으로 더 이상 사용되지 않는 `ScheduleAdapter`와 `ScheduleItemViewHolder`를 삭제했습니다.
- **`ScheduleAdapter.kt` 삭제:** `ScheduleEventUiModel` 리스트를 처리하던 `ListAdapter` 구현체를 제거했습니다.
- **`ScheduleItemViewHolder.kt` 삭제:**
- 일정의 상태(`COMPLETED`, `ONGOING`, `UPCOMING`)에 따라 동적으로 스타일과 텍스트를 설정하던 기존 `View` 시스템 로직을 제거했습니다.
- 배경 리소스, 텍스트 색상 분기 처리 및 하단 여백 계산 로직 등을 모두 삭제했습니다.
`ScheduleUiState`를 데이터 클래스로 전환하고 내부 상태를 `Content` 인터페이스로 래핑하여 UI 상태 관리의 일관성을 높였습니다.
- **`ScheduleUiState.kt` 수정:**
- 기존 `sealed interface` 구조에서 `Content`를 포함하는 `data class` 구조로 변경했습니다.
- `Refreshing` 상태를 제거하고 `Content` 하위의 `Success`, `Error`, `InitialLoading`으로 상태를 정규화했습니다.
- **`ScheduleViewModel.kt` 수정:**
- 변경된 `ScheduleUiState` 구조에 맞춰 초기값 설정 및 상태 업데이트 로직을 수정했습니다.
- `loadSchedules`, `updateEventsUiState` 등 주요 메서드에서 `content` 프로퍼티를 통해 상태에 접근하도록 변경했습니다.
- 이벤트 로드 여부 확인 로직(`isEventLoaded`)을 새로운 데이터 구조에 맞게 최적화했습니다.
- **`ScheduleScreen.kt` 및 `ScheduleTabPage.kt` 수정:**
- UI 레이어에서 `scheduleUiState.content`를 기준으로 상태 분기(`when`)를 처리하도록 변경했습니다.
- `ScheduleTabPage`의 파라미터 타입을 `ScheduleUiState.Content.Success`로 구체화하여 안정성을 높였습니다.
- `HorizontalPager`에서 잘못된 인덱스 접근 시 별도의 에러 UI 대신 `return@HorizontalPager`를 사용하도록 방어 코드를 수정했습니다.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
✨ Finishing touches🧪 Generate unit tests (beta)
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 |
ScheduleViewModel의 상태 구조 변경(Content 래퍼 및 내부 상태 계층 도입)에 맞춰 테스트 코드를 수정했습니다.
- **`ScheduleViewModelTest.kt` 수정:**
- `scheduleUiState`의 실제 데이터에 접근하기 위해 `.value.content`를 참조하도록 변경했습니다.
- 상태 타입 체크 및 캐스팅 로직을 `ScheduleUiState.Content.Success` 및 `ScheduleEventsUiState.Content.Success`로 업데이트했습니다.
- `eventsUiStateByPosition` 참조 시 널 안정성 및 계층 구조(`?.content`)를 반영하여 단언(Assertion) 로직을 수정했습니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#️⃣ 이슈 번호
#48
🛠️ 작업 내용
🙇🏻 중점 리뷰 요청
문제가 생기면 그때 다시 픽스할게요. 그냥 억까였기를
📸 이미지 첨부 (Optional)
Screen_recording_20260206_014526.mp4