Skip to content

[Fix] 일정화면 에러상태 새로고침 불가 문제 해결#51

Open
parkjiminnnn wants to merge 10 commits intodevelopfrom
fix/48
Open

[Fix] 일정화면 에러상태 새로고침 불가 문제 해결#51
parkjiminnnn wants to merge 10 commits intodevelopfrom
fix/48

Conversation

@parkjiminnnn
Copy link
Contributor

#️⃣ 이슈 번호

#48


🛠️ 작업 내용

  • 에러 상태일 때 위아래 스와이프로 새로고침을 하지 못했던 점을 개선했습니다.
  • 추가로 uiState에 따른 컴포저블의 분기처리가 현재 너무 복잡하고 가독성이 떨어진다고 생각해서 ScheduleUiState와 ScheduleEventsUiState의 구현을 리팩토링했습니당.

🙇🏻 중점 리뷰 요청

  • 바텀 네비게이션 아이템을 재클릭시 화면이 현재 날짜에 해당하는 탭으로 다시 이동하는 기능이 갑자기 작동안하는 버그가 있어서 계속 삽질하다가 집에 와서 다시 실행시키니까 잘되네요..? 아직 무슨 문제였는지도 정확히 못찾았는데...
    문제가 생기면 그때 다시 픽스할게요. 그냥 억까였기를

📸 이미지 첨부 (Optional)

Screen_recording_20260206_014526.mp4

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`를 사용하도록 방어 코드를 수정했습니다.
@parkjiminnnn parkjiminnnn self-assigned this Feb 5, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 5, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/48

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

ScheduleViewModel의 상태 구조 변경(Content 래퍼 및 내부 상태 계층 도입)에 맞춰 테스트 코드를 수정했습니다.

- **`ScheduleViewModelTest.kt` 수정:**
    - `scheduleUiState`의 실제 데이터에 접근하기 위해 `.value.content`를 참조하도록 변경했습니다.
    - 상태 타입 체크 및 캐스팅 로직을 `ScheduleUiState.Content.Success` 및 `ScheduleEventsUiState.Content.Success`로 업데이트했습니다.
    - `eventsUiStateByPosition` 참조 시 널 안정성 및 계층 구조(`?.content`)를 반영하여 단언(Assertion) 로직을 수정했습니다.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant