Skip to content

[feat] #167 MviIntentStore init 기반 초기 데이터 로드 방식 추가#169

Merged
ikseong00 merged 2 commits intodevelopfrom
feat/#167-mvi-init-store
Apr 2, 2026
Merged

[feat] #167 MviIntentStore init 기반 초기 데이터 로드 방식 추가#169
ikseong00 merged 2 commits intodevelopfrom
feat/#167-mvi-init-store

Conversation

@ikseong00
Copy link
Copy Markdown
Contributor

@ikseong00 ikseong00 commented Mar 24, 2026

🔗 관련 이슈

📙 작업 설명

  • MviIntentStoreImpl의 initialFetchData를 nullable로 변경하여 null일 경우 asStateFlow(), non-null일 경우 기존 onStart + stateIn 분기
  • 재로딩이 불필요한 ViewModel 7개를 init 블록 기반 초기 데이터 로드로 전환
    • ArchiveMainViewModel, AllAlbumViewModel, PoseDetailViewModel, RandomPoseViewModel, MyPageViewModel, TermViewModel, UploadAlbumViewModel
  • MapViewModel은 탭 전환 재방문 빈도가 높아 기존 onStart 방식 유지

💬 추가 설명 or 리뷰 포인트 (선택)

  • initialFetchData를 넘기지 않는 기존 ViewModel 8개는 기본값이 null로 바뀌면서 onStart 래핑 대신 asStateFlow()로 전환되지만 동작 차이 없음
  • [fix] #161 ArchiveResult 화면별 Result 타입 분리 #166 PR에서 UploadAlbumViewModel에 result 처리를 추가할 계획입니다

Summary by CodeRabbit

릴리스 노트

  • Refactor
    • 앱의 초기 데이터 로드 메커니즘을 개선하여 더욱 유연한 초기화 패턴을 지원하도록 변경했습니다. 기능상 변화는 없으며 모든 화면은 이전과 동일하게 로드됩니다.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: f3275577-9cac-492c-b948-cb1f6ccaadf3

📥 Commits

Reviewing files that changed from the base of the PR and between 9c4c4aa and d7eee71.

📒 Files selected for processing (8)
  • core/ui/src/main/java/com/neki/android/core/ui/MviIntentStore.kt
  • feature/archive/impl/src/main/kotlin/com/neki/android/feature/archive/impl/album/AllAlbumViewModel.kt
  • feature/archive/impl/src/main/kotlin/com/neki/android/feature/archive/impl/main/ArchiveMainViewModel.kt
  • feature/auth/impl/src/main/kotlin/com/neki/android/feature/auth/impl/term/TermViewModel.kt
  • feature/mypage/impl/src/main/java/com/neki/android/feature/mypage/impl/main/MyPageViewModel.kt
  • feature/photo-upload/impl/src/main/java/com/neki/android/feature/photo_upload/impl/album/UploadAlbumViewModel.kt
  • feature/pose/impl/src/main/java/com/neki/android/feature/pose/impl/detail/PoseDetailViewModel.kt
  • feature/pose/impl/src/main/java/com/neki/android/feature/pose/impl/random/RandomPoseViewModel.kt

개요

MviIntentStoreinitialFetchData 파라미터를 nullable로 변경하여 선택적 초기 데이터 로드를 지원합니다. 이에 따라 여러 ViewModel에서 store 기반 초기화에서 ViewModel의 init 블록 기반 초기화로 전환하였습니다.

변경사항

Cohort / File(s) 요약
MviIntentStore 핵심 변경
core/ui/src/main/java/com/neki/android/core/ui/MviIntentStore.kt
initialFetchData: (() -> Unit)?로 변경하여 nullable 지원. null 시 asStateFlow() 직접 반환, 비-null 시 기존 onStart + stateIn 메커니즘 유지.
Feature ViewModel 초기화 마이그레이션
feature/archive/impl/src/main/kotlin/com/neki/android/feature/archive/impl/album/AllAlbumViewModel.kt, feature/archive/impl/src/main/kotlin/com/neki/android/feature/archive/impl/main/ArchiveMainViewModel.kt, feature/auth/impl/src/main/kotlin/com/neki/android/feature/auth/impl/term/TermViewModel.kt, feature/mypage/impl/src/main/java/com/neki/android/feature/mypage/impl/main/MyPageViewModel.kt, feature/photo-upload/impl/src/main/java/com/neki/android/feature/photo_upload/impl/album/UploadAlbumViewModel.kt, feature/pose/impl/src/main/java/com/neki/android/feature/pose/impl/detail/PoseDetailViewModel.kt, feature/pose/impl/src/main/java/com/neki/android/feature/pose/impl/random/RandomPoseViewModel.kt
mviIntentStore() 구성에서 initialFetchData 제거하고 init 블록 내에서 직접 intent 발행으로 초기화 방식 전환.

예상 코드 리뷰 난이도

🎯 2 (Simple) | ⏱️ ~12 분

축하 시

🐰 초기화의 시간, init 블록이 울려 퍼지고,
nullable 파라미터가 유연함을 가져오네!
한 번만, 딱 한 번, ViewModel이 깨어날 때,
store의 무거운 짐을 덜었으니 축제로다! 🎉
— 코드래빗이 전하는 축하

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목은 이슈 번호 #167과 주요 변경 내용(init 기반 초기 데이터 로드 방식)을 명확히 반영하고 있습니다.
Description check ✅ Passed PR 설명은 관련 이슈, 주요 작업 내용, 영향받는 ViewModel 목록, 그리고 추가 설명을 포함하고 있습니다.
Linked Issues check ✅ Passed 코드 변경사항이 이슈 #167의 모든 기술 요구사항을 충족합니다: initialFetchData nullable 변경, asStateFlow/onStart 분기 로직, 7개 ViewModel init 방식 적용.
Out of Scope Changes check ✅ Passed 모든 코드 변경사항이 이슈 #167의 범위 내에 있으며, MviIntentStore 수정과 지정된 7개 ViewModel의 초기화 방식 전환만 포함됩니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/#167-mvi-init-store

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.

@ikseong00
Copy link
Copy Markdown
Contributor Author

@CodeRabbit review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 24, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Member

@Ojongseok Ojongseok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인했습니다. 👍

말씀하신 것 처럼 네컷지도는 이동 중 탭 전환 시 현위치에 대한 API 요청이 이루어져야 하니 기존 방식 유지하는 것이 좋아보입니당

@ikseong00 ikseong00 merged commit dbc33b2 into develop Apr 2, 2026
4 checks passed
@ikseong00 ikseong00 deleted the feat/#167-mvi-init-store branch April 2, 2026 01:22
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.

[feat] MviIntentStore init 기반 초기 데이터 로드 방식 추가

2 participants