Skip to content

feat: 내서재 도서 검색 기능 구현#102

Merged
seoyoon513 merged 24 commits intodevelopfrom
BOOK-167-feature/#69
Aug 4, 2025
Merged

feat: 내서재 도서 검색 기능 구현#102
seoyoon513 merged 24 commits intodevelopfrom
BOOK-167-feature/#69

Conversation

@seoyoon513
Copy link
Copy Markdown
Contributor

@seoyoon513 seoyoon513 commented Aug 4, 2025

🔗 관련 이슈

📙 작업 설명

  • 내서재 검색 화면 UI 작업
  • 내서재 검색 화면 API 연동
  • 내서재 최근 검색어 조회/삭제 기능 구현

🧪 테스트 내역

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

📸 스크린샷 또는 시연 영상

Reed_._.mp4

💬 추가 설명 or 리뷰 포인트

  • 도서 검색/내서재 검색 구분을 위해 feature:search 모듈에서 book/library 패키지로 분리했고, 공통으로 사용하는 컴포넌트의 경우 common/component로 분리했습니다
  • 각 파일 prefix도 BookSearch- / LibrarySearch- 로 구분했습니다
  • 최근 검색어의 경우 두 검색에서 완전히 동일한 기능을 수행하기 때문에, RecentSearchDataSource 확장한 중간 interface를 (BookRecentSearchDataSource / LibraryRecentSearchDataSource)각각 정의하고 Qualifier 없이 명시적 바인딩이 가능하도록 했습니다
@Binds
@Singleton
abstract fun bindBookRecentSearchDataSource(
    defaultBookRecentSearchDataSource: DefaultBookRecentSearchDataSource,
): BookRecentSearchDataSource

@Binds
@Singleton
abstract fun bindLibraryRecentSearchDataSource(
    defaultLibraryRecentSearchDataSource: DefaultLibraryRecentSearchDataSource,
): LibraryRecentSearchDataSource
  • data 모듈에서는 중간 interface를 주입받아 구분된 기능을 사용합니다
internal class DefaultBookRepository @Inject constructor(
    private val service: ReedService,
    private val bookRecentSearchDataSource: BookRecentSearchDataSource,
    private val libraryRecentSearchDataSource: LibraryRecentSearchDataSource,
) : BookRepository {
  • 중간 interface를 두지 않고 Qualifier를 사용하는 방식도 고려했으나, 이 경우 data-impl 모듈에서 주입 대상의 Qualifer를 명시해야 하며, 해당 Qualifier의 정의(DataStoreQualifier)를 datastore-api 모듈로 노출해야 하므로 hilt 의존성도 추가해야하는 문제가 있었습니다. 따라서 중간 interface를 두는 방식을 선택했습니다
  • 도서 검색/내서재 검색 모두 검색 시 공백, 빈문자열에 대한 유효성 검사 추가했습니다 (서버에서도 막는다고 합니다)
  • 최근 검색어를 눌러서 검색 결과를 받아왔을 때 추가 페이징이 안되는 이슈가 있어서 같이 수정했습니다

Summary by CodeRabbit

  • 신규 기능

    • 내 서재(라이브러리) 도서 검색 화면 및 기능이 추가되었습니다.
    • 내 서재 검색 시 최근 검색어 관리(조회, 추가, 삭제)가 도서 검색과 분리되어 별도로 제공됩니다.
    • 내 서재 검색 UI 및 이벤트, 상태 관리가 새롭게 도입되었습니다.
    • 내 서재 도서 목록 아이템에 표지, 제목, 저자, 출판사, 기록 수 등이 표시됩니다.
    • 내 서재 검색 화면에서 검색창, 검색 결과, 최근 검색어, 페이징 및 오류 처리 기능이 구현되었습니다.
  • UI/스타일

    • 도서 및 내 서재 검색 화면에서 검색창 테두리와 아이콘 색상 커스터마이즈가 가능해졌습니다.
    • 내 서재 도서 목록 아이템 UI가 새롭게 추가되어 상세 정보를 한눈에 확인할 수 있습니다.
  • 버그 수정 및 개선

    • 도서 및 내 서재 검색 시 ISBN13 필드 사용으로 일관성 및 정확성이 향상되었습니다.
    • 검색어 입력 시 공백 처리 및 검색 로직이 개선되어 빈 쿼리 검색이 방지됩니다.
  • 문서화 및 리소스

    • 내 서재 검색 관련 한글 문자열 리소스가 추가되었습니다.
  • 리팩터/구조 개선

    • 도서와 내 서재 검색 로직 및 최근 검색어 데이터 저장소가 명확히 분리되어 관리됩니다.
    • 관련 클래스, 패키지, 이벤트, 메서드 명칭이 역할별로 일관성 있게 변경 및 세분화되었습니다.

# Conflicts:
#	feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/component/BookRegisterBottomSheet.kt
#	feature/search/src/main/res/values/strings.xml
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Aug 4, 2025

Walkthrough

이번 변경은 내서재 도서 검색 기능을 전면적으로 도입하는 것으로, 라이브러리 검색 UI, API 연동, 최근 검색 분리(도서/서재), 데이터 저장소 분리, 관련 리포지토리 및 서비스 인터페이스 확장, 새로운 프레젠터와 UI 컴포넌트 추가, 문자열 리소스 추가 등이 포함됩니다.

Changes

Cohort / File(s) Change Summary
Book & Library Recent Search 분리 및 리포지토리 확장
core/data/api/src/main/kotlin/com/ninecraft/booket/core/data/api/repository/BookRepository.kt, core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/repository/DefaultBookRepository.kt, core/datastore/api/src/main/kotlin/com/ninecraft/booket/core/datastore/api/datasource/BookRecentSearchDataSource.kt, core/datastore/api/src/main/kotlin/com/ninecraft/booket/core/datastore/api/datasource/LibraryRecentSearchDataSource.kt, core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/datasource/DefaultBookRecentSearchDataSource.kt, core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/datasource/DefaultLibraryRecentSearchDataSource.kt, core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/di/DataStoreModule.kt, core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/di/DataStoreQualifier.kt
도서/서재 최근검색 데이터소스 및 데이터스토어 분리, 관련 리포지토리 인터페이스 및 구현 확장, DI 모듈 및 Qualifier 어노테이션 추가/변경
도서/서재 검색 모델 및 네트워크 변경
core/model/src/main/kotlin/com/ninecraft/booket/core/model/BookSearchModel.kt, core/network/src/main/kotlin/com/ninecraft/booket/core/network/response/BookSearchResponse.kt, core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/mapper/ResponseToModel.kt, core/network/src/main/kotlin/com/ninecraft/booket/core/network/service/ReedService.kt
ISBN 필드명을 isbn → isbn13으로 통일, 라이브러리 검색 API에 title 파라미터 추가, 네트워크 서비스 메서드명 및 파라미터 변경, 매핑 함수 수정
내서재 검색 프레젠터/상태/UI/SideEffect 신설
feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/library/LibrarySearchPresenter.kt, feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/library/LibrarySearchUiState.kt, feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/library/LibrarySearchUi.kt, feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/library/HandlingLibrarySearchSideEffect.kt, feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/library/component/LibraryBookItem.kt, feature/search/src/main/res/values/strings.xml
내서재 검색 프레젠터, UI 상태, 이벤트, 사이드이펙트, UI 컴포넌트, 문자열 리소스 등 신규 추가
기존 검색(도서) 코드 Book 전용으로 리팩토링
feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchPresenter.kt, feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchUi.kt, feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchUiState.kt, feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/HandlingBookSearchSideEffect.kt, feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/component/BookItem.kt, feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/component/BookRegisterBottomSheet.kt, feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/component/BookRegisterSuccessBottomSheet.kt, feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/common/component/RecentSearchTitle.kt, feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/common/component/SearchItem.kt
패키지 구조 및 타입명 Book 전용으로 변경, recentSearches → bookRecentSearches, isbn → isbn13, 기타 관련 명칭 일괄 변경
내서재 메인 화면 연동 및 네비게이션 추가
feature/library/src/main/kotlin/com/ninecraft/booket/feature/library/LibraryPresenter.kt, feature/library/src/main/kotlin/com/ninecraft/booket/feature/library/LibraryUi.kt, feature/library/src/main/kotlin/com/ninecraft/booket/feature/library/LibraryUiState.kt, feature/screens/src/main/kotlin/com/ninecraft/booket/feature/screens/Screens.kt
메인 화면에서 내서재 검색 진입 이벤트 및 네비게이션 추가, 관련 상수/이벤트/스크린 오브젝트 추가
디자인 시스템 개선
core/designsystem/src/main/kotlin/com/ninecraft/booket/core/designsystem/component/textfield/ReedSearchTextField.kt
검색 필드의 borderStroke를 nullable로 변경, searchIconTint 속성 추가로 아이콘 색상 커스터마이즈 가능
기타
feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailPresenter.kt
도서 상태 업데이트 시 isbn → isbn13으로 변경

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant LibrarySearchUi
    participant LibrarySearchPresenter
    participant BookRepository
    participant NetworkService

    User->>LibrarySearchUi: 검색어 입력/검색 버튼 클릭
    LibrarySearchUi->>LibrarySearchPresenter: OnSearchClick(query)
    LibrarySearchPresenter->>BookRepository: searchLibraryBooks(query, page, size)
    BookRepository->>NetworkService: getLibraryBooks(title=query, ...)
    NetworkService-->>BookRepository: LibraryModel 결과 반환
    BookRepository-->>LibrarySearchPresenter: Result<LibraryModel>
    LibrarySearchPresenter-->>LibrarySearchUi: UI 상태 업데이트(결과/실패 등)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Assessment against linked issues

Objective Addressed Explanation
feature:search 모듈 내에서 화면 작업 (#69)
내서재 도서 검색 API 연동 (#69)

Assessment against linked issues: Out-of-scope changes

해당 이슈(#69)의 목적과 무관한 변경사항은 발견되지 않았습니다.

Possibly related PRs

Poem

🐰
책장 속 비밀을 찾는 밤,
내서재 검색이 활짝 열렸네!
도서와 서재, 검색길 분리,
최근 기록도 따로따로 정리.
새로운 UI와 반짝이는 코드,
리뷰어 토끼도 깡충깡충 춤추네!
📚✨

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-167-feature/#69

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: 7

🧹 Nitpick comments (9)
feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/component/BookRegisterBottomSheet.kt (1)

80-86: contentDescription 하드코딩 → 문자열 리소스 전환 권장
"Close Icon" 문자열이 코드에 직접 박혀 있어 i18n·접근성 대응이 어렵습니다. search 모듈 strings.xml 에 추가해 stringResource() 로 주입해 주세요.

- contentDescription = "Close Icon",
+ contentDescription = stringResource(R.string.close_icon_description),
feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/component/BookRegisterSuccessBottomSheet.kt (1)

81-99: 버튼 간 간격 고정값 사용
좌우 weight(1f) 로 폭을 균등 분할했으므로 Arrangement.SpaceBetween 만으로 충분합니다. Spacer(width = …) 는 불필요 / 중복일 수 있습니다.

feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/common/component/SearchItem.kt (1)

50-52: contentDescription 하드코딩 문제
상단 파일과 동일한 이유로 문자열 리소스로 이동해 주세요.

feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/component/BookItem.kt (1)

142-143: 미리보기용 isbn13 값 빈 문자열
NetworkImage 캐싱 키나 추후 DiffUtil 키로 사용될 경우 문제를 일으킬 수 있습니다. 예시용이라도 유효한 13자리 값으로 채워 두는 편이 안전합니다.

core/datastore/api/src/main/kotlin/com/ninecraft/booket/core/datastore/api/datasource/BookRecentSearchDataSource.kt (1)

3-3: 관심사 분리를 위한 인터페이스 설계가 우수합니다.

도서와 라이브러리 최근 검색 기능을 분리하는 중간 인터페이스 접근 방식이 잘 설계되었습니다. 기존 RecentSearchDataSource를 확장하여 코드 중복을 피하고 모듈성을 향상시켰습니다.

이러한 분리 접근 방식은 다음과 같은 이점을 제공합니다:

  • 의존성 주입에서 qualifier 사용을 피할 수 있음
  • 각 기능별로 명확한 책임 분리
  • 향후 각 도메인별로 독립적인 확장 가능
feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/library/component/LibraryBookItem.kt (2)

42-55: 접근성을 위해 contentDescription을 개선하세요

이미지의 contentDescription이 하드코딩되어 있습니다. 접근성을 개선하기 위해 책 제목을 포함한 더 의미있는 설명을 사용하는 것을 권장합니다.

다음과 같이 개선할 수 있습니다:

-            contentDescription = "Book CoverImage",
+            contentDescription = stringResource(
+                R.string.library_book_cover_content_description,
+                book.bookTitle
+            ),

75-91: weight 값의 하드코딩을 피하세요

저자와 출판사 영역의 weight 값이 하드코딩되어 있어 텍스트 길이에 따른 레이아웃 유연성이 부족할 수 있습니다.

더 유연한 접근 방식을 고려해보세요:

-                    modifier = Modifier.weight(0.7f, fill = false),
+                    modifier = Modifier.weight(1f, fill = false),
-                    modifier = Modifier.weight(0.3f, fill = false),
+                    modifier = Modifier.weight(0.5f, fill = false),
feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/library/LibrarySearchPresenter.kt (1)

151-156: TODO: 도서 상세 화면에 userBookId 전달 필요

현재 도서 상세 화면으로 이동할 때 userBookId를 전달하지 않고 있습니다. 이는 내서재 도서의 상세 정보를 올바르게 표시하는데 필요할 수 있습니다.

이 작업을 추적하기 위한 이슈를 생성하시겠습니까?

feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/library/LibrarySearchUiState.kt (1)

12-17: UiState 인터페이스명이 너무 일반적입니다.

현재 UiState라는 네이밍은 다른 기능에서도 사용될 가능성이 높아 충돌이 발생할 수 있습니다. LibrarySearchUiState 내부에서만 사용되는 상태라면 더 구체적인 네이밍을 고려해보세요.

다음과 같이 변경을 제안합니다:

-sealed interface UiState {
+sealed interface LibrarySearchState {
     data object Idle : UiState
     data object Loading : UiState  
     data object Success : UiState
     data class Error(val message: String) : UiState
 }
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between c5ae3b2 and 868e30f.

📒 Files selected for processing (32)
  • core/data/api/src/main/kotlin/com/ninecraft/booket/core/data/api/repository/BookRepository.kt (2 hunks)
  • core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/mapper/ResponseToModel.kt (1 hunks)
  • core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/repository/DefaultBookRepository.kt (3 hunks)
  • core/datastore/api/src/main/kotlin/com/ninecraft/booket/core/datastore/api/datasource/BookRecentSearchDataSource.kt (1 hunks)
  • core/datastore/api/src/main/kotlin/com/ninecraft/booket/core/datastore/api/datasource/LibraryRecentSearchDataSource.kt (1 hunks)
  • core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/datasource/DefaultBookRecentSearchDataSource.kt (7 hunks)
  • core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/datasource/DefaultLibraryRecentSearchDataSource.kt (1 hunks)
  • core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/di/DataStoreModule.kt (4 hunks)
  • core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/di/DataStoreQualifier.kt (1 hunks)
  • core/designsystem/src/main/kotlin/com/ninecraft/booket/core/designsystem/component/textfield/ReedSearchTextField.kt (3 hunks)
  • core/model/src/main/kotlin/com/ninecraft/booket/core/model/BookSearchModel.kt (1 hunks)
  • core/network/src/main/kotlin/com/ninecraft/booket/core/network/response/BookSearchResponse.kt (1 hunks)
  • core/network/src/main/kotlin/com/ninecraft/booket/core/network/service/ReedService.kt (1 hunks)
  • feature/library/src/main/kotlin/com/ninecraft/booket/feature/library/LibraryPresenter.kt (5 hunks)
  • feature/library/src/main/kotlin/com/ninecraft/booket/feature/library/LibraryUi.kt (1 hunks)
  • feature/library/src/main/kotlin/com/ninecraft/booket/feature/library/LibraryUiState.kt (1 hunks)
  • feature/screens/src/main/kotlin/com/ninecraft/booket/feature/screens/Screens.kt (1 hunks)
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchPresenter.kt (7 hunks)
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchUi.kt (11 hunks)
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchUiState.kt (3 hunks)
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/HandlingBookSearchSideEffect.kt (1 hunks)
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/component/BookItem.kt (2 hunks)
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/component/BookRegisterBottomSheet.kt (1 hunks)
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/component/BookRegisterSuccessBottomSheet.kt (1 hunks)
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/common/component/RecentSearchTitle.kt (1 hunks)
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/common/component/SearchItem.kt (1 hunks)
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/library/HandlingLibrarySearchSideEffect.kt (1 hunks)
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/library/LibrarySearchPresenter.kt (1 hunks)
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/library/LibrarySearchUi.kt (1 hunks)
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/library/LibrarySearchUiState.kt (1 hunks)
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/library/component/LibraryBookItem.kt (1 hunks)
  • feature/search/src/main/res/values/strings.xml (1 hunks)
🧰 Additional context used
🧠 Learnings (11)
📓 Common learnings
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/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/component/BookItem.kt
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/common/component/RecentSearchTitle.kt
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/component/BookRegisterBottomSheet.kt
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchUi.kt
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/library/component/LibraryBookItem.kt
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/common/component/SearchItem.kt
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/component/BookRegisterSuccessBottomSheet.kt
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/library/LibrarySearchUi.kt
  • feature/library/src/main/kotlin/com/ninecraft/booket/feature/library/LibraryPresenter.kt
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchPresenter.kt
📚 Learning: kotlin에서 같은 패키지 내의 파일들은 패키지 레벨에 정의된 const val 상수를 import 없이 직접 접근할 수 있습니다. onboardingpresenter.kt와 o...
Learnt from: easyhooon
PR: YAPP-Github/Reed-Android#77
File: feature/onboarding/src/main/kotlin/com/ninecraft/booket/feature/onboarding/OnboardingUi.kt:73-73
Timestamp: 2025-07-29T07:02:18.885Z
Learning: Kotlin에서 같은 패키지 내의 파일들은 패키지 레벨에 정의된 const val 상수를 import 없이 직접 접근할 수 있습니다. OnboardingPresenter.kt와 OnboardingUi.kt 모두 com.ninecraft.booket.feature.onboarding 패키지에 속해 있어서 ONBOARDING_STEPS_COUNT 상수를 공유할 수 있습니다.

Applied to files:

  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/component/BookItem.kt
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/component/BookRegisterBottomSheet.kt
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchUi.kt
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/common/component/SearchItem.kt
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/component/BookRegisterSuccessBottomSheet.kt
  • feature/library/src/main/kotlin/com/ninecraft/booket/feature/library/LibraryPresenter.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/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/datasource/DefaultBookRecentSearchDataSource.kt
📚 Learning: in the reed-android project's termsagreementscreen.kt, the ontermdetailclick event is intentionally ...
Learnt from: seoyoon513
PR: YAPP-Github/Reed-Android#35
File: feature/login/src/main/kotlin/com/ninecraft/booket/feature/login/TermsAgreementScreen.kt:127-127
Timestamp: 2025-07-09T01:14:29.836Z
Learning: In the Reed-Android project's TermsAgreementScreen.kt, the OnTermDetailClick event is intentionally passed an empty string for the URL parameter because the actual URLs for terms detail pages haven't been decided yet. This is a temporary implementation that will be updated once the URLs are finalized.

Applied to files:

  • feature/screens/src/main/kotlin/com/ninecraft/booket/feature/screens/Screens.kt
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchUi.kt
  • core/designsystem/src/main/kotlin/com/ninecraft/booket/core/designsystem/component/textfield/ReedSearchTextField.kt
📚 Learning: in circuit architecture, presenters receive the screen object directly as a constructor parameter (e...
Learnt from: easyhooon
PR: YAPP-Github/Reed-Android#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/screens/src/main/kotlin/com/ninecraft/booket/feature/screens/Screens.kt
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchPresenter.kt
📚 Learning: feature/library의 librarypresenter에서 현재 filterchipstate의 카운트 값들은 ui 확인용 더미 데이터이며, api가 준비되면 실제 데이터로 교...
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가 준비되면 실제 데이터로 교체될 예정입니다.

Applied to files:

  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/library/LibrarySearchPresenter.kt
  • feature/library/src/main/kotlin/com/ninecraft/booket/feature/library/LibraryUi.kt
  • feature/library/src/main/kotlin/com/ninecraft/booket/feature/library/LibraryPresenter.kt
📚 Learning: bookdetailscreen의 recordscollection 컴포넌트는 상위 column의 verticalscroll과 lazycolumn의 무한 스크롤을 동시에 지원해야 하는...
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 무한 스크롤을 지원할 예정입니다.

Applied to files:

  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchUi.kt
📚 Learning: livetextanalyzer는 ml kit 에러를 addonfailurelistener로 처리하지만 로그만 남기고 presenter에 실패를 알리지 않아서, ui에서 텍스트 인식...
Learnt from: seoyoon513
PR: YAPP-Github/Reed-Android#72
File: feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/ocr/OcrPresenter.kt:70-70
Timestamp: 2025-07-28T18:22:00.618Z
Learning: LiveTextAnalyzer는 ML Kit 에러를 addOnFailureListener로 처리하지만 로그만 남기고 presenter에 실패를 알리지 않아서, UI에서 텍스트 인식 실패 상태를 표시할 수 없는 문제가 있음. StillTextAnalyzer처럼 실패 콜백을 추가하는 것이 더 나은 해결책임

Applied to files:

  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchPresenter.kt
📚 Learning: in circuit architecture, screen parameters are not manually passed to presenter constructors. the @c...
Learnt from: easyhooon
PR: YAPP-Github/Reed-Android#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, screen parameters are not manually passed to presenter constructors. The @CircuitInject annotation automatically handles the injection of the entire Screen object, making screen parameters accessible without explicitly adding them to the constructor or factory methods.

Applied to files:

  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchPresenter.kt
📚 Learning: in the reed-android project using circuit architecture, delegatingnavigator was restored because nav...
Learnt from: easyhooon
PR: YAPP-Github/Reed-Android#52
File: feature/main/src/main/kotlin/com/ninecraft/booket/feature/main/screens/DelegatingNavigator.kt:0-0
Timestamp: 2025-07-16T15:54:19.322Z
Learning: In the Reed-Android project using Circuit architecture, DelegatingNavigator was restored because NavigableCircuitContent can only inject a single navigator, but the dual-navigator architecture (childNavigator for bottom navigation screens, rootNavigator for full-screen screens) requires a delegating component to work within Circuit's constraint.

Applied to files:

  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchPresenter.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 (50)
feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/component/BookRegisterBottomSheet.kt (1)

1-1: 패키지 이동 확인 완료
모듈 분리에 맞춰 올바른 패키지로 이동된 것 확인했습니다.

feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/component/BookRegisterSuccessBottomSheet.kt (1)

1-1: 패키지 이동 확인 완료
검색 기능 모듈화 방향과 일치합니다.

feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/common/component/SearchItem.kt (2)

1-1: 공용 컴포넌트 패키지로 이동 완료
구조 재편에 맞는 적절한 위치입니다.


50-56: 아이콘 클릭 시 부모 Row 클릭 이벤트 중복 가능성 검토
Compose 의 clickable 중첩은 내부가 소비하지만, 테스트로 한 번 눌러 확인 권장드립니다. 필요 시 pointerInput {} 로 명시적 소비 처리하세요.

feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/common/component/RecentSearchTitle.kt (1)

1-1: 패키지 이동 확인 완료
공통 컴포넌트 위치로의 이동에 동의합니다.

feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/component/BookItem.kt (1)

1-1: 패키지 이동 확인 완료
책 전용 컴포넌트로 적절히 분리되었습니다.

feature/library/src/main/kotlin/com/ninecraft/booket/feature/library/LibraryUiState.kt (1)

37-37: 라이브러리 검색 이벤트 추가가 적절합니다.

OnLibrarySearchClick 이벤트가 기존 패턴에 맞게 잘 구현되었습니다. data object 사용과 네이밍 컨벤션이 일관성 있게 적용되었습니다.

feature/library/src/main/kotlin/com/ninecraft/booket/feature/library/LibraryUi.kt (1)

68-68: TODO를 실제 구현으로 교체한 것이 좋습니다.

검색 버튼 클릭 시 OnLibrarySearchClick 이벤트를 발생시키는 구현이 기존 패턴에 맞게 잘 적용되었습니다. UI 단계에서 먼저 구현하고 실제 기능으로 교체하는 팀의 개발 방식에 부합합니다.

feature/screens/src/main/kotlin/com/ninecraft/booket/feature/screens/Screens.kt (1)

26-27: 라이브러리 검색 화면 추가가 적절합니다.

LibrarySearchScreen이 기존 패턴에 맞게 잘 구현되었습니다. 네이밍 컨벤션, @Parcelize 어노테이션, data object 사용이 모두 일관성 있게 적용되었습니다.

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

34-35: ISBN 필드명 변경 일관성 확인 완료

  • 네트워크 응답(BookSearchResponse.kt)에서 isbnisbn13으로 일관성 있게 적용됨
  • ResponseToModel.kt 매퍼와 BookSummaryModel(코어/모델)에서도 isbn13 필드로 올바르게 매핑됨
  • 검색 프레젠터(BookSearchPresenter.kt) 및 컴포넌트(BookItem.kt)에서 모두 isbn13으로 참조
  • 상세 화면 이동 시 여전히 isbn 파라미터 명을 사용하나, 전달되는 값은 isbn13이며 기능상 문제 없음

위 검증 결과 추가 수정 없이 변경 사항을 승인합니다.

core/datastore/api/src/main/kotlin/com/ninecraft/booket/core/datastore/api/datasource/LibraryRecentSearchDataSource.kt (1)

1-3: 중간 인터페이스를 통한 의존성 분리가 잘 설계되었습니다.

RecentSearchDataSource를 상속받는 마커 인터페이스로 라이브러리 검색과 일반 도서 검색을 타입 레벨에서 구분하는 접근이 적절합니다. PR 목표에서 언급한 바와 같이 한정자 노출을 피하고 의존성 주입을 단순화하는 좋은 설계 결정입니다.

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

57-57: 매핑 로직이 네트워크 레이어 변경사항과 일치하게 업데이트되었습니다.

BookSummaryisbn13 필드를 BookSummaryModelisbn13 프로퍼티로 매핑하는 로직이 정확하게 업데이트되었습니다. 네트워크 응답 레이어의 변경사항과 완벽하게 일치합니다.

core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/di/DataStoreQualifier.kt (2)

11-11: 기존 한정자의 이름 변경이 적절합니다.

RecentSearchDataStore에서 BookRecentSearchDataStore로의 이름 변경이 기능을 명확하게 표현하며, 새로운 라이브러리 검색 기능과의 구분을 위해 적절한 변경입니다.


13-15: 새로운 라이브러리 검색 한정자가 올바르게 정의되었습니다.

LibraryRecentSearchDataStore 한정자가 기존 패턴과 일관성 있게 정의되었으며, 의존성 주입에서 라이브러리 검색 데이터 저장소를 구분하는 데 적절합니다.

feature/search/src/main/res/values/strings.xml (1)

18-21: 내서재 검색 기능을 위한 문자열 리소스가 적절하게 추가되었습니다.

추가된 4개의 문자열 리소스들이 모두 적절합니다:

  • library_search_title: 화면 제목이 명확함
  • library_search_hint: 사용자에게 도움이 되는 힌트 텍스트
  • library_book_item_records: 도서 아이템의 기록 수를 나타내는 라벨
  • library_empty_result: 검색 결과가 없을 때의 안내 메시지

모든 문자열이 기존 네이밍 컨벤션과 일치하며, 한국어 문구도 자연스럽고 사용자 친화적입니다.

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

67-73: 메서드 명 변경 및 검색 파라미터 추가가 적절합니다.

getLibrary에서 getLibraryBooks로 메서드명이 변경되었고, title 파라미터가 추가되어 내서재 도서 검색 기능을 지원합니다. title 파라미터가 nullable로 설정되어 기존 호출과의 호환성을 유지하면서 새로운 검색 기능을 제공할 수 있습니다.

feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/HandlingBookSearchSideEffect.kt (1)

1-23: 검색 기능 분리 리팩토링이 적절합니다.

패키지 구조를 book 하위로 이동하고 함수명과 타입들을 Book 관련으로 특화한 것이 적절합니다. 기존 로직은 그대로 유지하면서 타입 안전성을 높였습니다.

feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/library/HandlingLibrarySearchSideEffect.kt (1)

1-23: 라이브러리 검색 사이드 이펙트 핸들러가 올바르게 구현되었습니다.

Book 검색 핸들러와 일관된 패턴으로 구현되어 코드 일관성을 유지합니다. LibrarySearchUiStateLibrarySearchSideEffect를 사용하여 타입 안전성을 보장하고 있습니다.

feature/library/src/main/kotlin/com/ninecraft/booket/feature/library/LibraryPresenter.kt (3)

35-35: PAGE_SIZE 증가가 합리적입니다.

페이지 크기를 10에서 20으로 증가시켜 네트워크 요청 횟수를 줄이고 사용자 경험을 개선했습니다.


55-63: 메서드명 변경이 적절합니다.

getLibraryBooks에서 filterLibraryBooks로 메서드명을 변경하여 네트워크 서비스 레이어의 변경사항과 일치시켰습니다. 기능상 필터링 역할을 더 명확하게 표현합니다.


108-110: 검색 화면 네비게이션 추가가 기능을 완성시킵니다.

OnLibrarySearchClick 이벤트 핸들러를 추가하여 사용자가 검색 화면으로 이동할 수 있게 했습니다. 내서재 도서 검색 기능의 핵심 진입점을 제공합니다.

core/designsystem/src/main/kotlin/com/ninecraft/booket/core/designsystem/component/textfield/ReedSearchTextField.kt (3)

56-57: UI 컴포넌트 유연성 향상이 우수합니다.

borderStroke를 nullable로 만들고 searchIconTint 파라미터를 추가하여 컴포넌트의 재사용성과 커스터마이징 가능성을 크게 향상시켰습니다.


81-87: 조건부 border 적용 로직이 깔끔합니다.

borderStroke가 null이 아닐 때만 border를 적용하는 로직이 간결하고 읽기 쉽게 구현되었습니다.


121-121: 검색 아이콘 색상 커스터마이징이 적절합니다.

searchIconTint 파라미터를 통해 검색 아이콘의 색상을 커스터마이징할 수 있게 하여 다양한 UI 테마에 대응할 수 있습니다.

core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/datasource/DefaultBookRecentSearchDataSource.kt (2)

17-19: 클래스 특화 변경사항이 적절합니다

일반적인 최근 검색을 책 전용으로 특화한 변경사항이 올바르게 적용되었습니다. 클래스명, 인터페이스, DataStore qualifier 모두 일관성 있게 변경되었습니다.


100-100: Preference key 네이밍이 일관성 있게 변경되었습니다

RECENT_SEARCHES에서 BOOK_RECENT_SEARCHES로 변경하여 책 전용 데이터임을 명확히 표현했습니다.

feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchUiState.kt (3)

1-1: 패키지 구조 개선이 적절합니다

검색 기능을 책 검색과 라이브러리 검색으로 분리하면서 패키지 구조가 더 명확해졌습니다.


22-39: UI 상태 클래스 특화가 올바르게 적용되었습니다

SearchUiStateBookSearchUiState로 변경하고 관련 타입들도 일관성 있게 Book 접두사를 추가했습니다. 내부 로직은 그대로 유지되어 안정성이 보장됩니다.


66-75: Enum 클래스명 변경이 의미적으로 더 명확합니다

SearchBookStatusBookRegisteredState로 변경하여 책의 등록 상태를 더 명확하게 표현했습니다.

feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/library/component/LibraryBookItem.kt (2)

29-34: 컴포넌트 구조가 잘 설계되었습니다

LibraryBookSummaryModel을 받아서 책 정보를 표시하는 구조가 적절하고, 클릭 콜백 처리도 올바르게 구현되었습니다.


111-126: 프리뷰 컴포넌트가 적절하게 구현되었습니다

ComponentPreview 어노테이션을 사용하고 실제적인 더미 데이터로 컴포넌트를 테스트할 수 있도록 구현되었습니다.

core/data/api/src/main/kotlin/com/ninecraft/booket/core/data/api/repository/BookRepository.kt (4)

10-11: 최근 검색 플로우 분리가 적절합니다

recentSearchesbookRecentSearcheslibraryRecentSearches로 분리하여 도메인별로 명확하게 구분했습니다.


18-18: 최근 검색 제거 메서드 분리가 일관성 있습니다

플로우 분리와 일관성 있게 제거 메서드도 removeBookRecentSearchremoveLibraryRecentSearch로 분리되었습니다.

Also applies to: 39-39


27-31: 메서드명 개선이 의미적으로 더 명확합니다

getLibraryfilterLibraryBooks로 변경하여 필터링 기능임을 명확하게 표현했습니다.


33-37: 새로운 라이브러리 검색 메서드가 적절하게 설계되었습니다

searchLibraryBooks 메서드가 title 파라미터와 페이징을 지원하도록 적절하게 설계되었습니다.

feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchPresenter.kt (4)

36-39: 프레젠터 클래스 특화가 적절하게 적용되었습니다

일반적인 검색에서 책 검색 전용으로 특화하면서 클래스명과 타입들이 일관성 있게 변경되었습니다.


51-51: Repository 메서드 변경이 올바르게 적용되었습니다

recentSearchesbookRecentSearches로 변경하여 분리된 데이터 소스를 올바르게 사용하고 있습니다.


107-107: ISBN 필드명 변경이 일관성 있게 적용되었습니다

isbnisbn13으로 변경하여 데이터 모델 변경사항과 일치합니다.


141-145: 최근 검색 클릭 시 텍스트 상태 처리가 개선되었습니다

기존 텍스트를 완전히 교체하는 로직으로 변경하여 더 명확한 동작을 보장합니다.

feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchUi.kt (1)

1-308: 변경사항이 잘 구현되었습니다!

도서 검색과 라이브러리 검색을 분리하는 리팩토링이 깔끔하게 진행되었습니다. 패키지 구조 변경, 타입 특화, UI 커스터마이징이 일관성 있게 적용되었습니다.

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

1-59: 레포지토리 리팩토링이 잘 구현되었습니다!

도서 검색과 라이브러리 검색을 위한 별도의 데이터 소스 분리가 깔끔하게 구현되었습니다. 각 기능에 대한 최근 검색 관리도 적절히 분리되어 있습니다.

feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/library/LibrarySearchUi.kt (1)

1-232: 라이브러리 검색 UI가 잘 구현되었습니다!

UI 상태 관리, 에러 처리, 페이지네이션이 적절히 구현되었습니다. 도서 검색 UI와의 시각적 차별화(배경색, 테두리 없음)도 일관성 있게 적용되었습니다.

feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/library/LibrarySearchUiState.kt (4)

1-11: 패키지 구조와 import가 적절합니다.

라이브러리 검색과 도서 검색의 분리를 명확히 반영한 패키지 구조이며, 필요한 의존성들이 정확하게 import되어 있습니다.


19-27: 상태 클래스가 잘 설계되었습니다.

immutable collection 사용과 적절한 기본값 설정이 좋습니다. Circuit 패턴을 올바르게 구현하고 있습니다.


29-34: 사이드 이펙트 패턴이 잘 구현되었습니다.

UUID를 사용한 unique key 패턴으로 사이드 이펙트의 중복 처리를 방지하는 좋은 설계입니다.


36-45: UI 이벤트가 포괄적이고 명확하게 정의되었습니다.

내서재 도서 검색에 필요한 모든 사용자 상호작용을 적절하게 커버하고 있으며, 각 이벤트의 파라미터가 명확하게 정의되어 있습니다. OnBookClick에서 userBookIdisbn을 모두 전달하는 것도 적절합니다.

core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/di/DataStoreModule.kt (4)

7-8: 분리된 데이터 소스 인터페이스가 적절하게 import되었습니다.

도서 검색과 라이브러리 검색의 최근 검색 기능을 분리하기 위한 새로운 인터페이스와 구현체들이 일관성 있게 import되었습니다.

Also applies to: 11-11, 13-13


32-33: Context extension이 적절하게 분리되었습니다.

도서 검색과 라이브러리 검색을 위한 별도의 DataStore extension이 명확하게 분리되어 네이밍도 일관성 있게 적용되었습니다.


43-55: provider 함수들이 일관성 있게 구현되었습니다.

두 개의 DataStore provider가 동일한 패턴으로 구현되어 있으며, 적절한 qualifier와 Singleton scope가 적용되었습니다.


77-85: 데이터 소스 바인딩이 적절하게 분리되었습니다.

단일 RecentSearchDataSource에서 BookRecentSearchDataSource와 LibraryRecentSearchDataSource로의 분리가 일관성 있게 구현되었으며, 각각의 기본 구현체와 올바르게 바인딩되었습니다.

@Stable
data class BookSummaryModel(
val isbn: String = "",
val isbn13: String = "",
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot Aug 4, 2025

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

ISBN 속성명 변경이 적절합니다.

isbn에서 isbn13으로 변경한 것은 더 명확한 식별자 사용을 위한 좋은 개선입니다. ISBN-13 표준을 명시적으로 나타내어 코드의 가독성을 향상시킵니다.

모든 관련 코드에서 일관되게 업데이트되었는지 확인하기 위해 다음 스크립트를 실행해주세요:


🏁 Script executed:

#!/bin/bash
# Description: isbn 속성 사용처를 검색하여 일관성 확인

# 구 속성명 사용처 검색
echo "=== 구 속성명 'isbn' 사용처 검색 ==="
rg -n "\.isbn[^1]" --type kotlin

# 새 속성명 사용처 검색  
echo "=== 새 속성명 'isbn13' 사용처 검색 ==="
rg -n "\.isbn13" --type kotlin

# BookSummaryModel 사용처 검색
echo "=== BookSummaryModel 사용처 검색 ==="
rg -A 3 -B 1 "BookSummaryModel" --type kotlin

Length of output: 23054


BookSummaryModel 변경 후 미반영된 속성 사용 수정 필요

모델에서 isbnisbn13으로 변경하셨습니다. 좋은 개선이지만, 아래 위치에서 여전히 구속성(isbn)을 사용 중이어서 컴파일 오류가 발생합니다. 다음 파일들을 검토하여 isbnisbn13으로 교체하고, 네비게이션 호출 및 화면 파라미터도 일치시켜 주세요:

  • feature/library/src/main/kotlin/com/ninecraft/booket/feature/library/LibraryPresenter.kt
    - navigator.goTo(BookDetailScreen(isbn = event.isbn))
    + navigator.goTo(BookDetailScreen(isbn13 = event.isbn13))
  • feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailPresenter.kt
    - upsertBook(screen.isbn, currentBookStatus.value)
    + upsertBook(screen.isbn13, currentBookStatus.value)
  • BookDetailScreen 및 관련 컴포넌트 선언에서도 파라미터명이 isbn에서 isbn13으로 일관되게 변경되었는지 확인

위 수정 후 빌드 및 동작을 다시 검증해 주세요.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
val isbn13: String = "",
// feature/library/src/main/kotlin/com/ninecraft/booket/feature/library/LibraryPresenter.kt
- navigator.goTo(BookDetailScreen(isbn = event.isbn))
+ navigator.goTo(BookDetailScreen(isbn13 = event.isbn13))
// feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailPresenter.kt
- upsertBook(screen.isbn, currentBookStatus.value)
+ upsertBook(screen.isbn13, currentBookStatus.value)
🤖 Prompt for AI Agents
In core/model/src/main/kotlin/com/ninecraft/booket/core/model/BookSearchModel.kt
at line 22, the property name was changed from isbn to isbn13, but other files
still use the old isbn property causing compile errors. Review and update all
references to isbn in
feature/library/src/main/kotlin/com/ninecraft/booket/feature/library/LibraryPresenter.kt,
feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailPresenter.kt,
and in BookDetailScreen and related components to use isbn13 consistently. Also
update navigation calls and screen parameters accordingly, then rebuild and test
the application.

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.

[1d6fb69] 고쳤는데 확인좀

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧩 Analysis chain

@seoyoon513 I'll verify your fix right away!


🏁 Script executed:

#!/bin/bash
# Check if the previously identified compilation errors have been fixed

echo "=== Checking LibraryPresenter.kt for isbn13 usage ==="
cat feature/library/src/main/kotlin/com/ninecraft/booket/feature/library/LibraryPresenter.kt | grep -n "BookDetailScreen\|isbn"

echo -e "\n=== Checking BookDetailPresenter.kt for isbn13 usage ==="
cat feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailPresenter.kt | grep -n "screen\.isbn\|upsertBook"

echo -e "\n=== Searching for any remaining .isbn usage (excluding isbn13) ==="
rg -n "\.isbn[^1]" --type kotlin

echo -e "\n=== Verifying BookDetailScreen parameter ==="
rg -n "BookDetailScreen" --type kotlin -A 2 -B 1

Length of output: 8650


@seoyoon513 거의 다 고쳐졌는데 한 곳 더 수정이 필요해요!


🏁 Script executed:

#!/bin/bash
# Check the LibraryUiEvent structure to see if it has isbn property that needs updating
echo "=== Checking LibraryUiEvent structure ==="
rg -n "OnBookClick.*isbn" --type kotlin -A 2 -B 2

echo -e "\n=== Checking LibraryUiState and related event definitions ==="
cat feature/library/src/main/kotlin/com/ninecraft/booket/feature/library/LibraryUiState.kt | grep -A 5 -B 2 "OnBookClick"

Length of output: 2935


@seoyoon513 거의 완벽해요! 이벤트 클래스 2곳만 더 수정하면 됩니다:

수정이 필요한 곳:

  1. feature/library/src/main/kotlin/com/ninecraft/booket/feature/library/LibraryUiState.kt (Line 39):

    // 현재
    data class OnBookClick(val isbn: String) : LibraryUiEvent
    
    // 수정 필요
    data class OnBookClick(val isbn13: String) : LibraryUiEvent
  2. feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/library/LibrarySearchUiState.kt (Line 44):

    // 현재  
    data class OnBookClick(val userBookId: String, val isbn: String) : LibrarySearchUiEvent
    
    // 수정 필요
    data class OnBookClick(val userBookId: String, val isbn13: String) : LibrarySearchUiEvent

이 두 곳을 수정하면 LibraryPresenter.kt에서 event.isbn13을 제대로 참조할 수 있어서 컴파일 오류가 해결될 거예요.

나머지는 다 잘 고쳐졌습니다! 👍

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 (2)
feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/library/LibrarySearchPresenter.kt (2)

154-155: TODO 주석 처리 필요

도서 상세 화면에 userBookId를 추가로 전달해야 한다는 TODO가 있습니다. 내서재 도서의 경우 사용자별 도서 정보가 필요할 수 있으니 이 작업을 추적하여 완료해야 합니다.

이 TODO를 처리하기 위한 이슈를 생성하거나 구현 방안을 제안해드릴까요?


154-155: TODO 항목 해결을 도와드릴 수 있습니다.

도서 상세 화면에 userBookId 전달이 필요한 상황입니다. 현재는 isbn만 전달하고 있네요.

BookDetailScreen 인터페이스 수정이나 새로운 화면 정의가 필요하다면 구현 방안을 제안해드릴 수 있습니다. 새로운 이슈로 생성하시겠습니까?

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 868e30f and 06231f5.

📒 Files selected for processing (7)
  • core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/datasource/DefaultLibraryRecentSearchDataSource.kt (1 hunks)
  • core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/di/DataStoreModule.kt (4 hunks)
  • feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailPresenter.kt (1 hunks)
  • feature/library/src/main/kotlin/com/ninecraft/booket/feature/library/LibraryPresenter.kt (4 hunks)
  • feature/screens/src/main/kotlin/com/ninecraft/booket/feature/screens/Screens.kt (2 hunks)
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchPresenter.kt (7 hunks)
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/library/LibrarySearchPresenter.kt (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • feature/library/src/main/kotlin/com/ninecraft/booket/feature/library/LibraryPresenter.kt
  • feature/screens/src/main/kotlin/com/ninecraft/booket/feature/screens/Screens.kt
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchPresenter.kt
  • core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/di/DataStoreModule.kt
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
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: in the reed-android project's termsagreementscreen.kt, the ontermdetailclick event is intentionally ...
Learnt from: seoyoon513
PR: YAPP-Github/Reed-Android#35
File: feature/login/src/main/kotlin/com/ninecraft/booket/feature/login/TermsAgreementScreen.kt:127-127
Timestamp: 2025-07-09T01:14:29.836Z
Learning: In the Reed-Android project's TermsAgreementScreen.kt, the OnTermDetailClick event is intentionally passed an empty string for the URL parameter because the actual URLs for terms detail pages haven't been decided yet. This is a temporary implementation that will be updated once the URLs are finalized.

Applied to files:

  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/library/LibrarySearchPresenter.kt
📚 Learning: feature/library의 librarypresenter에서 현재 filterchipstate의 카운트 값들은 ui 확인용 더미 데이터이며, api가 준비되면 실제 데이터로 교...
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가 준비되면 실제 데이터로 교체될 예정입니다.

Applied to files:

  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/library/LibrarySearchPresenter.kt
🧬 Code Graph Analysis (1)
feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/library/LibrarySearchPresenter.kt (3)
core/common/src/main/kotlin/com/ninecraft/booket/core/common/utils/HandleException.kt (1)
  • handleException (13-40)
core/data/api/src/main/kotlin/com/ninecraft/booket/core/data/api/repository/BookRepository.kt (1)
  • searchLibraryBooks (33-37)
core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/repository/DefaultBookRepository.kt (1)
  • searchLibraryBooks (49-54)
⏰ 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 (8)
feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailPresenter.kt (1)

96-96: 일관성 있는 ISBN 속성 명명 업데이트 확인됨

screen.isbn에서 screen.isbn13으로의 변경이 올바르게 적용되었습니다. 이는 코드베이스 전반의 ISBN 속성 표준화와 일치하며, ISBN-13이 더 표준적인 식별자이므로 적절한 개선입니다.

core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/datasource/DefaultLibraryRecentSearchDataSource.kt (2)

17-103: 전체적으로 잘 구현된 데이터 소스 클래스입니다.

LibraryRecentSearchDataSource 인터페이스의 구현이 올바르게 되어 있고, JSON 직렬화/역직렬화, 에러 핸들링, upsert 로직, 최대 개수 제한 등이 적절히 처리되어 있습니다. 이전 리뷰에서 지적된 에러 메시지 문제도 수정되었습니다.


17-103: LGTM! 구현이 잘 되어 있습니다.

DefaultLibraryRecentSearchDataSource 구현이 전반적으로 잘 되어 있습니다. 이전 리뷰에서 지적된 오류 메시지 수정도 완료되었고, 다음과 같은 장점들이 있습니다:

  • 적절한 의존성 주입과 qualifier 사용
  • 반응형 Flow 기반 데이터 제공
  • 빈 문자열 검증 및 upsert 로직 구현
  • 포괄적인 예외 처리와 로깅
  • 최대 검색어 개수 제한 (10개)

도서 검색과 분리된 라이브러리 검색 데이터 소스로서 기능을 잘 수행할 것으로 보입니다.

feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/library/LibrarySearchPresenter.kt (5)

33-40: 생성자와 상수 정의가 적절합니다.

AssistedInject 패턴과 상수 정의가 올바르게 구현되어 있습니다.


42-55: 상태 관리가 올바르게 구현되었습니다.

rememberRetained와 collectAsRetainedState를 적절히 사용하여 구성 변경에도 안전한 상태 관리를 구현했습니다.


56-104: 검색 함수가 잘 구현되었습니다.

페이지네이션, 상태 관리, 에러 핸들링이 모두 적절히 처리되어 있습니다. 특히 첫 페이지와 추가 페이지 로딩을 구분하여 처리하는 로직이 정확합니다.


106-158: 이벤트 핸들링이 올바르게 구현되었습니다.

모든 UI 이벤트가 적절히 처리되고 있으며, 이전 리뷰에서 지적된 OnRetryClick의 쿼리 처리 문제도 수정되었습니다.


33-176: LGTM! 라이브러리 검색 프레젠터 구현이 우수합니다.

LibrarySearchPresenter 구현이 매우 잘 되어 있습니다:

  • Circuit 아키텍처와 retained state 적절히 활용
  • 페이지네이션 로직과 상태 관리 완성도 높음
  • 포괄적인 이벤트 처리 및 오류 처리
  • 기존 SearchPresenter와 일관된 패턴 유지
  • 이전 리뷰의 OnRetryClick 이슈도 수정 완료

@easyhooon
Copy link
Copy Markdown
Contributor

중간 interface...

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.

오우 interface에 interface를 상속한 구조로 구현한거군여
거의 같은 기능을 수행하는 dataSource이므로 이렇게도 구현할수가 있긴하겠네요 하나 배웠습니다~

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: 1

🧹 Nitpick comments (1)
feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/library/LibrarySearchUi.kt (1)

222-232: 프리뷰 기능 개선 제안

현재 프리뷰는 기본 상태만 보여줍니다. 다양한 UI 상태(로딩, 에러, 검색 결과 등)를 확인할 수 있도록 여러 프리뷰를 추가하면 개발 시 더 유용할 것입니다.

 @DevicePreview
 @Composable
 private fun LibrarySearchPreview() {
     ReedTheme {
         LibrarySearchUi(
             state = LibrarySearchUiState(
                 eventSink = {},
             ),
         )
     }
 }
+
+@DevicePreview
+@Composable
+private fun LibrarySearchSuccessPreview() {
+    ReedTheme {
+        LibrarySearchUi(
+            state = LibrarySearchUiState(
+                uiState = UiState.Success,
+                books = persistentListOf(
+                    // 더미 데이터 추가
+                ),
+                eventSink = {},
+            ),
+        )
+    }
+}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 06231f5 and 95283d8.

📒 Files selected for processing (5)
  • feature/library/src/main/kotlin/com/ninecraft/booket/feature/library/LibraryPresenter.kt (4 hunks)
  • feature/library/src/main/kotlin/com/ninecraft/booket/feature/library/LibraryUiState.kt (1 hunks)
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/library/LibrarySearchPresenter.kt (1 hunks)
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/library/LibrarySearchUi.kt (1 hunks)
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/library/LibrarySearchUiState.kt (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • feature/library/src/main/kotlin/com/ninecraft/booket/feature/library/LibraryPresenter.kt
  • feature/library/src/main/kotlin/com/ninecraft/booket/feature/library/LibraryUiState.kt
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/library/LibrarySearchPresenter.kt
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
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/search/src/main/kotlin/com/ninecraft/booket/feature/search/library/LibrarySearchUi.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 (4)
feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/library/LibrarySearchUi.kt (1)

39-59: LGTM! 잘 구성된 메인 UI 컴포저블입니다.

Circuit 아키텍처에 맞게 잘 구현되었고, 사이드 이펙트 처리와 UI 구조가 적절합니다.

feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/library/LibrarySearchUiState.kt (3)

12-17: 명확한 UI 상태 모델링

검색 기능에 필요한 모든 상태가 잘 정의되어 있습니다.


29-34: 사이드 이펙트 처리가 잘 구현되었습니다

UUID를 사용한 고유 키 생성으로 사이드 이펙트 중복 처리를 방지하는 좋은 패턴입니다.


36-45: 포괄적인 이벤트 정의

사용자 상호작용에 필요한 모든 이벤트가 명확하게 정의되어 있습니다. OnBookClick에서 userBookIdisbn13을 모두 전달하는 것은 적절한 설계입니다.

Comment on lines +142 to +145
items(
count = state.recentSearches.size,
key = { index -> state.recentSearches[index] },
) { index ->
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

최근 검색어 키 중복 가능성 확인 필요

최근 검색어가 중복될 경우 LazyColumn의 key로 사용하는 것이 문제가 될 수 있습니다. 인덱스를 포함한 복합 키를 사용하거나 중복을 방지하는 로직이 필요할 수 있습니다.


🏁 Script executed:

#!/bin/bash
# 최근 검색어 처리 로직 확인
ast-grep --pattern 'recentSearches'

# BookRepository에서 최근 검색어 관련 구현 확인
rg -A 5 "libraryRecentSearches|addLibraryRecentSearch" --type kotlin

Length of output: 6008


최근 검색어 중복에 따른 LazyColumn 키 충돌 예방 필요

현재 state.recentSearches 목록에 동일한 검색어가 중복 저장될 수 있어, 아래와 같이 검색어 자체만 키로 사용할 경우 LazyColumn이 아이템 재사용 시 예기치 않은 UI 갱신 오류가 발생할 수 있습니다.
인덱스 등을 함께 결합한 복합 키를 사용하거나, 검색어 추가 시 중복을 제거하는 로직을 적용해주세요.

• 대상 파일 및 위치
– feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/library/LibrarySearchUi.kt
– lines 143–145

• 제안하는 변경 사항

-   items(
-       count = state.recentSearches.size,
-       key = { index -> state.recentSearches[index] },
-   ) { index ->
+   items(
+       count = state.recentSearches.size,
+       key = { index -> "${state.recentSearches[index]}-$index" },
+   ) { index ->

• 대체 옵션
state.recentSearches를 업데이트할 때 List<String> 내 중복을 제거
– 키로 순수 인덱스(index)만 사용 (단, 순서 변경 시 유의)

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
items(
count = state.recentSearches.size,
key = { index -> state.recentSearches[index] },
) { index ->
// in feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/library/LibrarySearchUi.kt
// around lines 142–145
items(
count = state.recentSearches.size,
key = { index -> "${state.recentSearches[index]}-$index" },
) { index ->
//
}
🤖 Prompt for AI Agents
In
feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/library/LibrarySearchUi.kt
around lines 143 to 145, the current key for LazyColumn items uses only the
search term, which can cause key collisions if duplicates exist. To fix this,
modify the key to combine the index and the search term into a composite key, or
alternatively, ensure that duplicates are removed from state.recentSearches
before rendering. This will prevent UI update issues caused by key conflicts.

@seoyoon513
Copy link
Copy Markdown
Contributor Author

오우 interface에 interface를 상속한 구조로 구현한거군여 거의 같은 기능을 수행하는 dataSource이므로 이렇게도 구현할수가 있긴하겠네요 하나 배웠습니다~

최근 검색어는 특정 화면에서 별도 확장되는 기능은 없을거로 판단되어, 공통인터페이스를 상속한 중간 인터페이스를 두는걸로 설계햇습니다~

@seoyoon513 seoyoon513 merged commit afa26ff into develop Aug 4, 2025
2 checks passed
@seoyoon513 seoyoon513 deleted the BOOK-167-feature/#69 branch August 4, 2025 13:32
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-167/feat] 내서재 도서 검색 기능 구현

2 participants