feat : 산 상세 맛집 탭 시 네이버 지도로 이동 - #145
Conversation
맛집 아이템을 Pressable로 감싸 mapUrl로 Linking.openURL. RestaurantInfo 타입에 mapUrl 필드 추가. mapUrl 없으면 disabled 처리.
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
📝 WalkthroughWalkthrough맛집 카드가 지도 URL이 있을 때만 눌릴 수 있도록 변경되었으며, 클릭 시 외부 지도 URL을 열고 실패하면 경고를 기록합니다. Changes맛집 지도 링크
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@features/mountains-detail/components/restaurant-tab.tsx`:
- Around line 34-37: Update the restaurant list rendering around the Pressable
keyed by item.restaurantId so it never uses an optional or undefined
restaurantId directly as the React key. If the API guarantees an ID, make
restaurantId required in the generated type contract; otherwise, use a stable
unique fallback field for items without an ID, preserving unique keys across all
rendered restaurants.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 0d4ddf4c-c9c3-4b91-bcb4-d3c6f2d9d670
⛔ Files ignored due to path filters (1)
types/api.generated.tsis excluded by!**/*.generated.*
📒 Files selected for processing (1)
features/mountains-detail/components/restaurant-tab.tsx
| <Pressable | ||
| key={item.restaurantId} | ||
| className="gap-2" | ||
| disabled={!item.mapUrl} |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
optional한 restaurantId를 그대로 key로 사용하지 마세요.
types/api.generated.ts:554-560에서 restaurantId가 optional이므로, ID가 없는 항목들은 모두 동일한 undefined key를 갖게 될 수 있습니다. API에서 ID가 항상 보장된다면 계약을 required로 변경하고, 그렇지 않다면 불변의 고유 필드를 사용하는 fallback key를 추가하세요.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@features/mountains-detail/components/restaurant-tab.tsx` around lines 34 -
37, Update the restaurant list rendering around the Pressable keyed by
item.restaurantId so it never uses an optional or undefined restaurantId
directly as the React key. If the API guarantees an ID, make restaurantId
required in the generated type contract; otherwise, use a stable unique fallback
field for items without an ID, preserving unique keys across all rendered
restaurants.
개요
산 상세 정보 조회 API에 맛집
mapUrl필드가 추가됨에 따라, 산 상세 화면에서 맛집을 누르면 네이버 지도로 이동하도록 구현합니다.변경 사항
types/api.generated.ts—RestaurantInfo에mapUrl?: string필드 추가features/mountains-detail/components/restaurant-tab.tsxPressable로 감싸 탭 시Linking.openURL(item.mapUrl)로 네이버 지도 열기mapUrl이 없는 항목은disabled처리, 열기 실패는 로그만 남기고 무시변경 파일
types/api.generated.tsfeatures/mountains-detail/components/restaurant-tab.tsx체크리스트
mapUrl없는 맛집은 탭해도 아무 동작 안 하는지참고 — 타입 재생성 관련
types/api.generated.ts는 원래npm run typegen으로 재생성하는 파일이나, 전체 재생성 시 백엔드 스펙 드리프트로 관련 없는 타입 242줄 변경 +SlopeSegmentResponseoptional화로 인한tracking.tsx타입 에러가 발생합니다. 이 PR을 깨끗하게 유지하기 위해mapUrl필드만 최소 추가했습니다.→ 추후 전체
typegen재생성은tracking.tsx(mergeShortSegments) 대응과 함께 별도 PR로 진행 필요.Summary by CodeRabbit
새로운 기능
버그 수정