Skip to content

[Fix] #235 - 지도 POI 검색 디버깅#236

Open
Remaked-Swain wants to merge 2 commits intodevelopfrom
fix/#235-map-initial-search-debug
Open

[Fix] #235 - 지도 POI 검색 디버깅#236
Remaked-Swain wants to merge 2 commits intodevelopfrom
fix/#235-map-initial-search-debug

Conversation

@Remaked-Swain
Copy link
Copy Markdown
Member

@Remaked-Swain Remaked-Swain commented May 6, 2026

🌴 작업한 브랜치

  • fix/#235-map-initial-search-debug

✅ 작업한 내용

  • Map 진입 시 초기 POI 검색 조건을 isFirstLoad 단일 플래그가 아닌 MapInitialSearchState 기반 상태로 재구성했습니다.
  • 위치 권한이 notDetermined인 경우 즉시 검색하지 않고, 권한 요청 플로우를 거친 뒤 권한 결과에 따라 후속 동작으로 회귀하도록 정리했습니다.
  • 위치 권한이 허용된 경우, 실제 userLocation 확보 전에는 기본 좌표 기준 초기 검색이 실행되지 않도록 수정했습니다.
  • 위치 권한이 거부되었거나 제한된 경우에는 기존 기획대로 기본좌표(강남역) 기준으로 지도와 POI가 로드되도록 유지했습니다.
  • 지도 초기 cameraIdle 이벤트와 실제 검색 가능 상태를 분리해, 초기 카메라가 임시 기본좌표인 상태에서 잘못된 POI가 노출되던 문제를 해결했습니다.
  • 주변 포토부스 목록은 기획 의도에 맞게 항상 현재 위치 기준으로만 조회되도록 정리했고, 현재 위치가 없는 경우에는 기본좌표/지도 중심으로 대체 조회하지 않도록 수정했습니다.

❗️PR Point

  • 이번 수정의 핵심은 조건문 보강이 아니라 초기 검색 시점을 상태로 모델링한 것입니다. isFirstLoad 단일 플래그 대신, 권한 미결정, 현재 위치 대기, 기본좌표 검색 가능, 현재 위치 검색 가능, 초기 검색 완료를 명시적으로 분리해 초기 진입 로직의 동작과정을 분명히 했습니다.

  • 지도 POI 검색 기준과 주변 포토부스 목록 기준은 기획 의도에 따라 다르게 유지했습니다.

    • 지도 POI 검색: 초기 상태에 따라 기본좌표 또는 현재 위치, 이후에는 사용자가 보고 있는 지도 중심
    • 주변 포토부스 목록: 항상 현재 위치 기준
  • 위치 권한 없을 시, 사용자는 본인의 집에 있는데 지도에는 강남역을 기준으로 POI가 나타나면 '왜 이러지?' 싶은 UX를 불러일으킬 수 있을 것 같다는 생각이 문득 들었습니다. 이 경우에는 '기본 좌표를 사용하고 있다'는 정보를 살짝 알려주는 것만으로도 해소될 수 있을 것 같은데, 아직 디자인적 결정사항이 없어서 Future Task로 두고 나중에 건의해보는게 좋을 것 같아서 이 부분 관련해서는 진행하지 않았습니다.

📸 스크린샷

생략합니당!

📟 관련 이슈

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능

    • 지도 검색의 권한 기반 초기화 기능 추가
    • 사용자 위치 감지 및 검색 흐름 개선
    • 권한 상태에 따른 단계별 검색 로직 구현 (권한 대기 → 위치 대기 → 기본 위치 준비 → 사용자 위치 준비 → 완료)
  • 개선사항

    • 위치 기반 검색 동작 최적화

@Remaked-Swain Remaked-Swain added this to the 4차 스프린트 milestone May 6, 2026
@Remaked-Swain Remaked-Swain requested a review from OneTen19 May 6, 2026 15:05
@Remaked-Swain Remaked-Swain self-assigned this May 6, 2026
@Remaked-Swain Remaked-Swain added Add ✚ 코드, 파일, 에셋 추가 Fix 🔨 급한 기능 수정 금용 🐲 금용 작업 labels May 6, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 6, 2026

Caution

Review failed

Failed to post review comments

Walkthrough

지도 초기 검색 기능을 위해 기존 isFirstLoad 플래그를 새로운 MapInitialSearchState 상태 머신으로 교체했습니다. 권한 변경, 맵 로드, 사용자 위치 업데이트 등 다양한 이벤트에 따라 상태 전환을 관리하고 POI 검색 시점을 제어합니다.

Changes

초기 검색 상태 머신 도입

Layer / File(s) Summary
상태 정의
Neki-iOS/Features/Map/Sources/Domain/Sources/Entities/MapInitialSearchState.swift
5가지 상태(awaitingPermission, waitingForUserLocation, readyForDefaultLocation, readyForUserLocation, completed)를 정의한 MapInitialSearchState 열거형 추가.
상태 관리 및 권한 처리
Neki-iOS/Features/Map/Sources/Presentation/Sources/Feature/MapFeature.swift (State, 권한 업데이트)
상태 속성 추가(isPermissionAlertPresented, initialSearchState), isFirstLoad 제거. 권한 변경에 따라 상태 전환: 승인 시 waitingForUserLocation, 미결정 시 awaitingPermission, 거부 시 readyForDefaultLocation으로 설정.
위치 및 카메라 이벤트 연결
Neki-iOS/Features/Map/Sources/Presentation/Sources/Feature/MapFeature.swift (맵 로드, 위치 업데이트, 카메라)
맵 로드 시 attemptInitialSearch 트리거. 사용자 위치 수신 시 상태를 readyForUserLocation으로 전환하고 카메라 업데이트. 카메라 움직임 종료 시 검색 재시도.
검색 흐름 개선
Neki-iOS/Features/Map/Sources/Presentation/Sources/Feature/MapFeature.swift (didTapSearchHereButton, 헬퍼 메서드)
검색 버튼 탭 시 상태 기반으로 검색 좌표 결정 (initialSearchTargetCoordinate). nearbyPhotoBoothsEffect 헬퍼 메서드로 사용자 위치 여부에 따른 부스 검색 조건 결정.

Sequence Diagram

sequenceDiagram
    actor User
    participant MapFeature
    participant LocationManager
    participant SearchEngine
    
    User->>MapFeature: 지도 화면 진입
    MapFeature->>MapFeature: 상태: awaitingPermission
    
    User->>MapFeature: 위치 권한 승인
    MapFeature->>MapFeature: 상태: waitingForUserLocation
    MapFeature->>LocationManager: 현재 위치 요청
    
    LocationManager->>MapFeature: 사용자 위치 반환
    MapFeature->>MapFeature: 상태: readyForUserLocation
    MapFeature->>MapFeature: 카메라를 사용자 위치로 이동
    
    User->>MapFeature: 지도 로드 완료 또는<br/>카메라 움직임 종료
    MapFeature->>SearchEngine: attemptInitialSearch 트리거
    SearchEngine->>SearchEngine: 현재 상태에 따라<br/>검색 좌표 결정
    
    alt 사용자 위치 있음
        SearchEngine->>SearchEngine: 사용자 위치 기준 검색
    else 사용자 위치 없음
        SearchEngine->>SearchEngine: 기본좌표(강남역) 기준 검색
    end
    
    SearchEngine->>MapFeature: POI 부스 데이터 반환
    MapFeature->>MapFeature: 상태: completed
    MapFeature->>User: 지도에 POI 마커 표시
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 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 Pull request title clearly references issue #235 and describes the main change as map POI search debugging, which aligns with the primary objective of fixing POI marker display issues.
Description check ✅ Passed Pull request description follows the template with all required sections completed: branch, work content, PR points, screenshots note, and related issues. It provides comprehensive explanation of the state-driven approach and design decisions.
Linked Issues check ✅ Passed Code changes address both objectives from issue #235: refactored POI search flow using MapInitialSearchState to prevent incorrect POI markers from displaying, and implemented event tracing logic through permission and location state transitions.
Out of Scope Changes check ✅ Passed All changes are scoped to issue #235 requirements: new MapInitialSearchState entity for state modeling and MapFeature modifications to implement permission-driven, location-aware POI search logic. No unrelated changes detected.

✏️ 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 fix/#235-map-initial-search-debug

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Add ✚ 코드, 파일, 에셋 추가 Fix 🔨 급한 기능 수정 금용 🐲 금용 작업

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Fix] 지도 POI 검색 디버깅

1 participant