Skip to content

feat: 도서 검색에서 등록된 도서 및 등록 완료 도서 UI 비활성화 처리#92

Merged
seoyoon513 merged 3 commits intodevelopfrom
BOOK-203-feature/#91
Aug 1, 2025
Merged

feat: 도서 검색에서 등록된 도서 및 등록 완료 도서 UI 비활성화 처리#92
seoyoon513 merged 3 commits intodevelopfrom
BOOK-203-feature/#91

Conversation

@seoyoon513
Copy link
Copy Markdown
Contributor

@seoyoon513 seoyoon513 commented Aug 1, 2025

🔗 관련 이슈

📙 작업 설명

  • 도서 검색에서 등록된 도서 및 등록 완료 도서 UI 비활성화 처리

🧪 테스트 내역

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

📸 스크린샷 또는 시연 영상

Reed_._UI_Disable.mp4

Summary by CodeRabbit

  • 신규 기능

    • 도서 요약 정보에 사용자의 도서 등록 상태 표시 기능이 추가되었습니다.
    • 이미 등록된 도서는 검색 결과에서 비활성화되어, 시각적으로 구분되고 클릭할 수 없도록 개선되었습니다.
    • 등록된 도서에는 "이미 등록된 책입니다" 상태 라벨이 표시됩니다.
  • 스타일

    • 비활성화된 도서 항목에 대해 색상 및 인터랙션이 변경되어, 등록 상태를 명확하게 확인할 수 있습니다.
  • 문서화

    • "이미 등록된 책입니다"에 대한 신규 문자열 리소스가 추가되었습니다.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Aug 1, 2025

Walkthrough

도서 검색 결과에서 사용자의 도서 등록 상태(userBookStatus)를 모델, 네트워크, UI 계층 전반에 걸쳐 추가하고, 등록된 도서의 UI를 비활성화(Disabled) 처리하는 로직이 도입되었습니다. BookItem 컴포저블에 enabled 파라미터가 추가되어, 등록된 도서는 상호작용이 제한되고 시각적으로 구분됩니다.

Changes

Cohort / File(s) Change Summary
BookSummary에 userBookStatus 필드 추가
core/network/src/main/kotlin/com/ninecraft/booket/core/network/response/BookSearchResponse.kt
BookSummary 데이터 클래스에 userBookStatus: String 필드 추가 및 직렬화 어노테이션 적용
BookSummaryModel에 userBookStatus 필드 추가
core/model/src/main/kotlin/com/ninecraft/booket/core/model/BookSearchModel.kt
BookSummaryModel 데이터 클래스에 userBookStatus: String = "" 필드 추가
BookSummary → BookSummaryModel 변환 로직 수정
core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/mapper/ResponseToModel.kt
BookSummary.toModel()에서 userBookStatus 필드 포함하도록 반환값 수정
등록 상태 기반 UI 및 상태 처리 개선
feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/SearchPresenter.kt,
feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/SearchUi.kt,
feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/component/BookItem.kt,
feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/SearchUiState.kt
BookItem에 enabled 파라미터 추가, 등록된 도서의 UI 비활성화 및 시각적 표시, 등록 상태 enum(SearchBookStatus) 도입, 도서 등록 시 상태 갱신 로직 추가
상태 텍스트 리소스 추가
feature/search/src/main/res/values/strings.xml
등록된 도서 상태 안내 문자열(book_status_registered) 추가

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant SearchScreen
    participant Presenter
    participant Model
    participant Network

    User->>SearchScreen: 도서 검색 실행
    SearchScreen->>Presenter: 검색 요청
    Presenter->>Network: 도서 목록 요청
    Network-->>Presenter: BookSummary(userBookStatus 포함) 리스트 반환
    Presenter->>Model: BookSummary.toModel() (userBookStatus 포함)
    Model-->>Presenter: BookSummaryModel(userBookStatus 포함) 리스트
    Presenter-->>SearchScreen: BookSummaryModel 리스트 전달
    SearchScreen->>BookItem: enabled = (userBookStatus == BEFORE_REGISTRATION)
    User->>BookItem: 클릭 시도
    alt enabled == true
        BookItem->>Presenter: onBookClick 호출
    else enabled == false
        BookItem-->>User: 비활성화 상태, 클릭 무시
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15 minutes

Assessment against linked issues

Objective Addressed Explanation
도서 검색에서 등록한 도서 UI Disabled 처리 (#91)
BEFORE_REGISTRATION 상태일 때 BookItem 아이템 UI 정책 적용 (#91)

Assessment against linked issues: Out-of-scope changes

(해당 변경사항에서 범위 밖의 변경사항은 발견되지 않았습니다.)

Possibly related PRs

Suggested labels

✨ feat

Poem

책을 찾는 토끼가 말했지,
"등록된 책은 클릭 금지!"
상태값 따라 색이 달라지고,
비활성화된 버튼엔 토끼도 쉬고.
이제 도서 등록, 실수 없이
Booket 속 토끼, 기쁘게 뛰노네! 🐇📚

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-203-feature/#91

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 (1)
feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/component/BookItem.kt (1)

54-79: 비활성화 상태의 시각적 처리가 효과적입니다.

Box를 사용하여 이미지 위에 반투명 오버레이를 적용한 방식이 사용자에게 명확한 비활성화 상태를 전달합니다.

향후 재사용성을 고려한다면 비활성화 오버레이 기능을 별도 컴포저블로 분리하는 것을 고려해볼 수 있습니다:

+@Composable
+fun DisabledOverlay(
+    enabled: Boolean,
+    modifier: Modifier = Modifier,
+    content: @Composable () -> Unit
+) {
+    Box(modifier = modifier) {
+        content()
+        if (!enabled) {
+            Box(
+                modifier = Modifier
+                    .matchParentSize()
+                    .background(Color.Black.copy(alpha = 0.3f)),
+            )
+        }
+    }
+}
📜 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 c8ea113.

📒 Files selected for processing (8)
  • core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/mapper/ResponseToModel.kt (1 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)
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/SearchPresenter.kt (1 hunks)
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/SearchUi.kt (1 hunks)
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/SearchUiState.kt (1 hunks)
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/component/BookItem.kt (5 hunks)
  • feature/search/src/main/res/values/strings.xml (1 hunks)
🧰 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/component/BookItem.kt
🧬 Code Graph Analysis (1)
feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/component/BookItem.kt (1)
core/designsystem/src/main/kotlin/com/ninecraft/booket/core/designsystem/component/NetworkImage.kt (1)
  • NetworkImage (17-39)
⏰ 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 (11)
core/model/src/main/kotlin/com/ninecraft/booket/core/model/BookSearchModel.kt (1)

27-27: LGTM! 깔끔한 구현입니다.

userBookStatus 속성이 적절하게 추가되었습니다. 기본값으로 빈 문자열을 사용하여 null 안전성을 보장하고, 네이밍 컨벤션도 일관성 있게 적용되었습니다.

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

17-17: LGTM! 적절한 문자열 리소스 추가입니다.

등록된 책 상태를 나타내는 한국어 문자열이 명확하고 사용자 친화적으로 작성되었습니다. 네이밍 컨벤션도 기존 리소스들과 일관성 있게 적용되었습니다.

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

236-236: SearchBookStatus 구현 확인 완료
SearchBookStatus enum 클래스는 아래와 같이 정의되어 있으며,
from() 메서드는 nullable 입력에 대해 일치하는 항목이 없으면 null을 반환합니다.
SearchBookStatus.from(state.books[index].userBookStatus) == SearchBookStatus.BEFORE_REGISTRATION 비교 식은

  • value"BEFORE_REGISTRATION"일 때만 true를 반환
  • 그 외(null 포함)의 경우 false로 처리되어 안전하게 동작합니다.

따라서 현재 로직은 의도대로 동작하며, 별도의 수정이 필요 없습니다.

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

58-58: LGTM! 정확한 매핑 구현입니다.

userBookStatus 속성이 네트워크 응답에서 도메인 모델로 올바르게 매핑되었습니다. 다른 속성들과 일관된 패턴을 따르고 있어 코드의 가독성이 좋습니다.

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

105-109: LGTM! 올바른 로컬 상태 업데이트 구현입니다.

도서 등록 성공 후 로컬 책 목록의 userBookStatus를 업데이트하여 UI와 데이터의 일관성을 유지하는 로직이 잘 구현되었습니다. 불변성을 유지하면서 상태를 업데이트하는 패턴도 적절합니다.

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

44-45: 네트워크 모델에 사용자 도서 상태 필드 추가가 적절합니다.

userBookStatus 프로퍼티가 올바른 직렬화 어노테이션과 함께 추가되어 서버에서 도서 등록 상태 정보를 받아올 수 있게 되었습니다.

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

66-75: 도서 상태를 나타내는 enum 클래스가 잘 구현되었습니다.

SearchBookStatus enum과 from() 메서드가 적절하게 구현되어 문자열 상태값을 타입 안전하게 처리할 수 있습니다. null safety도 제대로 고려되었습니다.

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

38-38: enabled 파라미터 추가가 적절합니다.

기본값 true로 설정하여 기존 코드와의 호환성을 유지하면서 새로운 기능을 추가했습니다.


40-42: 디자인 시스템을 활용한 색상 처리가 좋습니다.

enabled 상태에 따라 적절한 색상을 선택하여 일관된 UI/UX를 제공합니다.


48-50: 조건부 클릭 처리가 올바르게 구현되었습니다.

비활성화된 상태에서는 클릭 이벤트를 방지하여 사용자 경험을 개선했습니다.


82-91: 등록 완료 상태 표시가 사용자 친화적입니다.

성공 색상과 적절한 스타일링으로 등록된 도서임을 명확하게 표시하고, 문자열 리소스를 활용하여 다국어 지원도 고려했습니다.

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.

LGTM!

@seoyoon513 seoyoon513 merged commit a82f2d9 into develop Aug 1, 2025
5 checks passed
@seoyoon513 seoyoon513 deleted the BOOK-203-feature/#91 branch August 1, 2025 09:37
@coderabbitai coderabbitai Bot mentioned this pull request Aug 4, 2025
4 tasks
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-203/feat] 도서 검색에서 등록한 도서 UI 처리

2 participants