Conversation
슬픔과 깨달음이 반대로 되어있었음...
Walkthrough감정 색상 매핑을 공통 확장 함수에서 디자인시스템의 Emotion 확장 속성(bgColor, textColor, graphicRes)으로 이동했고, EmotionTag 열거형과 기존 확장 함수 파일을 제거 및 디자인시스템에 core.model 의존성을 추가했습니다. 여러 UI와 상태에서 Changes
Sequence Diagram(s)sequenceDiagram
participant Model as core.model.Emotion
participant DS as core.designsystem (확장 속성)
participant UI as Feature UI
Note over Model,DS: 색상 매핑 위치 변경
UI->>Model: 감정(enum) 사용 (예: emotion / emotion.name)
Model->>DS: 요청 (확장 속성 접근)
DS-->>UI: `bgColor`, `textColor`, `graphicRes` 반환
UI->>UI: 색상/이미지 적용
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 분
Poem
Pre-merge checks and finishing touches✅ Passed checks (4 passed)
✨ Finishing touches
🧪 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 |
c0c4d7e to
fb6e598
Compare
emotionTag 사용하지 않는 프로퍼티(textColor, bgColor) 제거
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
gradle/libs.versions.toml(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: easyhooon
Repo: YAPP-Github/Reed-Android PR: 88
File: feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/RecordItem.kt:29-37
Timestamp: 2025-07-31T23:17:40.054Z
Learning: Reed-Android 프로젝트에서는 API가 준비되지 않은 상황에서 UI를 먼저 구현하고, API 연동 시점에 하드코딩된 데이터를 실제 데이터로 교체하는 개발 방식을 사용한다. RecordItem 컴포넌트의 emotionTags 매개변수도 API 연동 시점에 `text = emotionTags.joinToString(separator = "·") { "#$it" }`로 적용될 예정이다.
| compose-effects = "0.1.1" | ||
| compose-shadow = "2.0.4" | ||
| compose-stability-analyzer = "0.4.1" | ||
| compose-stability-analyzer = "0.4.2" |
There was a problem hiding this comment.
🧩 Analysis chain
compose-stability-analyzer 버전 업그레이드의 필요성 검증 필요
compose-stability-analyzer가 0.4.1에서 0.4.2로 패치 버전 업그레이드되었습니다. 이는 일반적으로 안전한 마이너 변경이지만, PR의 주요 변경사항(감정 색상 매핑 리팩토링)과의 연관성이 명확하지 않습니다.
🌐 Web query:
compose-stability-analyzer 0.4.2 변경사항 및 주요 업데이트 내용
💡 Result:
요청하신 버전(0.4.2)은 공식 릴리스에서 확인되지 않습니다. 현재 GitHub 릴리스의 최신 태그는 0.4.1(2025‑11‑02)이며, 해당 릴리스의 주요 변경사항은 아래와 같습니다: IntelliJ 플러그인 및 모듈 테스트 추가, Kotlin 컴파일러 플러그인 지원 관련 클래스(KotlinCompilerPluginSupportPlugin) 도입 및 StabilityInferred 어노테이션 검사 조정, 배포 준비 등. 자세한 로그는 GitHub 릴리스 노트를 확인하세요. [1]
원하시면 0.4.2 릴리스 여부를 계속 모니터링하거나(발행 시 알림) 0.4.1의 전체 변경내역(커밋/PR 링크 포함)을 내려받아 요약해 드리겠습니다.
출처: GitHub Releases — skydoves/compose-stability-analyzer. [1]
[1] https://github.com/skydoves/compose-stability-analyzer/releases
존재하지 않는 버전 0.4.2로 인한 빌드 실패 위험
compose-stability-analyzer의 최신 공식 릴리스는 0.4.1(Kotlin 2.2.21과 함께)이며, 0.4.2 버전은 공식 릴리스에서 확인되지 않습니다. 버전 카탈로그에 존재하지 않는 버전을 지정하면 Gradle 빌드가 실패할 가능성이 높습니다.
필수 조치:
- 버전을 0.4.1로 수정하거나, 0.4.2가 실제로 필요한 경우 해당 버전의 공식 릴리스 일정 확인 필요
- 감정 색상 매핑 리팩토링과 이 도구의 버전 업그레이드 간 연관성 검토
🤖 Prompt for AI Agents
gradle/libs.versions.toml lines 27-27: 현재 compose-stability-analyzer = "0.4.2"로
지정되어 있으나 공식 릴리스는 0.4.1까지 확인되므로 빌드 실패 위험이 있습니다; 버전을 "0.4.1"로 롤백하거나 0.4.2가 실제로
존재하고 필요한 경우 공식 릴리스/요구사항을 확인해 정식 버전으로 업데이트하고, 감정 색상 매핑 리팩토링과 버전 업그레이드 사이의 연관성을
검토해 호환성 문제가 없는지 확인하세요.
|
@seoyoon513 Emotion 확장 함수들 designsystem 모듈로 옮겨서 designsystem 모듈에 정의해둔 color 변수들 사용하는 방식으로 변경 하였습니다. 생각해보니 확장 함수를 꼭 common 모듈내에 extensions 패키지에만 정의해야만 사용할 필요는 없을 것 같더라구요. 확장 함수의 성격이 각 Emotion에 따라 color를 지정하는 것이므로 designsystem 모듈의 역할과도 맞닿아 있는 것 같습니다. |
|
@easyhooon 동의합니다! designsystem 모듈에 EmotionTag 이넘 클래스를 만든 이유가 Emotion과 관련된 모든 디자인 리소스를 통합 관리하면 좋겠다 라는 이유에서였는데요. model 모듈에 서버 모델을 따로 두고 디자인 리소스는 확장 함수로 접근하는 방식(지훈님 설계)으로 통일시키는 게 좋을 것 같습니다 ㅎㅎ
2차 서비스 고도화 때 해당 부분 변경이 반드시 있을 텐데 수정 포인트가 흩어져 있어서요. EmotionTag 의존하는 부분은 제가 수정했습니다~ |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/card/component/RecordCard.kt (1)
30-30: 타입 안정성 개선을 고려해보세요.현재
emotion: String파라미터를 받고displayName과 문자열 비교를 하고 있습니다.emotion: Emotion타입을 직접 받도록 변경하면 타입 안정성이 향상되고, when 표현식에서 enum 값을 직접 비교할 수 있습니다.예시:
internal fun RecordCard( quote: String, bookTitle: String, - emotion: String, + emotion: Emotion, modifier: Modifier = Modifier, ) { -private fun getEmotionCardImage(emotion: String): Int { +private fun getEmotionCardImage(emotion: Emotion): Int { return when (emotion) { - Emotion.WARM.displayName -> R.drawable.img_record_card_warm - Emotion.JOY.displayName -> R.drawable.img_record_card_joy - Emotion.SAD.displayName -> R.drawable.img_record_card_sad - Emotion.INSIGHT.displayName -> R.drawable.img_record_card_insight - else -> R.drawable.img_record_card_warm + Emotion.WARM -> R.drawable.img_record_card_warm + Emotion.JOY -> R.drawable.img_record_card_joy + Emotion.SAD -> R.drawable.img_record_card_sad + Emotion.INSIGHT -> R.drawable.img_record_card_insight } } private fun RecordCardPreview() { ReedTheme { RecordCard( quote = "...", bookTitle = "샤이닝", - emotion = Emotion.WARM.displayName, + emotion = Emotion.WARM, ) } }Also applies to: 77-84
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (15)
core/designsystem/src/main/kotlin/com/ninecraft/booket/core/designsystem/Emotion.kt(1 hunks)core/designsystem/src/main/kotlin/com/ninecraft/booket/core/designsystem/EmotionTag.kt(0 hunks)feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailPresenter.kt(1 hunks)feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/card/RecordCardPresenter.kt(1 hunks)feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/card/RecordCardUi.kt(1 hunks)feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/card/RecordCardUiState.kt(1 hunks)feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/card/component/RecordCard.kt(3 hunks)feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/record/RecordDetailPresenter.kt(1 hunks)feature/edit/src/main/kotlin/com/ninecraft/booket/feature/edit/emotion/EmotionEditPresenter.kt(3 hunks)feature/edit/src/main/kotlin/com/ninecraft/booket/feature/edit/emotion/EmotionEditUi.kt(5 hunks)feature/edit/src/main/kotlin/com/ninecraft/booket/feature/edit/emotion/EmotionEditUiState.kt(2 hunks)feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/register/RecordRegisterPresenter.kt(4 hunks)feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/register/RecordRegisterUiState.kt(3 hunks)feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/step/EmotionStep.kt(6 hunks)feature/screens/src/main/kotlin/com/ninecraft/booket/feature/screens/Screens.kt(1 hunks)
💤 Files with no reviewable changes (1)
- core/designsystem/src/main/kotlin/com/ninecraft/booket/core/designsystem/EmotionTag.kt
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: easyhooon
Repo: YAPP-Github/Reed-Android PR: 88
File: feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/RecordItem.kt:29-37
Timestamp: 2025-07-31T23:17:40.054Z
Learning: Reed-Android 프로젝트에서는 API가 준비되지 않은 상황에서 UI를 먼저 구현하고, API 연동 시점에 하드코딩된 데이터를 실제 데이터로 교체하는 개발 방식을 사용한다. RecordItem 컴포넌트의 emotionTags 매개변수도 API 연동 시점에 `text = emotionTags.joinToString(separator = "·") { "#$it" }`로 적용될 예정이다.
📚 Learning: 2025-07-31T23:17:40.054Z
Learnt from: easyhooon
Repo: YAPP-Github/Reed-Android PR: 88
File: feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/RecordItem.kt:29-37
Timestamp: 2025-07-31T23:17:40.054Z
Learning: Reed-Android 프로젝트에서는 API가 준비되지 않은 상황에서 UI를 먼저 구현하고, API 연동 시점에 하드코딩된 데이터를 실제 데이터로 교체하는 개발 방식을 사용한다. RecordItem 컴포넌트의 emotionTags 매개변수도 API 연동 시점에 `text = emotionTags.joinToString(separator = "·") { "#$it" }`로 적용될 예정이다.
Applied to files:
feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/card/RecordCardUiState.ktfeature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/record/RecordDetailPresenter.ktfeature/edit/src/main/kotlin/com/ninecraft/booket/feature/edit/emotion/EmotionEditUiState.ktfeature/record/src/main/kotlin/com/ninecraft/booket/feature/record/register/RecordRegisterUiState.ktfeature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/card/RecordCardPresenter.ktfeature/screens/src/main/kotlin/com/ninecraft/booket/feature/screens/Screens.ktfeature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailPresenter.ktfeature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/card/RecordCardUi.ktfeature/edit/src/main/kotlin/com/ninecraft/booket/feature/edit/emotion/EmotionEditUi.ktfeature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/card/component/RecordCard.ktfeature/record/src/main/kotlin/com/ninecraft/booket/feature/record/step/EmotionStep.ktfeature/edit/src/main/kotlin/com/ninecraft/booket/feature/edit/emotion/EmotionEditPresenter.ktfeature/record/src/main/kotlin/com/ninecraft/booket/feature/record/register/RecordRegisterPresenter.kt
📚 Learning: 2025-07-31T23:30:37.547Z
Learnt from: easyhooon
Repo: YAPP-Github/Reed-Android PR: 88
File: feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/record/RecordDetailPresenter.kt:18-47
Timestamp: 2025-07-31T23:30:37.547Z
Learning: In Circuit architecture, presenters receive the Screen object directly as a constructor parameter (e.g., Assisted private val screen: RecordDetailScreen), and screen parameters are accessed through this screen object (e.g., screen.recordId). Screen parameters should not be added as separate constructor parameters.
Applied to files:
feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailPresenter.kt
📚 Learning: 2025-08-28T12:25:54.058Z
Learnt from: easyhooon
Repo: YAPP-Github/Reed-Android PR: 174
File: feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchPresenter.kt:128-133
Timestamp: 2025-08-28T12:25:54.058Z
Learning: In BookSearchPresenter.kt, when a guest user tries to register a book and is redirected to login, the bottom sheet (isBookRegisterBottomSheetVisible) and selection state (selectedBookIsbn, selectedBookStatus) are intentionally kept open/preserved so that when the user returns from login, they can continue from where they left off without losing context.
Applied to files:
feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/register/RecordRegisterPresenter.kt
🧬 Code graph analysis (2)
feature/edit/src/main/kotlin/com/ninecraft/booket/feature/edit/emotion/EmotionEditUi.kt (1)
feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/step/EmotionStep.kt (1)
EmotionItem(123-158)
feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/step/EmotionStep.kt (1)
core/designsystem/src/main/kotlin/com/ninecraft/booket/core/designsystem/theme/Theme.kt (1)
ReedTheme(14-21)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Compose Stability Check
- GitHub Check: ci-build
🔇 Additional comments (13)
feature/edit/src/main/kotlin/com/ninecraft/booket/feature/edit/emotion/EmotionEditUiState.kt (1)
3-3: LGTM! 감정 모델 마이그레이션이 올바르게 적용되었습니다.
EmotionTag타입에서Emotion모델로의 전환이 깔끔하게 처리되었습니다. 필드명도emotionTags에서emotions로 일관성 있게 변경되었습니다.Also applies to: 12-12
feature/edit/src/main/kotlin/com/ninecraft/booket/feature/edit/emotion/EmotionEditUi.kt (1)
32-35: LGTM! UI 컴포넌트가 새로운 Emotion 모델을 올바르게 사용하고 있습니다.모든 변경사항이 일관성 있게 적용되었습니다:
emotion.displayName을 통한 감정명 접근emotion.graphicRes를 통한 리소스 참조- Preview 코드도
Emotion.entries사용으로 업데이트Also applies to: 104-110, 133-133, 160-160, 172-176
feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/record/RecordDetailPresenter.kt (1)
130-130: LGTM! RecordCardScreen 파라미터명이 올바르게 업데이트되었습니다.
emotionTag에서emotion으로의 파라미터명 변경이 일관성 있게 적용되었습니다.feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/card/RecordCardPresenter.kt (1)
77-77: LGTM! UI 상태 매핑이 올바르게 업데이트되었습니다.Screen 객체의
emotion필드를 UI 상태로 전달하는 로직이 정확하게 반영되었습니다.feature/screens/src/main/kotlin/com/ninecraft/booket/feature/screens/Screens.kt (1)
82-82: LGTM! Screen 파라미터명이 일관성 있게 변경되었습니다.
RecordCardScreen의 파라미터명이emotionTag에서emotion으로 명확하게 업데이트되어 전체 리팩토링과 일치합니다.feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/card/RecordCardUiState.kt (1)
14-14: LGTM! UI 상태 필드가 올바르게 리네이밍되었습니다.
emotionTag에서emotion으로의 필드명 변경이 깔끔하게 처리되었습니다.feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/card/RecordCardUi.kt (1)
86-86: LGTM! RecordCard 컴포넌트 호출이 올바르게 업데이트되었습니다.
state.emotion값을emotion파라미터로 전달하는 로직이 정확하게 반영되었습니다.feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailPresenter.kt (1)
309-309: LGTM! RecordCardScreen 생성 로직이 올바르게 업데이트되었습니다.감정 정보를
emotion파라미터로 전달하는 부분이 정확하게 반영되어 전체 리팩토링과 일치합니다.feature/edit/src/main/kotlin/com/ninecraft/booket/feature/edit/emotion/EmotionEditPresenter.kt (1)
9-9: 타입 마이그레이션이 올바르게 적용되었습니다.EmotionTag에서 Emotion으로의 변경이 일관되게 적용되었으며, import, entries 사용, 그리고 UI 상태 전달 모두 정확합니다.
Also applies to: 28-28, 53-53
feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/register/RecordRegisterPresenter.kt (1)
17-17: Emotion 타입으로의 마이그레이션이 정확합니다.API 호출 시
selectedEmotion?.displayName을 사용하여 서버와 통신하는 부분이 적절하며, 상태 관리에서도 Emotion 타입이 일관되게 사용되고 있습니다.Also applies to: 76-77, 257-257, 295-295
core/designsystem/src/main/kotlin/com/ninecraft/booket/core/designsystem/Emotion.kt (1)
14-36: 확장 속성을 통한 색상 매핑이 잘 구현되었습니다.감정별 배경색, 텍스트 색상, 그래픽 리소스를 Emotion 확장 속성으로 designsystem 모듈에 통합한 것은 좋은 설계 결정입니다. 순환 참조 문제를 해결하면서도 하드코딩을 제거하여 유지보수성이 향상되었습니다. when 표현식이 모든 Emotion 값을 처리하므로 타입 안전성도 보장됩니다.
Based on PR objectives
feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/register/RecordRegisterUiState.kt (1)
6-6: UI 상태와 이벤트의 타입 변경이 일관되게 적용되었습니다.
emotions,selectedEmotion, 그리고OnSelectEmotion이벤트 페이로드가 모두 Emotion 타입을 사용하도록 올바르게 업데이트되었습니다.Also applies to: 19-20, 49-49
feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/step/EmotionStep.kt (1)
32-32: 감정 선택 UI가 새로운 Emotion 타입과 확장 속성을 올바르게 활용하고 있습니다.
emotion.graphicRes확장 속성을 사용하여 그래픽 리소스를 가져오는 부분이 깔끔하게 구현되었으며, UI 상태와 프리뷰 모두 일관되게 업데이트되었습니다.Also applies to: 35-35, 48-48, 89-89, 125-125, 152-152, 163-163, 168-168
오우 emotionTag 쓰는 부분이 제법 많아서 emotion으로의 완전 대체가 살짝 조심스러웠는데, 속이 다 시원하네여~ |
🔗 관련 이슈
📙 작업 설명
🧪 테스트 내역 (선택)
📸 스크린샷 또는 시연 영상 (선택)
💬 추가 설명 or 리뷰 포인트 (선택)
Summary by CodeRabbit