Conversation
개요이 변경사항은 Callvan 리포트에 이미지 첨부 기능을 추가합니다. 새로운 첨부 파일 타입과 첨부 배열 필드를 도입하고, 업로드 도메인을 확장하며, 리포트 제출 시 이미지 업로드를 비동기로 수행해 업로드된 URL을 attachments로 포함하도록 구현합니다. 변경사항
시퀀스 다이어그램sequenceDiagram
participant User as 사용자
participant React as ReportPage<br/>(컴포넌트)
participant Hook as useUploadFile<br/>(훅)
participant API as Upload API
participant Server as 서버
User->>React: 이미지 선택 및 제출
React->>React: 선택된 이미지 확인
React->>Hook: 각 이미지에 대해 uploadFile() 호출 (병렬)
Hook->>API: 이미지 업로드 요청 (CALLVAN_REPORT 도메인)
API->>Server: 파일 전송
Server-->>API: 업로드된 URL 반환
API-->>Hook: URL 응답 전달
Hook-->>React: 모든 업로드 완료 통보
React->>React: attachment 객체 생성 ({attachment_type:'IMAGE', url})
React->>Server: 리포트 제출 (attachments 포함)
Server-->>React: 제출 완료 응답
React-->>User: 성공 알림
예상 코드 리뷰 노력🎯 3 (보통) | ⏱️ ~20분 🚥 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
🧪 Generate unit tests (beta)
📝 Coding Plan
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 Tip CodeRabbit can use oxc to improve the quality of JavaScript and TypeScript code reviews.Add a configuration file to your project to customize how CodeRabbit runs oxc. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/components/Callvan/components/ReportPage/index.tsx (1)
138-140: 업로드/제출 중 로딩 상태 피드백을 고려해 보세요.버튼이
isPending || isUploading상태에서 비활성화되는 것은 좋습니다. 다만, 사용자에게 현재 작업 중임을 시각적으로 알려주면 UX가 개선됩니다.♻️ 로딩 상태 표시 예시
- <button type="button" className={styles['page__submit-button']} onClick={handleSubmit} disabled={isPending || isUploading}> - 신고하기 + <button + type="button" + className={styles['page__submit-button']} + onClick={handleSubmit} + disabled={isPending || isUploading} + aria-busy={isPending || isUploading} + > + {isUploading ? '업로드 중...' : isPending ? '제출 중...' : '신고하기'} </button>🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/components/Callvan/components/ReportPage/index.tsx` around lines 138 - 140, The submit button currently disables when isPending || isUploading but provides no visual loading feedback; update the button rendered in ReportPage (the element using styles['page__submit-button'] with onClick={handleSubmit}) to show a loading state: when isPending || isUploading change the label to something like "신고하는 중..." and add an accessible busy indicator (e.g., aria-busy="true" and aria-live or aria-label) and/or render a small inline spinner/icon next to the text (use any existing LoadingSpinner component or a CSS spinner class) so users see activity while submission/uploads occur.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/components/Callvan/components/ReportPage/index.tsx`:
- Around line 138-140: The submit button currently disables when isPending ||
isUploading but provides no visual loading feedback; update the button rendered
in ReportPage (the element using styles['page__submit-button'] with
onClick={handleSubmit}) to show a loading state: when isPending || isUploading
change the label to something like "신고하는 중..." and add an accessible busy
indicator (e.g., aria-busy="true" and aria-live or aria-label) and/or render a
small inline spinner/icon next to the text (use any existing LoadingSpinner
component or a CSS spinner class) so users see activity while submission/uploads
occur.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 0d4b06c2-b0d1-4e97-b52c-9251935ead8c
📒 Files selected for processing (1)
src/components/Callvan/components/ReportPage/index.tsx
What is this PR? 🔍
Changes 📝
이미지 요청값추가 및 UI 반영uploadAPI 도메인CALLVAN_CHATCALLVAN_REPORT추가 및 반영Test CheckList ✅
Precaution
N/A
✔️ Please check if the PR fulfills these requirements
developbranch unconditionally?main?yarn lintSummary by CodeRabbit
릴리스 노트
새로운 기능
스타일