fix(feed): require map-selected creation location#7
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthrough이 PR은 포스트 생성 폼의 위치 입력을 텍스트 기반 문자열에서 지도 선택 기반 좌표로 전환합니다. 새로운 MapLocationPicker UI 컴포넌트를 추가하고, 폼 상태 관리 훅을 확장하며, 양쪽 포스트 클라이언트 폼과 API 계약을 일관되게 업데이트합니다. Changes지도 기반 위치 선택 폼 전환
🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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
🧹 Nitpick comments (1)
src/features/post/model/use-post-base-form.ts (1)
5-5: ⚡ Quick win모델 레이어에서 UI 타입을 직접 참조하지 않도록 분리해주세요.
use-post-base-form.ts가../ui/post-form/MapLocationPicker의 타입에 의존하면 레이어 경계가 깨지고, UI 변경이 모델 훅 타입에 전파됩니다.SelectedPostLocation은src/features/post/model/types.ts같은 공용 모델 타입으로 이동하고, UI/훅이 둘 다 그 타입을 참조하도록 분리하는 편이 안전합니다.예시 diff
- import type { SelectedPostLocation } from '../ui/post-form/MapLocationPicker'; + import type { SelectedPostLocation } from './types';🤖 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 `@src/features/post/model/use-post-base-form.ts` at line 5, use-post-base-form.ts currently imports SelectedPostLocation from the UI component MapLocationPicker, breaking layer boundaries; move the SelectedPostLocation type into a shared model file (e.g., create or update src/features/post/model/types.ts) and export it there, then change usePostBaseForm (use-post-base-form.ts) and the UI component MapLocationPicker to import SelectedPostLocation from the new model types module so the model hook (usePostBaseForm) no longer references UI internals.
🤖 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 `@src/features/post/ui/post-form/MapLocationPicker.tsx`:
- Around line 61-71: The map currently only accepts clicks via MapV3Canvas with
onMapClickAction={handleSelect}, so add keyboard/assistive alternatives:
implement a focusable button like "Select current center" that calls
handleSelect(center) (use the existing center state), add optional text inputs
for latitude/longitude bound to center and a "Use coordinates" action that calls
handleSelect with parsed values, and ensure controls have accessible
labels/aria-describedby and keyboard focus order; reference MapV3Canvas,
handleSelect, and center/overlays when adding these elements so keyboard and
screen-reader users can complete the required location selection.
---
Nitpick comments:
In `@src/features/post/model/use-post-base-form.ts`:
- Line 5: use-post-base-form.ts currently imports SelectedPostLocation from the
UI component MapLocationPicker, breaking layer boundaries; move the
SelectedPostLocation type into a shared model file (e.g., create or update
src/features/post/model/types.ts) and export it there, then change
usePostBaseForm (use-post-base-form.ts) and the UI component MapLocationPicker
to import SelectedPostLocation from the new model types module so the model hook
(usePostBaseForm) no longer references UI internals.
🪄 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
Run ID: 56c7d215-0bed-49e0-8359-c6e277972941
📒 Files selected for processing (9)
src/features/post/api/post-api.test.tssrc/features/post/api/post-api.tssrc/features/post/client/OfferFormClient.tsxsrc/features/post/client/RequestFormClient.tsxsrc/features/post/model/types.tssrc/features/post/model/use-post-base-form.tssrc/features/post/ui/post-form/MapLocationPicker.test.tsxsrc/features/post/ui/post-form/MapLocationPicker.tsxsrc/features/post/ui/post-form/PostBaseInfoSection.tsx
Summary
lat/lngTest Plan
pnpm test -- src/features/post/api/post-api.test.ts src/features/post/ui/post-form/MapLocationPicker.test.tsxpnpm lint(passes with existing 7 warnings)pnpm buildNotes
Summary by CodeRabbit
릴리스 노트
New Features
Refactor