Skip to content

fix : 코스 따라가기 시작 시 전체 코스 포커싱, 데모 시뮬레이션 제거#132

Merged
JioCoder merged 1 commit into
mainfrom
fix/remove-demo-simulation
Jun 5, 2026
Merged

fix : 코스 따라가기 시작 시 전체 코스 포커싱, 데모 시뮬레이션 제거#132
JioCoder merged 1 commit into
mainfrom
fix/remove-demo-simulation

Conversation

@JioCoder

@JioCoder JioCoder commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

요약

  • 데모용 좌표 시뮬레이션 및 관악산 하드코딩 제거
  • 코스 따라가기 시작 시 전체 코스가 보이도록 카메라 포커싱 개선

변경 파일

  • app/(tabs)/tracking.tsx
    • DEMO_MODE, DEMO_LAT, DEMO_LNG, DEMO_SIM_INTERVAL_MS, DEMO_SIM_STEP 상수 제거
    • 관악산 좌표 하드코딩 위치 초기화 제거 → 실제 GPS 사용
    • 좌표 시뮬레이션 useEffect 제거
    • 카메라 DEMO_MODE 분기 제거
    • 코스 따라가기 시작 시 isFollowingUser=false → 전체 코스 fit, 자유기록은 isFollowingUser=true → 현위치 follow

테스트 체크리스트

  • 코스 따라가기 시작 시 전체 코스가 지도에 보이는지 확인
  • 자유기록 시작 시 현위치로 카메라 follow 되는지 확인
  • 위치 버튼 누르면 현위치 follow 재활성 확인
  • 실제 GPS 기반으로 인근 산 조회 정상 동작 확인

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request removes the demo mode configuration and coordinate simulation logic from the tracking screen, simplifying the location tracking and camera alignment behavior. The review feedback identifies two key issues: first, the location button's press handler does not actually re-enable the real-time tracking follow mode as described in the comments, and a code suggestion is provided to fix this; second, a useEffect hook uses courseCoords but depends on courseDetail?.polyline, which should be updated to depend directly on courseCoords to comply with React Hook rules.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread app/(tabs)/tracking.tsx
Comment on lines +673 to +674
// 코스 따라가기: 시작 시 전체 코스가 보이도록 follow 비활성 (위치 버튼으로 재활성 가능)
// 자유기록: 시작 시 현위치 follow 활성

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

주석과 PR 설명에는 **"위치 버튼으로 재활성 가능"**하다고 언급되어 있으나, 실제 위치 버튼의 onPress 핸들러(1214번 라인 부근)에서는 setIsFollowingUser(true)를 호출하지 않고 카메라만 1회성으로 이동시키고 있습니다.

이로 인해 사용자가 위치 버튼을 눌러도 실시간 위치 추적(follow) 모드가 다시 활성화되지 않고, 움직여도 지도가 사용자를 따라가지 않는 문제가 발생합니다.

위치 버튼의 onPress 핸들러를 다음과 같이 수정하여 실시간 추적도 함께 재활성화되도록 개선해 주세요.

onPress={() => {
  const coord = markerCoord ?? userLocation;
  if (coord) {
    setIsFollowingUser(true); // 실시간 추적 재활성화
    mapRef.current?.animateCameraTo({
      latitude: coord.latitude,
      longitude: coord.longitude,
      zoom: 15,
    });
  }
}}

Comment thread app/(tabs)/tracking.tsx
@@ -703,14 +670,18 @@ export default function TrackingScreen() {
}, [courseDetail?.polyline, isTracking]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

useEffect 내부에서 courseCoords를 참조하여 카메라 범위를 계산하고 있지만, 의존성 배열에는 courseDetail?.polyline이 등록되어 있습니다.

courseCoordscourseDetail?.polyline을 기반으로 계산된 useMemo 값이므로, React Hook 규칙(react-hooks/exhaustive-deps)을 준수하고 잠재적인 버그를 방지하기 위해 의존성 배열에 courseCoords를 직접 전달하는 것이 좋습니다.

Suggested change
}, [courseDetail?.polyline, isTracking]);
}, [courseCoords, isTracking]);

@JioCoder JioCoder merged commit e86f90c into main Jun 5, 2026
2 checks passed
@JioCoder JioCoder deleted the fix/remove-demo-simulation branch June 5, 2026 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants