과제 제출 기간 관련 로직 수정 ,코드 복구 및 짜잘한 수정 작업#470
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthrough문서 모듈화(대표 규칙 파일 포함)와 결제 성공 페이지 UI 재설계, 미션 생성 뮤테이션에 React Query 캐시 무효화 추가, 일부 컴포넌트 임포트명·아이콘·타이포그래피 클래스 수정이 포함된 변경입니다. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 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: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/app/(service)/payment/success/page.tsx (1)
344-358:⚠️ Potential issue | 🟡 Minor조건부
className조합은cn()으로 통일해 주세요.Line 344-358은 조건 분기에 따른 클래스 조합이므로
cn()유틸 사용 규칙에 맞춰 정리하는 편이 좋습니다.수정 예시
+import { cn } from '@/components/common/ui/(shadcn)/lib/utils'; - className={ - bold - ? 'font-designer-18b text-text-default' - : 'font-designer-16m text-text-subtle' - } + className={cn( + bold + ? 'font-designer-18b text-text-default' + : 'font-designer-16m text-text-subtle', + )} - className={ - bold - ? 'font-designer-18b text-text-default' - : 'font-designer-16m text-text-default' - } + className={cn( + bold + ? 'font-designer-18b text-text-default' + : 'font-designer-16m text-text-default', + )}As per coding guidelines "
**/*.{tsx,jsx}: Always usecn()utility for className composition. Never use template literal className strings."🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/app/`(service)/payment/success/page.tsx around lines 344 - 358, The conditional className strings used on the span elements that render {label} (using the bold boolean) should be replaced with the cn() utility: import cn if not already, and compute className via cn({ 'font-designer-18b text-text-default': bold, 'font-designer-16m text-text-subtle': !bold }) for the first span and similarly for the second span (use 'font-designer-18b text-text-default' when bold else 'font-designer-16m text-text-default'); update the className props on those span elements (the ones referencing bold and rendering {label}) to use cn() consistently.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/app/`(service)/payment/success/page.tsx:
- Around line 178-181: The InfoRow usage renders
paymentData?.amount?.toLocaleString() which can produce "undefined원" when amount
is missing; update the rendering in the InfoRow calls (the ones passing label
"상품 금액" and the other similar call around InfoRow at the later block) to provide
a safe fallback by checking paymentData?.amount (or using a nullish coalescing
fallback) before calling toLocaleString, and pass a formatted fallback string
(e.g., "-" or "0원") to the value prop so the UI never shows "undefined원".
- Line 147: Replace the forbidden Tailwind arbitrary width value in the payment
success page: remove the max-w-[860px] arbitrary class on the wrapper div (the
element with classes "rounded-150 bg-fill-neutral-subtle-default shadow-2
mx-auto w-full max-w-[860px] p-500") and swap it for the appropriate project
design-token class (e.g., the defined max-w token from your design system such
as max-w-<your-token-name> or container/token class used elsewhere) so the
layout uses a sanctioned project scale class instead of an arbitrary value.
---
Outside diff comments:
In `@src/app/`(service)/payment/success/page.tsx:
- Around line 344-358: The conditional className strings used on the span
elements that render {label} (using the bold boolean) should be replaced with
the cn() utility: import cn if not already, and compute className via cn({
'font-designer-18b text-text-default': bold, 'font-designer-16m
text-text-subtle': !bold }) for the first span and similarly for the second span
(use 'font-designer-18b text-text-default' when bold else 'font-designer-16m
text-text-default'); update the className props on those span elements (the ones
referencing bold and rendering {label}) to use cn() consistently.
🪄 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: e5e2036c-9d03-4eae-b929-fe17fce272e3
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (5)
CLAUDE.mdsrc/app/(service)/payment/success/page.tsxsrc/components/card/mission-card.tsxsrc/components/common/modals/create-mission-modal.tsxsrc/components/contents/mission-detail-content.tsx
| <InfoRow | ||
| label="상품 금액" | ||
| value={`${paymentData?.amount?.toLocaleString()}원`} | ||
| /> |
There was a problem hiding this comment.
금액이 없을 때 undefined원이 노출될 수 있습니다.
paymentData?.amount?.toLocaleString() 결과가 없으면 사용자에게 깨진 문자열이 보입니다. fallback을 명시해 주세요.
수정 예시
- value={`${paymentData?.amount?.toLocaleString()}원`}
+ value={
+ paymentData?.amount != null
+ ? `${paymentData.amount.toLocaleString()}원`
+ : '-'
+ }
- value={`${paymentData?.amount?.toLocaleString()}원`}
+ value={
+ paymentData?.amount != null
+ ? `${paymentData.amount.toLocaleString()}원`
+ : '-'
+ }Also applies to: 190-193
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/app/`(service)/payment/success/page.tsx around lines 178 - 181, The
InfoRow usage renders paymentData?.amount?.toLocaleString() which can produce
"undefined원" when amount is missing; update the rendering in the InfoRow calls
(the ones passing label "상품 금액" and the other similar call around InfoRow at the
later block) to provide a safe fallback by checking paymentData?.amount (or
using a nullish coalescing fallback) before calling toLocaleString, and pass a
formatted fallback string (e.g., "-" or "0원") to the value prop so the UI never
shows "undefined원".
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/components/card/my-homework-status-card.tsx (1)
36-51:⚠️ Potential issue | 🟡 Minor로딩 중/시작 전 상태를
제출 기간 종료로 묶어 표시하는 분기는 오해를 유발할 수 있습니다.현재 분기에서는
IN_PROGRESS가 아니면 모두 종료 메시지를 보여서, 미션 데이터 로딩 중(mission미정)이나NOT_STARTED에서도 “제출 기간이 종료되었습니다.”가 노출됩니다. 상태를 최소NOT_STARTED/ENDED로 분리하고, 로딩 중에는 중립 UI(예: 스켈레톤 또는 빈 상태)로 처리하는 게 안전합니다.제안 수정안
- const isSubmissionOpen = mission?.status === 'IN_PROGRESS'; + const missionStatus = mission?.status; + const isSubmissionOpen = missionStatus === 'IN_PROGRESS'; + const isMissionNotStarted = missionStatus === 'NOT_STARTED'; + const isMissionStatusReady = missionStatus !== undefined; ... - <span className="text-text-subtlest font-designer-14r"> - {isSubmissionOpen - ? '아직 과제를 제출하지 않았습니다.' - : '제출 기간이 종료되었습니다.'} - </span> - {isSubmissionOpen && <SubmitHomeworkModal missionId={missionId} />} + <span className="text-text-subtlest font-designer-14r"> + {!isMissionStatusReady + ? '과제 상태를 확인하는 중입니다.' + : isSubmissionOpen + ? '아직 과제를 제출하지 않았습니다.' + : isMissionNotStarted + ? '아직 제출 기간이 시작되지 않았습니다.' + : '제출 기간이 종료되었습니다.'} + </span> + {isSubmissionOpen && <SubmitHomeworkModal missionId={missionId} />}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/components/card/my-homework-status-card.tsx` around lines 36 - 51, The current rendering lumps mission undefined/loading and NOT_STARTED together as "제출 기간이 종료되었습니다."—change the conditional in the MyHomeworkStatusCard component so you explicitly handle mission being undefined (show a neutral/loading UI like a skeleton or empty state), treat mission.status === 'NOT_STARTED' as a "제출 기간이 아직 시작되지 않았습니다." message, and only show the "제출 기간이 종료되었습니다." message when mission.status === 'ENDED' (keep isSubmissionOpen defined as mission?.status === 'IN_PROGRESS' and only render SubmitHomeworkModal when mission exists and isSubmissionOpen is true); update checks referencing mission, isSubmissionOpen, and myHomework.homeworkStatus accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@src/components/card/my-homework-status-card.tsx`:
- Around line 36-51: The current rendering lumps mission undefined/loading and
NOT_STARTED together as "제출 기간이 종료되었습니다."—change the conditional in the
MyHomeworkStatusCard component so you explicitly handle mission being undefined
(show a neutral/loading UI like a skeleton or empty state), treat mission.status
=== 'NOT_STARTED' as a "제출 기간이 아직 시작되지 않았습니다." message, and only show the "제출
기간이 종료되었습니다." message when mission.status === 'ENDED' (keep isSubmissionOpen
defined as mission?.status === 'IN_PROGRESS' and only render SubmitHomeworkModal
when mission exists and isSubmissionOpen is true); update checks referencing
mission, isSubmissionOpen, and myHomework.homeworkStatus accordingly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 0f036e8d-f2c1-42f4-ae3b-0a94feeaad9c
📒 Files selected for processing (2)
src/components/card/my-homework-status-card.tsxsrc/components/contents/mission-detail-content.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
- src/components/contents/mission-detail-content.tsx
🌱 연관된 이슈
☘️ 작업 내용
🍀 참고사항
스크린샷 (선택)
Summary by CodeRabbit
UI/UX 개선
개선 사항
문서