Skip to content

feat: 책 등록 분기 처리 적용#189

Merged
easyhooon merged 1 commit intodevelopfrom
BOOK-352-feature/#184
Oct 16, 2025
Merged

feat: 책 등록 분기 처리 적용#189
easyhooon merged 1 commit intodevelopfrom
BOOK-352-feature/#184

Conversation

@easyhooon
Copy link
Copy Markdown
Contributor

@easyhooon easyhooon commented Oct 16, 2025

🔗 관련 이슈

📙 작업 설명

  • 책 등록 읽기 전/읽는 중/독서 완료에 따라 책 등록시 바텀시트 텍스트 및 버튼 분기 처리 적용

🧪 테스트 내역 (선택)

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

📸 스크린샷 또는 시연 영상 (선택)

default.mp4

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

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능
    • 책 등록 성공 시 책의 상태(읽기 전, 읽는 중, 완료)에 따라 다른 메시지를 표시하도록 개선
    • 책 상태별로 다양한 확인 버튼 옵션 추가 - 읽기 전에는 단일 확인 버튼, 다른 상태에서는 취소/확인 버튼 제공
    • 사용자가 등록한 책의 상태에 맞는 명확한 피드백 제공

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Oct 16, 2025

둘러보기

책 등록 기능에 성공 상태 분기 처리 추가. upsertedBookStatus 필드를 UI 상태에 도입하여 등록된 책의 상태(읽기전, 읽는중, 완료)에 따라 성공 바텀시트의 표시 내용과 액션 버튼을 동적으로 변경합니다.

변경사항

집합 / 파일 변경 요약
상태 관리 레이어
feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchPresenter.kt
책 등록 성공 시 선택된 상태를 upsertedBookStatus에 저장하고 UI 상태에 포함시킵니다.
UI 상태 데이터 클래스
feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchUiState.kt
upsertedBookStatus: BookStatus? = null 필드 추가
Compose UI 계층
feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchUi.kt
upsertedBookStatus가 null이 아닐 때만 성공 바텀시트 렌더링, 상태값 전달
바텀시트 컴포넌트
feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/component/BookRegisterSuccessBottomSheet.kt
upsertedBookStatus 매개변수 추가. 상태별로 설명 텍스트(읽기전/읽는중/완료)와 액션 버튼(읽기전은 확인만, 나머지는 취소/확인) 동적 변경
리소스 문자열
feature/search/src/main/res/values/strings.xml
4개 새 문자열 리소스 추가: book_register_success_description_before_reading, book_register_success_description_completed, book_register_success_ok_before_reading, book_register_success_ok_completed

시퀀스 다이어그램

sequenceDiagram
    participant User as 사용자
    participant Presenter as BookSearchPresenter
    participant UiState as BookSearchUiState
    participant UI as BookSearchContent
    participant BottomSheet as BookRegisterSuccessBottomSheet

    User->>Presenter: 책 등록 (상태 선택)
    Presenter->>Presenter: upsertBook 실행
    alt 등록 성공
        Presenter->>Presenter: upsertedBookStatus = selectedBookStatus
        Presenter->>UiState: BookSearchUiState 업데이트
    end
    UiState->>UI: 상태 변경 감지
    UI->>UI: upsertedBookStatus 확인
    alt upsertedBookStatus != null
        UI->>BottomSheet: 바텀시트 렌더링 (상태 전달)
        BottomSheet->>BottomSheet: 상태별 UI 결정
        alt BEFORE_READING
            BottomSheet->>UI: 확인 버튼만 표시
        else READING / COMPLETED
            BottomSheet->>UI: 취소 및 확인 버튼 표시
        end
    end
    User->>BottomSheet: 버튼 클릭
    BottomSheet->>Presenter: 콜백 (닫기/확인)
    Presenter->>UiState: upsertedBookStatus 초기화 (null)
Loading

코드 리뷰 예상 소요 시간

🎯 2 (단순) | ⏱️ ~12분

상태 필드 추가와 조건부 렌더링이라는 명확한 패턴의 변경입니다. 각 파일의 수정이 일관되고 반복적이며, 새로운 복잡한 로직 없이 기존 구조 내 상태 분기 처리만 도입됩니다.

📚 읽기전 책 추가했으니
기록 버튼은 쏙 숨겨두고
상태별로 팝업도 달라져
BEFORE, READING, COMPLETED
분기 처리로 우아하게 ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed 제목인 "feat: 책 등록 분기 처리 적용"은 PR에서 구현된 책 등록 분기 처리 기능의 핵심을 간결하게 요약하고 있어 변경 사항과 명확하게 부합합니다.
Linked Issues Check ✅ Passed 해당 PR은 읽기전 상태에서 기록 남기기 버튼을 숨기고 확인 버튼만 표시하도록 BookRegisterSuccessBottomSheet 컴포저블을 분기 처리하여 이슈 #184의 요구 사항을 정확히 충족합니다.
Out of Scope Changes Check ✅ Passed 변경된 모든 코드는 책 등록 분기 처리와 이를 위한 상태 전파 및 UI 렌더링 로직에 집중되어 있으며 연결된 이슈 범위를 벗어나는 불필요한 변경은 없습니다.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch BOOK-352-feature/#184

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

Comment @coderabbitai help to get the list of available commands and usage tips.

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/book/BookSearchPresenter.kt (1)

238-240: 상태 관리 개선 고려

성공 bottom sheet를 닫을 때 upsertedBookStatus도 함께 초기화하는 것을 고려해보세요. 현재는 기능적으로 문제가 없지만, 오래된 상태 값이 메모리에 남아있게 됩니다.

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

 is BookSearchUiEvent.OnBookRegisterSuccessBottomSheetDismiss -> {
     isBookRegisterSuccessBottomSheetVisible = false
+    upsertedBookStatus = null
 }

OnBookRegisterSuccessOkButtonClickOnBookRegisterSuccessCancelButtonClick 이벤트 핸들러에도 동일하게 적용하는 것이 좋습니다.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a4807d2 and 2d89bc5.

📒 Files selected for processing (5)
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchPresenter.kt (3 hunks)
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchUi.kt (1 hunks)
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchUiState.kt (1 hunks)
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/component/BookRegisterSuccessBottomSheet.kt (6 hunks)
  • feature/search/src/main/res/values/strings.xml (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-28T12:25:54.058Z
Learnt from: easyhooon
PR: YAPP-Github/Reed-Android#174
File: feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchPresenter.kt:128-133
Timestamp: 2025-08-28T12:25:54.058Z
Learning: In BookSearchPresenter.kt, when a guest user tries to register a book and is redirected to login, the bottom sheet (isBookRegisterBottomSheetVisible) and selection state (selectedBookIsbn, selectedBookStatus) are intentionally kept open/preserved so that when the user returns from login, they can continue from where they left off without losing context.

Applied to files:

  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchUiState.kt
  • 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/component/BookRegisterSuccessBottomSheet.kt
🧬 Code graph analysis (2)
feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchUi.kt (1)
feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/component/BookRegisterSuccessBottomSheet.kt (1)
  • BookRegisterSuccessBottomSheet (32-133)
feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/component/BookRegisterSuccessBottomSheet.kt (2)
core/designsystem/src/main/kotlin/com/ninecraft/booket/core/designsystem/component/button/ReedButton.kt (1)
  • ReedButton (34-114)
core/designsystem/src/main/kotlin/com/ninecraft/booket/core/designsystem/theme/Theme.kt (1)
  • ReedTheme (14-21)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: ci-build
🔇 Additional comments (10)
feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchUiState.kt (1)

34-34: LGTM!

책 등록 성공 후 사용된 상태를 추적하기 위한 upsertedBookStatus 필드 추가가 적절합니다.

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

74-74: LGTM!

책 등록 후 사용된 상태를 추적하기 위한 upsertedBookStatus 상태 변수 추가가 적절합니다.


141-142: LGTM!

책 등록 성공 후 upsertedBookStatus에 상태를 저장하고 selectedBookStatus를 초기화하는 로직이 올바릅니다. 이를 통해 성공 bottom sheet에서 올바른 상태 기반 UI를 표시할 수 있습니다.


267-267: LGTM!

UI state에 upsertedBookStatus를 포함시켜 하위 컴포넌트에서 사용할 수 있도록 한 것이 적절합니다.

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

12-13: LGTM!

각 독서 상태(읽기 전, 독서 완료)에 맞는 설명 텍스트와 버튼 레이블이 적절하게 추가되었습니다. 사용자에게 명확한 안내를 제공합니다.

Also applies to: 16-17

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

268-286: LGTM!

state.upsertedBookStatus가 non-null일 때만 성공 bottom sheet를 렌더링하도록 한 것이 올바릅니다. null 안전성을 확보하면서 upsertedBookStatus를 하위 컴포넌트에 전달합니다.

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

37-37: LGTM!

upsertedBookStatus 파라미터 추가로 등록된 책의 상태에 따라 동적으로 UI를 렌더링할 수 있게 되었습니다. modifier 기본값 추가도 적절합니다.

Also applies to: 40-40


73-79: LGTM!

독서 상태에 따라 적절한 설명 텍스트를 선택하는 로직이 올바릅니다. 각 상태별로 사용자에게 명확한 안내를 제공합니다.


87-130: LGTM! PR 목표 달성

독서 상태에 따른 버튼 분기 처리가 PR 목표와 정확히 일치합니다:

  • BEFORE_READING: 단일 "확인" 버튼만 표시 (기록 남기기 버튼 숨김) ✅
  • READING/COMPLETED: "나중에 하기"와 상태별 액션 버튼 표시

BEFORE_READING 상태에서 버튼 클릭 시 onCancelButtonClick을 호출하여 RecordScreen으로의 네비게이션 없이 bottom sheet만 닫는 것이 올바른 동작입니다.


138-196: LGTM!

세 가지 독서 상태(읽기 전, 읽는 중, 독서 완료) 모두에 대한 Preview 함수를 추가하여 디자인 검토 시 각 상태별 UI를 확인할 수 있도록 한 것이 좋습니다.

Copy link
Copy Markdown
Contributor

@seoyoon513 seoyoon513 left a comment

Choose a reason for hiding this comment

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

LGTM~

@easyhooon easyhooon merged commit 7b21598 into develop Oct 16, 2025
5 checks passed
@easyhooon easyhooon deleted the BOOK-352-feature/#184 branch October 16, 2025 15:12
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-352/feat] 책 등록 분기처리

2 participants