-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat] CollectionList 화면 유형 구분 및 컬렉션 조회 API 연동 #149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 9 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
fec08b0
Merge remote-tracking branch 'origin/feat/#146-profile-collection-con…
nahy-512 ffae285
feat: CollectionList 전체 컬렉션 조회 API 연동
nahy-512 243dcc8
delete: CollectionDetailModel 삭제
nahy-512 3823d1d
feat: CollectionList RouteType 추가, 헤더 타이틀 구분
nahy-512 1717b8f
feat: CollectionList UiState 수정 및 로딩 범위 개선
nahy-512 b0b49ba
feat: CollectionList saved, recent 컬렉션 조회 API 호출
nahy-512 549bdd6
refactor: 컬렉션 목록 조회 CollectionListRouteType에 따른 중복 로직 통합
nahy-512 0f2572d
feat: CollectionList 컬렉션 북마크 로직 추가
nahy-512 4ac65a8
Merge branch 'develop' of https://github.com/imflint/Flint-Android in…
nahy-512 83dae59
fix: 코드래빗 코드리뷰 반영
nahy-512 f484ae4
refactor: CollectionListRouteType 위치 변경
nahy-512 f3e6de9
fix: CollectionList 총 개수 텍스트 스크롤 수정
nahy-512 e94f4a1
delete: SampleType 삭제
nahy-512 2e630f9
fix: CollectionFilmItem 북마크 패딩 오류 수정
nahy-512 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
9 changes: 9 additions & 0 deletions
9
app/src/main/java/com/flint/domain/type/CollectionListRouteType.kt
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| package com.flint.domain.type | ||
|
|
||
| enum class CollectionListRouteType( | ||
| val title: String | ||
| ) { | ||
| CREATED(title = "전체 컬렉션"), | ||
| SAVED(title = "저장 컬렉션"), | ||
| RECENT(title = "눈여겨보고 있는 컬렉션"), | ||
| } |
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
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
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
50 changes: 50 additions & 0 deletions
50
app/src/main/java/com/flint/presentation/collectionlist/CollectionListViewModel.kt
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| package com.flint.presentation.collectionlist | ||
|
|
||
| import androidx.lifecycle.SavedStateHandle | ||
| import androidx.lifecycle.ViewModel | ||
| import androidx.lifecycle.viewModelScope | ||
| import androidx.navigation.toRoute | ||
| import com.flint.core.common.util.UiState | ||
| import com.flint.core.navigation.Route | ||
| import com.flint.domain.repository.CollectionRepository | ||
| import com.flint.domain.repository.UserRepository | ||
| import com.flint.domain.type.CollectionListRouteType | ||
| import com.flint.presentation.collectionlist.uistate.CollectionListUiState | ||
| import dagger.hilt.android.lifecycle.HiltViewModel | ||
| import kotlinx.coroutines.flow.MutableStateFlow | ||
| import kotlinx.coroutines.flow.update | ||
| import kotlinx.coroutines.launch | ||
| import javax.inject.Inject | ||
|
|
||
| @HiltViewModel | ||
| class CollectionListViewModel @Inject constructor( | ||
| savedStateHandle: SavedStateHandle, | ||
| val userRepository: UserRepository, | ||
| val collectionRepository: CollectionRepository, | ||
| ) : ViewModel() { | ||
|
|
||
| val routeType = savedStateHandle.toRoute<Route.CollectionList>().routeType | ||
|
|
||
| private val _uiState = MutableStateFlow<CollectionListUiState>(CollectionListUiState()) | ||
| val uiState: MutableStateFlow<CollectionListUiState> = _uiState | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
|
|
||
| init { | ||
| getCollectionList() | ||
| } | ||
|
|
||
| private fun getCollectionList() { | ||
| viewModelScope.launch { | ||
| _uiState.update { it.copy(collectionList = UiState.Loading) } | ||
|
|
||
| when (routeType) { | ||
| CollectionListRouteType.CREATED -> userRepository.getUserCreatedCollections(userId = null) | ||
| CollectionListRouteType.SAVED -> userRepository.getUserBookmarkedCollections(userId = null) | ||
| CollectionListRouteType.RECENT -> collectionRepository.getRecentCollectionList() | ||
| }.onSuccess { result -> | ||
| _uiState.update { it.copy(collectionList = UiState.Success(result)) } | ||
| }.onFailure { | ||
| _uiState.update { it.copy(collectionList = UiState.Failure) } | ||
| } | ||
| } | ||
| } | ||
| } | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error/Empty 상태가 빈 화면으로 끝납니다.
Loading/Success만 처리하고 나머지는 렌더링이 비어 있어, 실패/빈 상태에서 사용자에게 아무 피드백이 없습니다. 최소한 에러/빈 상태 UI나 재시도 경로를 제공해주세요.
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
에러 관리 나중에 할테니까 답글 달지 말고 Resolve 누르렴
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
In
@app/src/main/java/com/flint/presentation/collectionlist/CollectionListScreen.ktaround lines 127 - 184, The when-block handling collectionList only covers
UiState.Loading and UiState.Success, leaving error/empty states rendering blank;
add explicit branches for UiState.Empty and UiState.Error inside the same
when(collectionList) to render a minimal Empty/Error UI (message + optional
icon) and a retry action (wire to an existing reload callback or add a new
onRetry lambda parameter to the screen if none exists), e.g., implement case
UiState.Empty { Centered text "No collections" + optional create button } and
case is UiState.Error { Centered text with error message and a Button that calls
onRetry() }, keeping the rest of the layout (LazyVerticalGrid,
CollectionFileItem, onCollectionItemClick, onBookmarkClick) unchanged.
🏁 Script executed:
Length of output: 68
🏁 Script executed:
Length of output: 670
@nahy-512네, 알겠습니다! 👍🧬 Code Graph Analysis Results
[Filename: app/src/main/java/com/flint/presentation/main/MainNavigator.kt, Lines 116-118]
[Filename: app/src/main/java/com/flint/presentation/collectionlist/navigation/CollectionListNavigation.kt, Lines 12-22]
[Filename: app/src/main/java/com/flint/core/designsystem/theme/Theme.kt, Lines 8-16]
[Filename: app/src/main/java/com/flint/core/designsystem/component/toast/ShowToast.kt, Lines 25-50]
[Filename: app/src/main/java/com/flint/core/designsystem/component/toast/ShowSaveToast.kt, Lines 23-46]
[Filename: app/src/main/java/com/flint/presentation/collectionlist/component/CollectionFileItem.kt, Lines 39-84]
[Filename: app/src/main/java/com/flint/core/designsystem/component/topappbar/FlintBackTopAppbar.kt, Lines 16-59]
🧠 Learnings used