Skip to content

refactor: emotionPairs chunked 연산 remember 적용#133

Merged
easyhooon merged 2 commits intodevelopfrom
BOOK-248-refactor/#132
Aug 10, 2025
Merged

refactor: emotionPairs chunked 연산 remember 적용#133
easyhooon merged 2 commits intodevelopfrom
BOOK-248-refactor/#132

Conversation

@easyhooon
Copy link
Copy Markdown
Contributor

@easyhooon easyhooon commented Aug 9, 2025

🔗 관련 이슈

📙 작업 설명

  • 리컴포지션마다 List chuncked 연산과 새 List 인스턴스 생성을 방지

🧪 테스트 내역 (선택)

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

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

Summary by CodeRabbit

  • 리팩터링
    • 감정 태그 목록의 내부 처리 방식을 최적화하여 앱의 성능이 향상되었습니다. 사용자 경험이나 UI에는 변화가 없습니다.
  • 기타
    • 앱 버전명이 "1.0"에서 "1.0.0"으로 업데이트되었습니다.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Aug 9, 2025

Walkthrough

emotionPairs 리스트의 생성 위치가 LazyColumn 내부에서 외부로 이동하고, remember로 감싸 recomposition 시 불필요한 재계산을 방지하도록 리팩토링되었습니다. 로직과 UI 동작에는 변화가 없으며, 효율적인 recomposition만을 목표로 한 변경입니다.

Changes

Cohort / File(s) Change Summary
EmotionStep recomposition 최적화
feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/step/EmotionStep.kt
emotionPairs 리스트를 LazyColumn 외부에서 remember로 캐싱하여 recomposition 효율 개선. 기존 chunking 로직은 동일하며, UI/로직 변화 없음.
버전명 상수 변경
build-logic/src/main/kotlin/com/ninecraft/booket/convention/ApplicationConstants.kt
VERSION_NAME 상수를 "1.0"에서 "1.0.0"으로 변경. 기능적 변경 없음.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Assessment against linked issues

Objective Addressed Explanation
불필요한 코드 제거, 성능 개선 (#132)

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
VERSION_NAME 상수 변경 (build-logic/src/main/kotlin/com/ninecraft/booket/convention/ApplicationConstants.kt) 버전 명칭 변경은 linked issue #132의 리팩토링 및 recomposition 최적화와 직접 관련 없음.

Poem

감정 태그 토끼가 뛰노네,
recomposition 덜어내며,
remember 품에 안고서
효율성 한껏 높였네!
캐싱의 힘을 보여주니
코드 리뷰도 가볍게,
토끼도 미소 짓네 🐇✨

Note

🔌 MCP (Model Context Protocol) integration is now available in Early Access!

Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 639ce2d and 43467f0.

📒 Files selected for processing (1)
  • build-logic/src/main/kotlin/com/ninecraft/booket/convention/ApplicationConstants.kt (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • build-logic/src/main/kotlin/com/ninecraft/booket/convention/ApplicationConstants.kt
⏰ 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). (1)
  • GitHub Check: ci-build
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch BOOK-248-refactor/#132

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/step/EmotionStep.kt (1)

46-47: chunked 메모이제이션 OK — LazyColumn item key 추가 제안

remember(state.emotionTags)로 계산 캐시하는 방향 좋습니다. 리스트 변경 시 아이템 식별 안정성을 위해 itemskey를 부여하면 스크롤/애니메이션/재구성 효율이 더 좋아집니다. EmotionTag가 enum이라면 첫 요소의 name을 키로 쓰는 방식이 간단합니다.

다음과 같이 적용을 제안합니다:

-            items(emotionPairs) { pair ->
+            items(
+                items = emotionPairs,
+                key = { pair -> pair.first().name } // enum 가정
+            ) { pair ->

만약 enum이 아니라면 pair.joinToString { it.toString() } 또는 도메인에서 정의한 고유 id를 활용해 주세요.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e872086 and 639ce2d.

📒 Files selected for processing (1)
  • feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/step/EmotionStep.kt (2 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: easyhooon
PR: YAPP-Github/Reed-Android#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" }`로 적용될 예정이다.
Learnt from: easyhooon
PR: YAPP-Github/Reed-Android#88
File: feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/RecordsCollection.kt:25-59
Timestamp: 2025-07-31T23:22:02.816Z
Learning: BookDetailScreen의 RecordsCollection 컴포넌트는 상위 Column의 verticalScroll과 LazyColumn의 무한 스크롤을 동시에 지원해야 하는 중첩 스크롤 시나리오입니다. LazyColumn에 고정 높이를 설정하지 않으면 앱이 충돌하는 이슈가 있어서, 현재는 높이를 계산하여 설정하고 userScrollEnabled = false로 구현되어 있습니다. 향후 InfiniteLazyColumn과 nestedScrollConnection을 도입하여 전체 화면 스크롤 + LazyColumn 무한 스크롤을 지원할 예정입니다.
📚 Learning: 2025-07-31T23:17:40.054Z
Learnt from: easyhooon
PR: YAPP-Github/Reed-Android#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/record/src/main/kotlin/com/ninecraft/booket/feature/record/step/EmotionStep.kt
📚 Learning: 2025-07-28T18:08:47.298Z
Learnt from: seoyoon513
PR: YAPP-Github/Reed-Android#72
File: feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/ocr/component/CameraFrame.kt:21-82
Timestamp: 2025-07-28T18:08:47.298Z
Learning: Jetpack Compose에서 scale() 변환은 시각적 변환만 적용하며 레이아웃 좌표계는 변경하지 않는다. 따라서 scale(scaleX = -1f, scaleY = -1f)로 반전된 아이콘에서 padding()은 원래 레이아웃 기준으로 동작하므로, 시각적으로 올바른 위치를 위해서는 변환 전 좌표계 기준으로 padding을 설정해야 한다.

Applied to files:

  • feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/step/EmotionStep.kt
⏰ 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). (1)
  • GitHub Check: ci-build
🔇 Additional comments (1)
feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/step/EmotionStep.kt (1)

19-19: recomposition 최적화에 필요한 remember import 추가 적절

불필요한 재계산 방지 목적과 정확히 부합합니다.

Copy link
Copy Markdown

@jisungbin jisungbin left a comment

Choose a reason for hiding this comment

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

리뷰 반영 감사합니다!

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.

👍👍👍

@easyhooon easyhooon merged commit 19cc8fc into develop Aug 10, 2025
3 checks passed
@easyhooon easyhooon deleted the BOOK-248-refactor/#132 branch August 10, 2025 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BOOK-248/refactor] 도서 기록 감정 선택 화면 Recomposition 최적화

3 participants