feat(diary): 감정일기 작성 페이지 및 CategoryFilter emotion 모드 추가 - #81
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
📝 WalkthroughWalkthrough
Changes일기 작성 페이지 및 CategoryFilter 감정 모드 확장
추정 코드 리뷰 노력🎯 2 (Simple) | ⏱️ ~10 minutes 연관 가능성이 있는 PR
제안된 리뷰어
시 🐰
🚥 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)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/app/(page)/diary/create/page.tsx (1)
11-20: ⚡ Quick win감정 메타데이터를 단일 소스로 통합해 주세요.
EMOTIONS가 이 파일과CategoryFilter에 중복 정의되어 있어, 감정 키/라벨 변경 시 쉽게 불일치가 발생합니다. 공용 상수(예:src/types/diary.ts또는 별도 constants 파일)로 추출해 두 컴포넌트가 동일한 데이터를 참조하도록 맞추는 편이 안전합니다.♻️ 예시 리팩터링
-const EMOTIONS: { type: EmotionType; label: string }[] = [ - { type: 'happy', label: '기쁨' }, - { type: 'sad', label: '슬픔' }, - { type: 'neutral', label: '보통' }, - { type: 'annoyed', label: '짜증' }, - { type: 'angry', label: '화남' }, -]; +import { EMOTIONS } from '`@/types/diary`'; ... -const [emotion, setEmotion] = useState<EmotionType>(EMOTIONS[1].type); +const [emotion, setEmotion] = useState<EmotionType>(EMOTIONS[1].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 `@src/app/`(page)/diary/create/page.tsx around lines 11 - 20, Extract the EMOTIONS constant array from the DiaryCreate function to a shared, centralized location such as a constants file or types file that can be imported by both this component and the CategoryFilter component. Remove the duplicate EMOTIONS definition from the DiaryCreate function and update the useState initialization to reference the extracted constant from the new shared location. Ensure that CategoryFilter is also updated to import and use the same centralized EMOTIONS constant instead of its own duplicate definition.
🤖 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.
Nitpick comments:
In `@src/app/`(page)/diary/create/page.tsx:
- Around line 11-20: Extract the EMOTIONS constant array from the DiaryCreate
function to a shared, centralized location such as a constants file or types
file that can be imported by both this component and the CategoryFilter
component. Remove the duplicate EMOTIONS definition from the DiaryCreate
function and update the useState initialization to reference the extracted
constant from the new shared location. Ensure that CategoryFilter is also
updated to import and use the same centralized EMOTIONS constant instead of its
own duplicate definition.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: 2393f02a-fbff-4db6-a27a-caee91167988
⛔ Files ignored due to path filters (11)
public/images/icons/emotionButton/emotion-angry.svgis excluded by!**/*.svgpublic/images/icons/emotionButton/emotion-annoyed.svgis excluded by!**/*.svgpublic/images/icons/emotionButton/emotion-happy.svgis excluded by!**/*.svgpublic/images/icons/emotionButton/emotion-neutral.svgis excluded by!**/*.svgpublic/images/icons/emotionButton/emotion-sad.svgis excluded by!**/*.svgpublic/images/icons/emotions/emotion-angry.svgis excluded by!**/*.svgpublic/images/icons/emotions/emotion-annoyed.svgis excluded by!**/*.svgpublic/images/icons/emotions/emotion-happy.svgis excluded by!**/*.svgpublic/images/icons/emotions/emotion-irritated.svgis excluded by!**/*.svgpublic/images/icons/emotions/emotion-neutral.svgis excluded by!**/*.svgpublic/images/icons/emotions/emotion-sad.svgis excluded by!**/*.svg
📒 Files selected for processing (5)
src/app/(page)/diary/create/page.module.scsssrc/app/(page)/diary/create/page.tsxsrc/components/ui/CategoryFilter.module.scsssrc/components/ui/CategoryFilter.tsxsrc/types/diary.ts
Summary by CodeRabbit
릴리스 노트
새로운 기능
스타일
기타