Skip to content

feat: 홈 화면 API 연동#90

Merged
seoyoon513 merged 10 commits intodevelopfrom
BOOK-169-feature/#71
Aug 1, 2025
Merged

feat: 홈 화면 API 연동#90
seoyoon513 merged 10 commits intodevelopfrom
BOOK-169-feature/#71

Conversation

@seoyoon513
Copy link
Copy Markdown
Contributor

@seoyoon513 seoyoon513 commented Aug 1, 2025

🔗 관련 이슈

📙 작업 설명

  • 홈 API 연동
  • 자잘한 UI 수정

🧪 테스트 내역

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

📸 스크린샷 또는 시연 영상

기능 미리보기 기능 미리보기
Empty View 책 있을 때

Summary by CodeRabbit

  • 신규 기능

    • 최근 도서 목록을 서버에서 불러와 홈 화면에 표시하는 기능이 추가되었습니다.
    • 최근 도서가 없을 경우, 등록을 유도하는 안내 카드가 표시됩니다.
    • 홈 화면에서 토스트 메시지로 사용자 알림을 제공하는 기능이 추가되었습니다.
  • UI 개선

    • 홈 화면의 도서 카드가 실제 데이터 기반으로 동적으로 표시됩니다.
    • 도서 카드 UI가 개선되어 제목, 저자, 출판사 정보가 보기 좋게 정렬되고, 길이가 길 경우 말줄임표가 적용됩니다.
    • 도서 상세 및 기록 버튼 클릭 시 도서의 식별자가 전달됩니다.
    • 도서 카드 클릭 영역이 도서 표지 이미지로 조정되어 사용자 경험이 향상되었습니다.
  • 버그 수정

    • 더미 데이터 사용이 제거되어 실제 데이터만 표시됩니다.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Aug 1, 2025

Walkthrough

홈 화면의 최근 도서 목록을 API와 연동하는 기능이 추가되었습니다. 네트워크 응답, 도메인 모델, 매퍼, 저장소, DI, 프레젠터, UI 상태, 컴포저블, 카드 컴포넌트 등 전체 레이어에 걸쳐 새로운 구조와 흐름이 구현되었습니다. 기존 더미 데이터 및 임시 UI는 제거되었습니다.

Changes

Cohort / File(s) Change Summary
API 및 네트워크 응답 정의
core/network/src/main/kotlin/com/ninecraft/booket/core/network/response/HomeResponse.kt, core/network/src/main/kotlin/com/ninecraft/booket/core/network/service/ReedService.kt
홈 화면용 HomeResponse, RecentBook 데이터 클래스와 API 엔드포인트(getHome) 추가.
도메인 모델 및 매퍼
core/model/src/main/kotlin/com/ninecraft/booket/core/model/HomeModel.kt, core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/mapper/ResponseToModel.kt
HomeModel, RecentBookModel 도메인 모델 및 네트워크 응답→도메인 모델 매핑 함수 추가.
저장소 인터페이스 및 구현
core/data/api/src/main/kotlin/com/ninecraft/booket/core/data/api/repository/HomeRepository.kt, core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/repository/DefaultHomeRepository.kt, core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/di/RepositoryModule.kt
HomeRepository 인터페이스, 구현체(DefaultHomeRepository), DI 바인딩 추가.
홈 프레젠터 및 UI 상태
feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/HomePresenter.kt, feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/HomeUiState.kt
프레젠터에서 API 연동 및 상태 관리, UI 상태에 최근 도서 리스트 반영, 이벤트 파라미터 구조 변경.
홈 UI 및 컴포넌트
feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/HomeUi.kt, feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/component/BookCard.kt
더미 데이터 제거, API 데이터 기반 렌더링, BookCard/EmptyBookCard 컴포넌트 개선, 터치 영역 제한, 리소스 이미지 적용 등.
사이드 이펙트 처리
feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/HandleHomeSideEffects.kt
HomeUiState의 사이드 이펙트 처리용 컴포저블 추가, 토스트 메시지 표시 기능 구현.

Sequence Diagram(s)

sequenceDiagram
    participant UI as HomeContent (Composable)
    participant Presenter as HomePresenter
    participant Repo as HomeRepository/DefaultHomeRepository
    participant Network as ReedService

    UI->>Presenter: present()
    activate Presenter
    Presenter->>Repo: getHome()
    activate Repo
    Repo->>Network: getHome()
    activate Network
    Network-->>Repo: HomeResponse
    deactivate Network
    Repo-->>Presenter: Result<HomeModel>
    deactivate Repo
    Presenter-->>UI: HomeUiState(recentBooks)
    deactivate Presenter
    UI->>UI: 렌더 recentBooks (BookCard/EmptyBookCard)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Assessment against linked issues

Objective Addressed Explanation
EmptyBookCard에 그래픽 리소스 넣기 (#71)
BookCard 터치 영역 썸네일로 한정 (#71)
홈 화면 API 연동 (#71)

Assessment against linked issues: Out-of-scope changes

(해당 변경사항 내에서 요구사항 외의 변경은 발견되지 않았습니다.)

Suggested reviewers

  • easyhooon

Poem

🐰
새 책 향기 가득한 홈,
API 따라 책이 쏙쏙!
카드엔 터치, 썸네일만 콕,
비어 있으면 귀여운 그림 똑!
리뷰어님, 이 변화와 함께
토끼도 깡총깡총 춤을 춥니다!
📚✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ 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-169-feature/#71

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.
    • @coderabbitai modularize this function.
  • 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.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

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 (3)
core/network/src/main/kotlin/com/ninecraft/booket/core/network/response/HomeResponse.kt (1)

12-28: RecentBook 데이터 모델이 잘 설계되었습니다.

도서 정보에 필요한 모든 필드가 포함되어 있고, @SerialName을 통한 JSON 매핑도 적절합니다. 다만 lastRecordedAt이 String 타입인 점을 확인해 주세요.

lastRecordedAt 필드가 String 타입으로 되어 있는데, 날짜/시간 포맷이 명확한지 확인하시기 바랍니다. 필요하다면 주석으로 예상 포맷을 명시하는 것을 고려해보세요.

feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/HomeUiState.kt (1)

21-27: 사용되지 않는 Book 데이터 클래스 정리 필요

API 연동 후 RecentBookModel을 사용하게 되면서 기존 Book 클래스는 더 이상 사용되지 않는 것으로 보입니다. 코드 정리를 위해 제거를 고려해보세요.

feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/component/BookCard.kt (1)

259-263: Preview에서 RecentBookModel 사용이 적절합니다.

Preview 함수가 새로운 RecentBookModel을 사용하도록 업데이트되어 개발 시 올바른 데이터 구조를 확인할 수 있습니다. 다만 recordCountcoverImageUrl 등 일부 프로퍼티가 누락되어 있습니다.

Preview의 완성도를 위해 모든 프로퍼티를 포함하는 것을 고려해보세요:

 recentBookInfo = RecentBookModel(
     title = "여름은 오래 그곳에 남아",
     author = "마쓰이에 마사시",
     publisher = "비채",
+    coverImageUrl = "",
+    recordCount = 5,
+    userBookId = 1L,
 ),
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5eb114c and 0441bfc.

⛔ Files ignored due to path filters (1)
  • feature/home/src/main/res/drawable/img_empty_book.png is excluded by !**/*.png
📒 Files selected for processing (11)
  • core/data/api/src/main/kotlin/com/ninecraft/booket/core/data/api/repository/HomeRepository.kt (1 hunks)
  • core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/di/RepositoryModule.kt (2 hunks)
  • core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/mapper/ResponseToModel.kt (2 hunks)
  • core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/repository/DefaultHomeRepository.kt (1 hunks)
  • core/model/src/main/kotlin/com/ninecraft/booket/core/model/HomeModel.kt (1 hunks)
  • core/network/src/main/kotlin/com/ninecraft/booket/core/network/response/HomeResponse.kt (1 hunks)
  • core/network/src/main/kotlin/com/ninecraft/booket/core/network/service/ReedService.kt (2 hunks)
  • feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/HomePresenter.kt (3 hunks)
  • feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/HomeUi.kt (2 hunks)
  • feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/HomeUiState.kt (1 hunks)
  • feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/component/BookCard.kt (9 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: seoyoon513
PR: YAPP-Github/Reed-Android#63
File: feature/library/src/main/kotlin/com/ninecraft/booket/feature/library/LibraryPresenter.kt:28-53
Timestamp: 2025-07-22T05:19:10.071Z
Learning: feature/library의 LibraryPresenter에서 현재 FilterChipState의 카운트 값들은 UI 확인용 더미 데이터이며, API가 준비되면 실제 데이터로 교체될 예정입니다.
Learnt from: seoyoon513
PR: YAPP-Github/Reed-Android#46
File: feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/component/InfiniteLazyColumn.kt:83-95
Timestamp: 2025-07-14T00:46:03.843Z
Learning: seoyoon513과 팀은 한국어 주석을 선호하며, 한국어 주석을 영어로 번역하라는 제안을 하지 않아야 함
Learnt from: seoyoon513
PR: YAPP-Github/Reed-Android#75
File: feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/HomeUi.kt:0-0
Timestamp: 2025-07-29T06:07:11.727Z
Learning: seoyoon513 팀에서는 UI 구현 단계에서 더미 데이터를 하드코딩하여 화면을 먼저 구현하고, 이후 서버 연동 시점에 실제 데이터로 교체하는 개발 방식을 사용합니다.
📚 Learning: reed-android 프로젝트에서는 `booket.android.feature` convention plugin을 사용하여 feature 모듈들의 공통 의존성을 관리한다. 이 p...
Learnt from: easyhooon
PR: YAPP-Github/Reed-Android#61
File: feature/webview/build.gradle.kts:17-21
Timestamp: 2025-07-20T12:34:23.786Z
Learning: Reed-Android 프로젝트에서는 `booket.android.feature` convention plugin을 사용하여 feature 모듈들의 공통 의존성을 관리한다. 이 plugin은 Circuit, Compose, 그리고 core 모듈들의 의존성을 자동으로 포함하므로, 각 feature 모듈의 build.gradle.kts에서는 특별한 의존성(예: libs.logger, libs.kakao.auth)만 별도로 선언하면 된다.

Applied to files:

  • feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/component/BookCard.kt
  • feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/HomeUi.kt
📚 Learning: the project uses kotlinx serialization with json configuration that includes `ignoreunknownkeys = tr...
Learnt from: easyhooon
PR: YAPP-Github/Reed-Android#46
File: core/network/src/main/kotlin/com/ninecraft/booket/core/network/response/BookSearchResponse.kt:33-44
Timestamp: 2025-07-14T00:51:38.952Z
Learning: The project uses Kotlinx Serialization with JSON configuration that includes `ignoreUnknownKeys = true`, `encodeDefaults = true`, `isLenient = true`, and `prettyPrint = true` to handle API response parsing robustly, making additional null safety measures less critical if the API consistently provides all expected fields.

Applied to files:

  • core/network/src/main/kotlin/com/ninecraft/booket/core/network/response/HomeResponse.kt
🧬 Code Graph Analysis (2)
core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/repository/DefaultHomeRepository.kt (1)
core/common/src/main/kotlin/com/ninecraft/booket/core/common/utils/RunSuspendCatching.kt (1)
  • runSuspendCatching (16-30)
feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/HomeUi.kt (1)
feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/component/BookCard.kt (2)
  • EmptyBookCard (193-252)
  • BookCard (48-191)
⏰ 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 (26)
core/data/api/src/main/kotlin/com/ninecraft/booket/core/data/api/repository/HomeRepository.kt (1)

5-7: 깔끔한 인터페이스 설계입니다.

Result 타입을 사용한 에러 핸들링과 suspend 함수를 통한 비동기 처리가 적절히 구현되어 있습니다. 단일 책임 원칙을 잘 따르고 있습니다.

core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/di/RepositoryModule.kt (2)

5-5: 필요한 import 추가가 적절합니다.

HomeRepository와 DefaultHomeRepository import가 정확히 추가되었습니다.

Also applies to: 10-10


39-41: DI 바인딩이 올바르게 구성되었습니다.

기존 패턴과 일관성 있게 @BINDS@singleton 어노테이션을 사용하여 HomeRepository를 바인딩했습니다.

core/network/src/main/kotlin/com/ninecraft/booket/core/network/service/ReedService.kt (2)

11-11: 필요한 import가 적절히 추가되었습니다.

HomeResponse import가 정확히 추가되었습니다.


81-85: API 엔드포인트 설계가 적절합니다.

GET 방식과 기본 limit 값(3)이 홈 화면 최근 도서 조회에 적합합니다. 주석으로 인증 필요 여부를 명시한 것도 좋습니다.

core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/repository/DefaultHomeRepository.kt (1)

9-15: 우수한 Repository 구현입니다.

생성자 주입, runSuspendCatching을 통한 에러 핸들링, 그리고 응답 매핑 분리가 잘 구현되어 있습니다. 간결하면서도 모든 필요한 기능을 포함하고 있습니다.

core/network/src/main/kotlin/com/ninecraft/booket/core/network/response/HomeResponse.kt (1)

6-10: HomeResponse 구조가 적절합니다.

recentBooks 리스트를 포함한 간단하고 명확한 구조입니다. @SerialName 어노테이션 사용도 적절합니다.

feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/HomeUi.kt (2)

30-30: 새로운 EmptyBookCard 컴포넌트 import 추가

빈 상태 UI를 위한 EmptyBookCard 컴포넌트가 정상적으로 import되었습니다.


101-143: 홈 화면 API 연동을 위한 조건부 렌더링 구현

실제 데이터 기반의 조건부 렌더링이 잘 구현되었습니다:

  • state.recentBooks가 비어있을 때 EmptyBookCard 표시
  • 데이터가 있을 때 HorizontalPager로 BookCard들을 표시
  • 페이지 인디케이터 추가로 UX 향상

userBookId를 이벤트에 전달하는 부분도 올바르게 구현되어 있습니다.

feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/HomeUiState.kt (2)

3-7: API 연동을 위한 상태 구조 업데이트

RecentBookModel을 사용한 recentBooks 리스트가 추가되고 ImmutableList로 구현되어 Compose 성능 최적화가 잘 되어있습니다.

Also applies to: 10-10


17-17: OnRecordButtonClick 이벤트에 userBookId 파라미터 추가

기록 화면으로 네비게이션할 때 필요한 userBookId를 전달하도록 이벤트가 올바르게 수정되었습니다.

core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/mapper/ResponseToModel.kt (2)

8-8: 홈 화면 API를 위한 새로운 import 추가

HomeModel, RecentBookModel, HomeResponse, RecentBook 타입들이 올바르게 import되었습니다.

Also applies to: 13-13, 20-20, 25-25


158-174: 네트워크 응답을 도메인 모델로 변환하는 매퍼 함수 구현

HomeResponse와 RecentBook을 각각 HomeModel과 RecentBookModel로 변환하는 매퍼 함수들이 잘 구현되었습니다:

  • 기존 패턴과 일관성 유지
  • 모든 필드가 올바르게 매핑됨
  • 내부 함수로 적절히 선언됨

매퍼 함수들이 데이터 레이어의 책임을 명확히 분리하고 있습니다.

core/model/src/main/kotlin/com/ninecraft/booket/core/model/HomeModel.kt (2)

5-8: HomeModel 도메인 모델 정의

@stable 어노테이션과 기본값이 있는 recentBooks 리스트로 Compose UI에 최적화된 모델이 잘 정의되었습니다.


10-19: RecentBookModel 도메인 모델 정의

최근 도서 정보를 담는 모델이 적절히 설계되었습니다:

  • @stable 어노테이션으로 Compose 최적화
  • 모든 필드에 안전한 기본값 제공
  • userBookId, 책 정보, 기록 관련 필드들이 완전히 포함됨

필드명과 타입이 일관성 있게 정의되어 있습니다.

feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/HomePresenter.kt (5)

4-8: API 연동을 위한 새로운 의존성 import

HomeRepository, LaunchedEffect, 상태 관리, 로깅 등 API 연동에 필요한 의존성들이 적절히 추가되었습니다.

Also applies to: 16-16, 18-18, 25-27


31-31: HomeRepository 의존성 주입 및 상태 관리

HomeRepository가 생성자에 주입되고, rememberRetained를 사용해 recentBooks 상태가 적절히 관리되고 있습니다. Persistent collection 사용으로 성능도 최적화되어 있습니다.

Also applies to: 37-37


39-48: 비동기 데이터 로딩 및 에러 핸들링 구현

getHome() 함수가 잘 구현되었습니다:

  • 코루틴을 사용한 비동기 처리
  • Result 타입의 onSuccess/onFailure 패턴 활용
  • 성공 시 toPersistentList()로 상태 업데이트
  • 실패 시 Logger를 통한 에러 로깅

에러 핸들링과 데이터 플로우가 적절합니다.


70-72: LaunchedEffect를 사용한 초기 데이터 로딩

컴포저블 초기화 시점에 LaunchedEffect(true)로 데이터를 로딩하는 것이 올바르게 구현되었습니다.


61-61: 이벤트 처리 및 상태 반환 업데이트

OnRecordButtonClick에서 event.userBookId를 전달하도록 네비게이션이 수정되고, HomeUiState에 recentBooks가 포함되어 API 연동이 완성되었습니다.

Also applies to: 75-75

feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/component/BookCard.kt (6)

3-3: 새로운 import 추가가 적절합니다.

API 연동을 위한 RecentBookModel import와 UX 개선을 위한 noRippleClickable, Image import가 올바르게 추가되었습니다.

Also applies to: 36-36, 44-44


50-50: 모델 타입 변경이 API 연동 목표와 일치합니다.

기존 Book 모델에서 RecentBookModel로 변경된 것이 홈 화면 API 연동 목표에 부합합니다. 파라미터명도 recentBookInfo로 명확하게 변경되었습니다.


84-84: RecentBookModel 프로퍼티 사용이 올바릅니다.

새로운 모델의 프로퍼티들(coverImageUrl, title, author, publisher, recordCount)이 올바르게 사용되고 있습니다.

Also applies to: 102-102, 115-115, 130-130, 164-164


94-97: 터치 영역 제한이 UX 개선 목표를 잘 구현했습니다.

PR 목표에서 언급된 "BookCard의 터치 영역을 썸네일로만 제한"하는 요구사항이 noRippleClickable을 사용하여 잘 구현되었습니다. 이제 책 커버 이미지만 클릭 가능하여 사용자 경험이 개선됩니다.


104-106: 텍스트 오버플로우 처리가 추가되었습니다.

TextOverflow.EllipsismaxLines = 1 속성이 추가되어 긴 제목이 카드 레이아웃을 깨뜨리지 않도록 개선되었습니다. 이는 실제 API 데이터를 사용할 때 발생할 수 있는 다양한 길이의 텍스트를 고려한 좋은 개선사항입니다.


225-228: EmptyBookCard에 실제 이미지 리소스가 추가되었습니다.

PR 목표에서 언급된 "EmptyBookCard 컴포넌트에 그래픽 리소스 추가" 요구사항이 구현되었습니다. 기존 placeholder Box에서 실제 이미지(img_empty_book)로 변경되어 빈 상태의 시각적 표현이 개선되었습니다.

Copy link
Copy Markdown
Contributor

@easyhooon easyhooon left a comment

Choose a reason for hiding this comment

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

위에 리뷰남긴 부분말구 다른부분은 다 괜찮아보입니다!

modifier = Modifier
.size(112.dp)
.background(ReedTheme.colors.bgSecondary),
Image(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

여기 ResourceImage 컴포넌트 사용하는것 추천드립니다.
NetworkImage가 아니어두 Coil을 사용하여 성능적으로 이득을 볼 수 있습니다.
(캐싱 정책 적용해두어 이후 로드에서 캐싱된 이미지로 로드가 되기도하구)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

반영 완 9cd432e

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 (3)
feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/HomeUiState.kt (2)

17-23: UUID 키 생성 최적화 검토

ShowToast에서 UUID 키를 private 프로퍼티로 생성하고 있는데, 매번 새로운 UUID를 생성하는 것이 필요한지 검토가 필요합니다.

만약 동일한 메시지에 대해 중복 Toast를 방지하려면 message를 키로 사용하는 것을 고려해보세요:

 data class ShowToast(
     val message: String,
-    private val key: String = UUID.randomUUID().toString(),
+    private val key: String = message,
 ) : HomeSideEffect

또는 UUID 생성이 정말 필요하다면 성능을 위해 companion object에서 관리하는 방법도 있습니다.


21-21: UUID 생성 빈도 최적화를 고려해보세요.

UUID 생성이 ShowToast 인스턴스마다 발생하므로, 빈번한 토스트 메시지가 있을 경우 성능에 영향을 줄 수 있습니다.

성능이 중요한 경우, UUID 대신 타임스탬프나 카운터를 사용하는 것을 고려해보세요:

data class ShowToast(
    val message: String,
    private val key: Long = System.currentTimeMillis(),
) : HomeSideEffect
feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/HandleHomeSideEffects.kt (1)

17-17: Toast 메시지 UX 개선을 고려해보세요.

현재는 모든 에러 상황에서 Toast를 사용하고 있는데, 사용자 경험 관점에서 일부 케이스는 Snackbar나 다른 UI 컴포넌트가 더 적절할 수 있습니다.

향후 다양한 피드백 타입을 지원하기 위해 HomeSideEffect를 확장하는 것을 고려해보세요:

sealed interface HomeSideEffect {
    data class ShowToast(val message: String) : HomeSideEffect
    data class ShowSnackbar(val message: String) : HomeSideEffect
    data class ShowDialog(val title: String, val message: String) : HomeSideEffect
}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0441bfc and dfd8dbe.

📒 Files selected for processing (5)
  • feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/HandleHomeSideEffects.kt (1 hunks)
  • feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/HomePresenter.kt (3 hunks)
  • feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/HomeUi.kt (3 hunks)
  • feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/HomeUiState.kt (1 hunks)
  • feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/component/BookCard.kt (8 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/component/BookCard.kt
  • feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/HomePresenter.kt
  • feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/HomeUi.kt
👮 Files not reviewed due to content moderation or server errors (2)
  • feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/HandleHomeSideEffects.kt
  • feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/HomeUiState.kt
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: seoyoon513
PR: YAPP-Github/Reed-Android#63
File: feature/library/src/main/kotlin/com/ninecraft/booket/feature/library/LibraryPresenter.kt:28-53
Timestamp: 2025-07-22T05:19:10.071Z
Learning: feature/library의 LibraryPresenter에서 현재 FilterChipState의 카운트 값들은 UI 확인용 더미 데이터이며, API가 준비되면 실제 데이터로 교체될 예정입니다.
Learnt from: seoyoon513
PR: YAPP-Github/Reed-Android#46
File: feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/component/InfiniteLazyColumn.kt:83-95
Timestamp: 2025-07-14T00:46:03.843Z
Learning: seoyoon513과 팀은 한국어 주석을 선호하며, 한국어 주석을 영어로 번역하라는 제안을 하지 않아야 함
Learnt from: seoyoon513
PR: YAPP-Github/Reed-Android#75
File: feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/HomeUi.kt:0-0
Timestamp: 2025-07-29T06:07:11.727Z
Learning: seoyoon513 팀에서는 UI 구현 단계에서 더미 데이터를 하드코딩하여 화면을 먼저 구현하고, 이후 서버 연동 시점에 실제 데이터로 교체하는 개발 방식을 사용합니다.
⏰ 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 (14)
feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/HandleHomeSideEffects.kt (3)

8-23: 잘 구현된 사이드 이펙트 핸들링입니다!

RememberedEffectwhen 표현식을 사용한 사이드 이펙트 처리가 깔끔하게 구현되었습니다. Toast 메시지 표시를 위한 컨텍스트 사용도 적절합니다.


8-23: 사이드 이펙트 핸들링 구현이 깔끔합니다.

RememberedEffect를 사용한 사이드 이펙트 처리 패턴이 잘 구현되어 있습니다. Toast 메시지 표시 로직도 적절합니다.


8-23: 사이드 이펙트 처리 구현이 적절합니다.

RememberedEffect를 사용하여 상태 변경에 따른 사이드 이펙트를 적절히 처리하고 있으며, null 케이스도 명시적으로 처리하여 완전성을 보장하고 있습니다.

feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/HomeUiState.kt (11)

3-4: API 연동을 위한 적절한 import 추가

RecentBookModel import와 Immutable 어노테이션 import가 API 연동 구조에 맞게 잘 추가되었습니다.


12-13: 불변성과 성능을 고려한 상태 설계

ImmutableList를 사용한 recentBooks 프로퍼티와 nullable한 sideEffect 설계가 좋습니다. 불변성을 보장하면서 성능도 최적화됩니다.


28-28: 네비게이션 컨텍스트를 위한 적절한 파라미터 추가

OnRecordButtonClickuserBookId 파라미터가 추가되어 네비게이션 시 필요한 컨텍스트를 전달할 수 있게 되었습니다.


12-13: API 연동을 위한 상태 구조 변경이 적절합니다.

recentBooks 프로퍼티 추가와 sideEffect 처리를 위한 구조가 잘 설계되었습니다. ImmutableList 사용으로 Compose 성능 최적화도 고려되어 있습니다.


17-23: 사이드 이펙트 설계가 확장 가능하게 구성되어 있습니다.

HomeSideEffect sealed interface와 ShowToast의 구현이 좋습니다. 특히 UUID를 사용한 private key로 중복 실행을 방지하는 것이 스마트한 접근입니다.


28-28: 이벤트에 컨텍스트 정보 추가가 적절합니다.

OnRecordButtonClickuserBookId를 포함하도록 변경된 것은 네비게이션과 상태 관리에 필요한 컨텍스트를 제공하여 좋은 개선입니다.


3-4: 적절한 불변성 지원을 위한 import 추가.

Compose 최적화를 위한 @Immutable 어노테이션과 RecentBookModel 도메인 모델 import가 적절히 추가되었습니다.


7-9: ImmutableList 사용으로 Compose 성능 최적화.

kotlinx.collections.immutableImmutableListpersistentListOf 사용으로 Compose 리컴포지션 최적화를 적절히 구현했습니다.


12-13: 상태 관리 구조 개선.

API 연동을 위한 recentBooks 프로퍼티와 UI 사이드 이펙트 처리를 위한 sideEffect 프로퍼티가 적절히 추가되어 더미 데이터에서 실제 데이터로의 전환을 지원합니다.


17-23: 사이드 이펙트 패턴 구현이 우수합니다.

@Immutable 어노테이션과 sealed interface를 사용한 사이드 이펙트 패턴이 적절하며, ShowToast에서 UUID 키를 사용하여 Compose의 리컴포지션 동작을 보장하는 것이 좋은 접근입니다.


28-28: 이벤트에 컨텍스트 정보 추가로 개선.

OnRecordButtonClickuserBookId 매개변수를 추가하여 네비게이션 시 필요한 컨텍스트 정보를 전달할 수 있게 개선되었습니다.

@seoyoon513 seoyoon513 merged commit 44805e4 into develop Aug 1, 2025
3 checks passed
@seoyoon513 seoyoon513 deleted the BOOK-169-feature/#71 branch August 1, 2025 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BOOK-169/feat] 홈 화면 API 연동

2 participants