fix: 사건조회 UI 개선 및 AI 판결 플로우 버그 수정 - #95
Conversation
- extractDisputeMeta 전용 모델을 gemini-2.0-flash-lite로 분리 - moderation 모델도 gemini-2.0-flash-lite로 변경 - 제목 30자→20자, 요약 100자→50자로 축소 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- PATCH /api/disputes/[id]/status 엔드포인트 추가 - closeDispute API 함수 및 useCloseDispute 훅 추가 - DisputePage 사건종료 버튼에 훅 연결 및 로딩/에러 처리 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- 진술 제출 시 dispute 상태를 waiting_opponent로 업데이트 - fire-and-forget 방식으로 judge API 호출 추가 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- AbortController 30초 타임아웃 방식으로 충돌 해결 (dev 기준) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- statement 제출 후 fire-and-forget judge 호출 제거 - 스피너를 DB status 기반이 아닌 isJudging (API 호출 중) 기준으로만 표시 - 판결 완료 후 query invalidation으로 자동 UI 전환 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- extractDisputeMeta fire-and-forget → await으로 변경 (title/summary 추출 완료 후 응답) - 저장 중 fullscreen 스피너 화면 추가 - 중복 PATCH /status 호출 제거 (statements route에서 이미 처리) - next/image 적용 및 카카오 이미지 도메인 허용 (next.config.ts) - avatarFallback → 기본 이미지(thumbnail-default.png) 폴백 - categoryChip inline background-color 제거 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- StatementPage: savingContent 폭 반응형 처리 (min(100%, 362px)) - statements/route: extractDisputeMeta에 10초 타임아웃 추가 - status/route: 동일 상태 재요청 시 멱등 성공 반환 - judgment.ts: Array.from 기반 유니코드 안전 문자열 절단 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughPrisma 스키마에서 ChangesPrisma 스키마 정리
분쟁 메타 추출 폴링 및 진술 저장 흐름
BottomNavigation 중앙화 및 개별 페이지 제거
AI 모델 업그레이드 및 에러 로깅 개선
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
prisma/schema.prisma (1)
30-39:⚠️ Potential issue | 🔴 Critical
auditLog모델 부재로 인한 런타임 에러 발생 — 즉시 수정 필요스키마에서
AuditLog모델이 제거되었으나,src/app/api/user/me/route.ts:307에서 여전히prisma.auditLog.create()를 호출하고 있습니다. 이는 사용자 계정 삭제 엔드포인트에서 직접 런타임 에러를 야기합니다. 동시에docs/API_SPEC.md에는AuditLog기록 정책(라인 466, 583, 666, 919 등)과CalendarRecord생성 정책(라인 465)이 여전히 기술되어 있습니다. 스키마에서 모델을 제거한 경우, 이를 참조하는 모든 코드와 문서를 함께 정리해야 합니다.🤖 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 `@prisma/schema.prisma` around lines 30 - 39, The AuditLog model has been removed from the Prisma schema, but the code in src/app/api/user/me/route.ts still contains a call to prisma.auditLog.create() which will cause a runtime error. Remove the prisma.auditLog.create() call from the user account deletion endpoint logic. Additionally, update docs/API_SPEC.md to remove all references to AuditLog logging policies and CalendarRecord creation policies that are no longer supported by the schema (review lines 465, 466, 583, 666, 919 and any other mentions of these removed functionalities).
🤖 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 `@prisma/schema.prisma`:
- Around line 451-452: The `a_submitted` enum value in the dispute status enum
violates both naming conventions and the state machine contract. It lacks a
`@map` annotation that other enum values have (violating camelCase + `@map` naming
rules), and more critically, it is never referenced in any code and is not part
of the documented state transition flow (draft → waiting_opponent →
opponent_joined → both_submitted → judging → judged → closed/expired/deleted).
Remove the `a_submitted` line entirely from the enum definition in the Prisma
schema since it represents a dead state that should not exist.
In `@src/app/`(page)/disputes/[id]/page.tsx:
- Around line 45-47: When polling reaches MAX_POLL and stops (line 45-47 where
it returns false), the isExtractingMeta state is not being updated to reflect
this termination. This causes the spinner in the early return condition (lines
109-119) to continue displaying indefinitely even after polling has stopped.
Update the pollInterval callback that checks MAX_POLL to also set
isExtractingMeta to false when polling is terminated, ensuring the UI state
stays synchronized with the actual polling status.
In `@src/domains/dispute/dispute.hooks.ts`:
- Around line 10-15: The `refetchInterval` property type in the options
parameter of the `useDispute` function is incomplete. The current type
declaration only includes `number | false`, but TanStack React Query v5 also
supports a function form that accepts a query object and returns a number or
false. Extend the type definition of the `refetchInterval` property in the
options object to include the function form signature alongside the existing
number and false types to match the actual usage in disputes/[id]/page.tsx and
resolve the TypeScript error.
---
Outside diff comments:
In `@prisma/schema.prisma`:
- Around line 30-39: The AuditLog model has been removed from the Prisma schema,
but the code in src/app/api/user/me/route.ts still contains a call to
prisma.auditLog.create() which will cause a runtime error. Remove the
prisma.auditLog.create() call from the user account deletion endpoint logic.
Additionally, update docs/API_SPEC.md to remove all references to AuditLog
logging policies and CalendarRecord creation policies that are no longer
supported by the schema (review lines 465, 466, 583, 666, 919 and any other
mentions of these removed functionalities).
🪄 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: Repository UI (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: 48b50560-a6f6-4fde-9ce1-269e1c7be7d9
📒 Files selected for processing (11)
prisma/schema.prismasrc/app/(page)/disputes/[id]/page.tsxsrc/app/(page)/disputes/[id]/statement/page.tsxsrc/app/(page)/layout.tsxsrc/app/(page)/mypage/page.tsxsrc/app/(page)/records/page.tsxsrc/app/api/disputes/[id]/statements/route.tssrc/app/api/rooms/route.tssrc/domains/dispute/dispute.hooks.tssrc/lib/ai/judgment.tssrc/lib/ai/moderation.ts
💤 Files with no reviewable changes (2)
- src/app/(page)/mypage/page.tsx
- src/app/(page)/records/page.tsx
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 `@src/app/`(page)/layout.tsx:
- Around line 8-14: The hideNav variable definition is missing checks for the
root `/join` and `/auth` paths because the current conditions use
`startsWith('/join/')` and `startsWith('/auth/')` which require a trailing
slash. Add additional `pathname.startsWith()` checks in the hideNav variable to
also match `/join` and `/auth` without the trailing slashes, ensuring the
navigation is properly hidden for both the root paths and their child routes.
🪄 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: Repository UI (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: a649ec8c-ddf6-41d7-87c3-c77ded1cbbe4
📒 Files selected for processing (4)
prisma/schema.prismasrc/app/(page)/disputes/[id]/page.tsxsrc/app/(page)/layout.tsxsrc/domains/dispute/dispute.hooks.ts
💤 Files with no reviewable changes (1)
- prisma/schema.prisma
🚧 Files skipped from review as they are similar to previous changes (2)
- src/domains/dispute/dispute.hooks.ts
- src/app/(page)/disputes/[id]/page.tsx
| const hideNav = | ||
| pathname.endsWith('/statement') || | ||
| pathname.startsWith('/join/') || | ||
| pathname.startsWith('/login') || | ||
| pathname.startsWith('/auth/') || | ||
| pathname.startsWith('/terms') || | ||
| pathname.startsWith('/privacy') |
There was a problem hiding this comment.
/join, /auth 루트 경로가 hide 조건에서 누락됩니다.
Line 10, Line 12의 startsWith('/join/'), startsWith('/auth/')는 각각 /join, /auth를 포함하지 않아 하단 내비가 의도치 않게 노출될 수 있습니다.
수정 제안
const hideNav =
pathname.endsWith('/statement') ||
- pathname.startsWith('/join/') ||
+ pathname === '/join' ||
+ pathname.startsWith('/join/') ||
pathname.startsWith('/login') ||
- pathname.startsWith('/auth/') ||
+ pathname === '/auth' ||
+ pathname.startsWith('/auth/') ||
pathname.startsWith('/terms') ||
pathname.startsWith('/privacy')근거: PR 목표에 숨김 대상 경로가 /join, /login, /auth, /terms, /privacy로 명시되어 있습니다.
🤖 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/app/`(page)/layout.tsx around lines 8 - 14, The hideNav variable
definition is missing checks for the root `/join` and `/auth` paths because the
current conditions use `startsWith('/join/')` and `startsWith('/auth/')` which
require a trailing slash. Add additional `pathname.startsWith()` checks in the
hideNav variable to also match `/join` and `/auth` without the trailing slashes,
ensuring the navigation is properly hidden for both the root paths and their
child routes.
Summary
gemini-2.0-flash-lite미지원 →gemini-2.5-flash로 변경 (moderation, meta 추출)disputes/[id]페이지: 제목이 "새 사건"인 동안 2초마다 폴링, 최대 15회 후 중단(page)그룹 공통 BottomNavigation 레이아웃 적용 (/statement경로 제외)roomsPOST roomModeAI_ROOM수정 및 에러 로깅 추가Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit
릴리스 노트
New Features
Bug Fixes
Chores