Skip to content

fix: 감정 통계 > 가장 많이 느낀 감정 폰트 컬러 주황색으로 고정됨#269

Merged
easyhooon merged 4 commits into
developfrom
BOOK-504-fix/#268
Feb 14, 2026
Merged

fix: 감정 통계 > 가장 많이 느낀 감정 폰트 컬러 주황색으로 고정됨#269
easyhooon merged 4 commits into
developfrom
BOOK-504-fix/#268

Conversation

@easyhooon
Copy link
Copy Markdown
Contributor

@easyhooon easyhooon commented Feb 12, 2026

🔗 관련 이슈

📙 작업 설명

  • 가장 많이 느낀 감정 각 감정별 색상 적용
  • 기타 감정이 가장 많이 느낀 감정인 경우 문구 변경
  • 대표 감정 텍스트 수직 중앙 정렬 적용

🧪 테스트 내역 (선택)

  • 주요 기능 정상 동작 확인
  • 브라우저/기기에서 동작 확인
  • 엣지 케이스 테스트 완료
  • 기존 기능 영향 없음

📸 스크린샷 또는 시연 영상 (선택)

image

💬 추가 설명 or 리뷰 포인트 (선택)

image

Summary by CodeRabbit

  • 새로운 기능

    • 감정별 기본(프라이머리) 색상 적용으로 헤더 및 UI에 일관된 색상 반영
    • "기타" 감정에 대한 지역화된 이름 및 설명 추가
    • 감정 카드 표시를 긍정적(카운트>0)인 항목만 필터링해 고정된 순서로 출력
  • 개선

    • 헤더 텍스트에 감정별 색상 적용 및 설명 문구를 상황에 맞게 로컬라이즈
    • 총합 등 반복 계산을 재사용해 렌더링 효율성 향상

'대표 감정'감정을 많이 느꼈어요 <- Text CenterVertically 적용
'기타' 감정이 대표 감정인 경우, "감정으로 문장만 기록했어요" 문구 적용
@github-actions github-actions Bot added the 🐞 fix Something isn't working label Feb 12, 2026
@github-actions github-actions Bot requested a review from seoyoon513 February 12, 2026 14:10
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 14, 2026

워크스루

감정 코드에 primaryEmotionColor 확장 속성을 추가해 감정별 기본 색상을 매핑하고, CollectedSeeds 컴포넌트가 이 매핑과 조건부 지역화 문자열을 사용하도록 업데이트했습니다.

변경 사항

Cohort / File(s) Summary
디자인 시스템 색상 매핑
core/designsystem/src/main/kotlin/com/ninecraft/booket/core/designsystem/EmotionCode.kt
EmotionCode.primaryEmotionColor: Color 확장 속성 추가 — WARMTH→Yellow700, JOY→Orange400, SADNESS→Blue500, INSIGHT→Violet500, OTHER→Neutral500. 관련 색상 및 기존 OtherBgColor/OtherTextColor 임포트 정리.
UI 컴포넌트 업데이트
feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/CollectedSeeds.kt
감정 카드 렌더링을 비어있지 않은 감정만 필터하고 고정 색상 대신 primaryEmotionColor 사용. OTHER일 때 지역화된 이름/설명 적용, 표시 순서(EMOTION_DISPLAY_ORDER) 도입, remember로 재컴포지션 최적화. 프리뷰 데이터 및 문자열 리소스 호출 추가.
지역화 문자열
feature/detail/src/main/res/values/strings.xml
collected_seed_emotion_description, collected_seed_other_emotion_name, collected_seed_other_emotion_description 3개 문자열 리소스 추가.

예상 코드 리뷰 노력

🎯 2 (단순) | ⏱️ ~12분

🐰 감정에 색 입혀진 새 같아
WARMTH는 노랑, JOY는 주황이 어울려 ✨
SADNESS 파랑, INSIGHT 보라로 빛나고
OTHER는 중립색으로 살포시 미소 지어
다시는 한 색만 고집하지 않아 🌈

🚥 Pre-merge checks | ✅ 4 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Merge Conflict Detection ⚠️ Warning ⚠️ Unable to check for merge conflicts: Invalid branch name format
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목은 '감정 통계 > 가장 많이 느낀 감정 폰트 컬러 주황색으로 고정됨'으로, 링크된 이슈 #268의 버그를 정확하게 설명하고 있으며 변경사항의 핵심(주황색 고정 문제 해결)을 명확히 요약하고 있습니다.
Linked Issues check ✅ Passed PR이 링크된 이슈 #268의 모든 코딩 목표를 충족합니다: (1) EmotionCode에 primaryEmotionColor 속성을 추가하여 각 감정별 색상 매핑 [268], (2) CollectedSeeds 컴포넌트에서 primaryEmotionColor 적용으로 고정 주황색 제거 [268], (3) '기타' 감정에 대한 특수 텍스트 처리 추가 [268].
Out of Scope Changes check ✅ Passed 모든 변경사항이 이슈 #268의 범위 내입니다: EmotionCode 컬러 매핑 추가, CollectedSeeds 감정별 색상 적용, '기타' 감정 특수 처리, 필요한 문자열 리소스 추가.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch BOOK-504-fix/#268
⚔️ Resolve merge conflicts (beta)
  • Auto-commit resolved conflicts to branch BOOK-504-fix/#268
  • Create stacked PR with resolved conflicts
  • Post resolved changes as copyable diffs in a comment

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/CollectedSeeds.kt (2)

47-53: EMOTION_DISPLAY_ORDER 상수 도입은 깔끔합니다.

감정 표시 순서를 명확히 정의하여 필터링과 정렬에 활용하는 접근이 좋습니다.

한 가지 확인 사항: EmotionRatioBar(Line 206)에서는 EmotionCode.entries를 직접 순회하고 있어, 만약 EmotionCode에 이 5가지 외의 항목이 추가될 경우 비율 바에는 표시되지만 하단 카드에는 표시되지 않는 불일치가 발생할 수 있습니다. 현재는 문제 없지만 향후 확장 시 주의가 필요합니다.


152-177: 핵심 수정: 감정별 색상 적용 및 '기타' 처리가 잘 구현되었습니다.

  • primaryEmotionColor 확장 프로퍼티를 사용하여 고정 주황색 대신 각 감정별 색상을 적용한 것이 PR 목표에 부합합니다.
  • EmotionCode.OTHER일 때 별도의 문자열 리소스(collected_seed_other_emotion_name, collected_seed_other_emotion_description)를 사용하는 분기 처리도 디자인 논의(PR 이미지 2)에 맞게 구현되었습니다.

하나의 개선 제안: primaryEmotion.code == EmotionCode.OTHER 체크가 Line 155와 Line 168에서 중복됩니다. 사소한 부분이지만, isOther 같은 로컬 변수로 추출하면 가독성이 올라갑니다.

♻️ 중복 조건 추출 제안
 Row(
     verticalAlignment = Alignment.CenterVertically,
 ) {
+    val isOther = primaryEmotion.code == EmotionCode.OTHER
-    val emotionDisplayName = if (primaryEmotion.code == EmotionCode.OTHER) {
+    val emotionDisplayName = if (isOther) {
         stringResource(R.string.collected_seed_other_emotion_name)
     } else {
         primaryEmotion.code.displayName
     }
     Text(
         text = "'$emotionDisplayName'",
         color = primaryEmotion.code.primaryEmotionColor,
         style = ReedTheme.typography.label1SemiBold,
     )
     Spacer(modifier = Modifier.width(ReedTheme.spacing.spacing1))
     Text(
         text = stringResource(
-            if (primaryEmotion.code == EmotionCode.OTHER) {
+            if (isOther) {
                 R.string.collected_seed_other_emotion_description
             } else {
                 R.string.collected_seed_emotion_description
             },
         ),

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@seoyoon513 seoyoon513 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

동작 이상 없네요!! approve~!

@easyhooon easyhooon merged commit 44fabb9 into develop Feb 14, 2026
4 checks passed
@easyhooon easyhooon deleted the BOOK-504-fix/#268 branch February 14, 2026 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 fix Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BOOK-504/fix] 감정 통계 > 가장 많이 느낀 감정 폰트 컬러 주황색으로 고정됨

2 participants