-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: #105 MapFeature 내 Search 관련 로직 분리 #106
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
base: develop
Are you sure you want to change the base?
Conversation
- MapFeature에 mapSearch 의존성 주입 추가 - MapSearchFeature Action과 State를 MapFeature에 통합 - PIDAFeature에서 mapSearchReducer 생성 및 연결 - 지도 검색 기능을 위한 아키텍처 리팩토링
MapFeature의 검색 관련 기능을 하위 리듀서인 MapSearchFeature로 리팩토링: - 검색 상태(searchResult, searchText)를 MapSearchFeature.State로 이동 - 검색 액션들(setSearchBarText, resetSearchBar 등)을 MapSearchFeature로 이동 - Delegate 패턴을 통해 MapFeature와 MapSearchFeature 간 통신 - 기존 기능 유지하면서 관심사 분리 및 모듈화 개선
검색 관련 모든 상태와 액션을 MapSearchFeature로 이동하여 관심사 분리: - detailRoot, regionResult, isShowRegionList, regionSheetDetent 상태 이동 - showRegionList, changeRegionSheetDetent, searchBackButtonTapped 등 액션 이동 - 검색 백 네비게이션 로직 MapSearchFeature에서 처리 - MapView 바인딩 경로를 mapSearch로 수정 - DetailRoot enum도 MapSearchFeature로 이동하여 독립성 확보
복잡한 DetailRoot 기반 네비게이션을 명확한 NavigationState로 리팩토링: - DetailRoot enum을 NavigationState로 교체하여 가독성 향상 - DetailSource로 상세화면 진입 경로를 명확히 구분 - handleSearchBackNavigation 로직을 switch 패턴으로 단순화 - setNavigationFromRegionList 액션 추가로 관심사 분리 강화 - 네비게이션 상태 관리가 MapSearchFeature에 집중되어 일관성 확보
📝 WalkthroughWalkthroughThis PR extracts search-related state, actions, and reducer logic from MapFeature into a dedicated MapSearchFeature module, establishing a new nested reducer architecture. The changes update MapView to reference the mapSearch namespace and wire the new reducer composition throughout the feature hierarchy, including PIDAFeature. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~23 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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 |
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.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@Projects/Feature/Map/MapFeatureInterface/Sources/MapView/MapView.swift`:
- Around line 224-228: The regionListSheet function is shadowing the outer Map
feature store: its parameter is typed StoreOf<SearchRegionListFeature> but the
bindings use $store.mapSearch which belong to the MapFeature store; rename the
parameter (e.g., to regionListStore) and change the bindings to use the outer
MapFeature store (the MapFeature Store property used elsewhere in this file) for
isPresented and detent (instead of $store.mapSearch...), so regionListSheet
keeps a correctly typed StoreOf<SearchRegionListFeature> parameter while binding
presentation state to the MapFeature store.
| private func regionListSheet(store: StoreOf<SearchRegionListFeature>) -> some View { | ||
| DetentBottomSheet(isPresented: $store.isShowRegionList, detent: $store.regionSheetDetent) { | ||
| DetentBottomSheet( | ||
| isPresented: $store.mapSearch.isShowRegionList, | ||
| detent: $store.mapSearch.regionSheetDetent | ||
| ) { |
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.
Fix regionListSheet bindings to avoid Store shadowing.
store here is StoreOf<SearchRegionListFeature>, so $store.mapSearch... doesn’t exist and will fail to compile. Use the MapFeature store for the bindings and rename the parameter to avoid shadowing.
🐛 Proposed fix
-private func regionListSheet(store: StoreOf<SearchRegionListFeature>) -> some View {
- DetentBottomSheet(
- isPresented: $store.mapSearch.isShowRegionList,
- detent: $store.mapSearch.regionSheetDetent
- ) {
- SearchRegionListView(store: store)
- }
-}
+private func regionListSheet(store regionStore: StoreOf<SearchRegionListFeature>) -> some View {
+ DetentBottomSheet(
+ isPresented: $store.mapSearch.isShowRegionList,
+ detent: $store.mapSearch.regionSheetDetent
+ ) {
+ SearchRegionListView(store: regionStore)
+ }
+}🤖 Prompt for AI Agents
In `@Projects/Feature/Map/MapFeatureInterface/Sources/MapView/MapView.swift`
around lines 224 - 228, The regionListSheet function is shadowing the outer Map
feature store: its parameter is typed StoreOf<SearchRegionListFeature> but the
bindings use $store.mapSearch which belong to the MapFeature store; rename the
parameter (e.g., to regionListStore) and change the bindings to use the outer
MapFeature store (the MapFeature Store property used elsewhere in this file) for
isPresented and detent (instead of $store.mapSearch...), so regionListSheet
keeps a correctly typed StoreOf<SearchRegionListFeature> parameter while binding
presentation state to the MapFeature store.
#️⃣ Issue Number
🔎 작업 내용
검색 상태 및 액션 분리
검색 관련 네비게이션 로직 개선
이 두 케이스에 따라 SearchBar의 backbutton 탭 시 화면 이동 처리 과정이 필요
기존에는 상세 화면을 어디에서 들어왔는지에 따라 나눴는데, 코드 가독성이 좋지않았음.
현재 화면이 어디인지를 나타내는 enum을 보다 명확하게 정의하여 개선함.
📷 스크린샷
🛠️ 기타 공유 내용
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.