[bugfix] 축제 제휴 데이터가 없는 경우에는 필터에서도 사라지도록 수정#526
Conversation
- 테스트 케이스도 작성
There was a problem hiding this comment.
Code Review
This pull request introduces dynamic filter management in the map view by adding an availableFilters property to the MapState. The UI components have been updated to render only the filters provided by the state, which are now determined based on the presence of festival partnerships. Feedback suggests initializing availableFilters as an empty list to prevent UI flickering during the loading state and using a more maintainable filtering approach when excluding specific filter types.
| val restaurantInfoList: List<RestaurantInfo> = emptyList(), | ||
| val storeType: StoreType? = null, | ||
| val selectedFilter: FilterType = FilterType.Mine, | ||
| val availableFilters: List<FilterType> = FilterType.entries, |
There was a problem hiding this comment.
MapState의 초기값으로 availableFilters가 FilterType.entries로 설정되어 있습니다. fetchUserCollegeDepartment가 완료되기 전(UiState.Init 또는 Loading 상태)에도 UI가 렌더링될 경우, 모든 필터가 잠시 노출되었다가 사라지는 현상이 발생할 수 있습니다. 초기값을 빈 리스트로 설정하거나, 항상 노출되는 기본 필터만 포함하는 것이 사용자 경험 측면에서 더 좋습니다.
| val availableFilters: List<FilterType> = FilterType.entries, | |
| val availableFilters: List<FilterType> = emptyList(), |
| val availableFilters = if (hasFestival) { | ||
| FilterType.entries | ||
| } else { | ||
| listOf(FilterType.All, FilterType.Mine) | ||
| } |
There was a problem hiding this comment.
availableFilters를 정의할 때 특정 필터를 제외한 나머지를 직접 리스트로 나열하기보다, FilterType.entries를 필터링하는 방식이 추후 새로운 필터 타입이 추가될 때 유지보수 측면에서 더 유리합니다.
| val availableFilters = if (hasFestival) { | |
| FilterType.entries | |
| } else { | |
| listOf(FilterType.All, FilterType.Mine) | |
| } | |
| val availableFilters = if (hasFestival) { | |
| FilterType.entries | |
| } else { | |
| FilterType.entries.filter { it != FilterType.Festival } | |
| } |
Summary
잇슈 iOS 앱을 보니까 현재 필터에 축제 탭이 없더라고요. 안드로이드에서도 축제 제휴 데이터가 없는 경우에 필터에서 사라지게 수정했습니다.
Issue
To reviewers