Skip to content

fix: 도서 상세 UI 버그 수정#125

Merged
seoyoon513 merged 7 commits intodevelopfrom
BOOK-244-fix/#123
Aug 9, 2025
Merged

fix: 도서 상세 UI 버그 수정#125
seoyoon513 merged 7 commits intodevelopfrom
BOOK-244-fix/#123

Conversation

@seoyoon513
Copy link
Copy Markdown
Contributor

@seoyoon513 seoyoon513 commented Aug 9, 2025

🔗 관련 이슈

📙 작업 설명

  • 디자인 디테일 수정
  • 도서 상태 변경 UI 로직 수정
  • 전체 기록 개수 totalElements로 가져오기

🧪 테스트 내역

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

📸 스크린샷 또는 시연 영상

Reed_._UI.mp4

Summary by CodeRabbit

  • 신규 기능

    • 독서 기록의 페이지 정보 및 사용자가 선택한 도서 상태를 별도로 관리하는 기능이 추가되었습니다.
  • UI 개선

    • 책 표지에 테두리와 둥근 모서리가 적용되었습니다.
    • 저자와 출판사 정보의 레이아웃이 개선되었습니다.
    • 감정 분석 결과 영역의 테두리 색상과 패딩 순서가 조정되었습니다.
    • 독서 기록 헤더가 전체 기록 수를 정확히 표시하도록 개선되었습니다.
    • 도서 상태 변경 시, 선택된 상태와 현재 상태를 명확히 구분하여 동작합니다.
    • 페이지 번호 표기에서 "P"가 소문자 "p"로 변경되었습니다.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Aug 9, 2025

"""

Walkthrough

도서 상세 화면의 UI 상태 및 컴포넌트들이 개선되었습니다. 도서 상태 변경 로직이 분리되어 선택 중인 상태와 저장된 상태를 각각 관리하며, 독서 기록 개수는 페이지 정보의 totalElements로 표시됩니다. 일부 UI 디테일(테두리, 레이아웃 등)도 조정되었습니다.

Changes

Cohort / File(s) Change Summary
도서 상세 Presenter/State
feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailPresenter.kt, feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailUiState.kt
도서 상태 변경 UI를 위해 selectedBookStatus 상태 분리, 독서 기록 페이지네이션 정보를 위한 readingRecordsPageInfo 추가 및 상태 초기화/업데이트 로직 반영.
도서 상세 UI 및 Preview
feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailUi.kt, feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/BookItem.kt
내부 컴포저블 호출 방식 및 Preview 데이터 초기화 개선. BookItem에 테두리 추가, 저자/출판사 레이아웃 개선, BookItemPreview 추가.
BookUpdateBottomSheet
feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/BookUpdateBottomSheet.kt
selectedBookStatus 파라미터 추가, 선택/업데이트 로직을 해당 값 기준으로 일원화. Preview도 이에 맞게 수정.
독서 기록 헤더
feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/ReadingRecordsHeader.kt
파라미터를 리스트에서 PageInfoModel로 변경, 개수 표시를 totalElements 기반으로 수정.
CollectedSeeds UI
feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/CollectedSeeds.kt
테두리 색상 변경 및 padding/border 순서 조정.
RecordItem UI
feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/RecordItem.kt
페이지 번호 표시에서 접미사 대문자 'P'에서 소문자 'p'로 변경.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant BookDetailPresenter
    participant BookUpdateBottomSheet
    participant BookDetailUiState

    User->>BookUpdateBottomSheet: 도서 상태 선택
    BookUpdateBottomSheet->>BookDetailPresenter: selectedBookStatus 변경 요청
    BookDetailPresenter->>BookDetailUiState: selectedBookStatus 상태 갱신
    User->>BookUpdateBottomSheet: 상태 변경 확정(업데이트)
    BookUpdateBottomSheet->>BookDetailPresenter: 업데이트 요청(selectedBookStatus 사용)
    BookDetailPresenter->>BookDetailUiState: currentBookStatus, selectedBookStatus 동기화
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15 minutes

Assessment against linked issues

Objective Addressed Explanation
디자인 디테일 수정 (#123)
도서 상태 변경 UI 로직 수정 (#123)
전체 기록 개수 totalElements로 가져오기 (#123)

Assessment against linked issues: Out-of-scope changes

(변경 내역 중 요구사항과 무관한 기능적 코드 변경은 발견되지 않았습니다.)

Poem

🐇
책장 한켠, 상태도 쏙
토끼가 테두리 그려놓고
기록 개수도 딱 맞춰 넣었네
선택한 상태, 저장된 상태
UI도 반짝, 버그는 안녕!
도서 상세는 오늘도 완벽

📚✨
"""

Note

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

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


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0c3a257 and 78c6c7d.

📒 Files selected for processing (1)
  • feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailPresenter.kt (5 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailPresenter.kt
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: ci-build
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch BOOK-244-fix/#123

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.

@github-actions github-actions Bot requested a review from easyhooon August 9, 2025 07:42
@seoyoon513 seoyoon513 changed the title Book 244 fix/#123 fix: 도서 상세 UI 버그 수정 Aug 9, 2025
@github-actions github-actions Bot added the 🐞 fix Something isn't working label Aug 9, 2025
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

🔭 Outside diff range comments (2)
feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailPresenter.kt (2)

171-181: loadMore 시 PageInfo 갱신 누락

추가 페이지 로드시 pageInfo도 함께 갱신하세요. 또한 isLastPage는 가능하면 pageInfo 기반(last/totalPages 등)으로 계산하는 것이 더 정확합니다.

권장 diff:

                 ).onSuccess { result ->
                   readingRecords = (readingRecords + result.content).toPersistentList()
                   currentStartIndex = startIndex
-                  isLastPage = result.content.size < PAGE_SIZE
+                  // PageInfo 동기화
+                  readingRecordsPageInfo = result.page
+                  // 더 정확한 종료 판별(필드가 있다면)
+                  isLastPage = result.page.last
                   footerState = if (isLastPage) FooterState.End else FooterState.Idle
                 }.onFailure { exception ->

231-235: 정렬 변경 시 페이지네이션 불일치 위험: 페이지 인덱스 리셋 및 재조회 필요

지금은 정렬 변경 시 클라이언트에서 현재 목록만 재정렬하고, 이후 서버에서 새 정렬 기준의 page = currentStartIndex + 1를 요청합니다. 이전 정렬에서 몇 페이지를 이미 읽었는지에 따라 새 정렬의 앞쪽 페이지가 통째로 스킵되는 문제가 생길 수 있습니다.

필수 수정:

  • currentStartIndex를 0으로 리셋
  • isLastPage를 false로 리셋
  • 목록/페이지 정보 초기화
  • 새 정렬로 0페이지부터 재조회

권장 diff(핵심 부분):

- is BookDetailUiEvent.OnRecordSortItemSelected -> {
-   currentRecordSort = event.sortType
-   readingRecords = readingRecords.sortedWith(getRecordComparator(event.sortType)).toPersistentList()
-   isRecordSortBottomSheetVisible = false
- }
+ is BookDetailUiEvent.OnRecordSortItemSelected -> {
+   currentRecordSort = event.sortType
+   // 페이지네이션 상태 리셋
+   currentStartIndex = START_INDEX
+   isLastPage = false
+   readingRecords = persistentListOf()
+   readingRecordsPageInfo = PageInfoModel()
+   isRecordSortBottomSheetVisible = false
+   // 새 정렬 기준으로 0페이지부터 재조회
+   scope.launch {
+     footerState = FooterState.Loading
+     recordRepository.getReadingRecords(
+       userBookId = screen.userBookId,
+       sort = currentRecordSort.value,
+       page = START_INDEX,
+       size = PAGE_SIZE,
+     ).onSuccess { result ->
+       readingRecords = result.content.toPersistentList()
+       readingRecordsPageInfo = result.page
+       isLastPage = result.page.last
+       footerState = if (isLastPage) FooterState.End else FooterState.Idle
+       uiState = UiState.Success
+     }.onFailure { exception ->
+       Logger.d(exception)
+       val errorMessage = exception.message ?: "알 수 없는 오류가 발생했습니다."
+       footerState = FooterState.Error(errorMessage)
+     }
+   }
+ }

이렇게 해야 서버 페이징과 정렬 기준이 일관되게 맞아 떨어집니다.

🧹 Nitpick comments (13)
feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/CollectedSeeds.kt (1)

67-75: 미세 리팩터: shape 재사용 및 background에 shape 지정 고려

중복된 RoundedCornerShape 생성과 clip + background 조합을 정리하면 가독성과 경미한 성능에 이점이 있습니다.

옵션 A) background에 shape를 직접 지정하고 clip 제거:

-                .clip(RoundedCornerShape(ReedTheme.radius.sm))
-                .background(ReedTheme.colors.basePrimary)
+                .background(
+                    color = ReedTheme.colors.basePrimary,
+                    shape = RoundedCornerShape(ReedTheme.radius.sm),
+                )
                 .border(
                     width = 1.dp,
                     color = ReedTheme.colors.borderPrimary,
                     shape = RoundedCornerShape(ReedTheme.radius.sm),
                 )
                 .padding(ReedTheme.spacing.spacing3),

옵션 B) 동일 shape를 재사용(추가 코드 필요):

// Box 위쪽(동일 스코프)에서 한 번만 생성
val innerShape = RoundedCornerShape(ReedTheme.radius.sm)
-                .clip(RoundedCornerShape(ReedTheme.radius.sm))
-                .background(ReedTheme.colors.basePrimary)
+                .background(ReedTheme.colors.basePrimary, innerShape)
                 .border(
                     width = 1.dp,
-                    color = ReedTheme.colors.borderPrimary,
-                    shape = RoundedCornerShape(ReedTheme.radius.sm),
+                    color = ReedTheme.colors.borderPrimary,
+                    shape = innerShape,
                 )
                 .padding(ReedTheme.spacing.spacing3),

참고: 라이트/다크 모드 모두에서 보더 안쪽 배경 채움이 기대대로 보이는지만 한 번만 눈으로 확인 부탁드립니다.

feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailUi.kt (3)

85-107: 선택 상태 분리(selected vs current) 연동 OK. 바텀시트 닫힘 시 초기화 여부 확인 권장

UI 호출부에서 selectedBookStatus를 전달하도록 맞춰주신 부분 좋습니다. 다만 바텀시트를 닫거나 저장 성공 후에는 selectedBookStatus를 currentBookStatus로 되돌려 주지 않으면, 다음 오픈 시 이전 선택이 남아있어 버튼 enabled 상태가 의도치 않게 유지될 수 있습니다.

확인 사항:

  • OnBookStatusButtonClick 시 selectedBookStatus = currentBookStatus로 동기화하는지
  • OnBookUpdateBottomSheetDismiss/저장 성공 후 selectedBookStatus를 currentBookStatus로 리셋하는지

226-227: totalElements 표기 전환 OK. 숫자 가독성(천 단위 구분) 및 기본값 확인 제안

pageInfo.totalElements 사용으로 전체 개수 표기 정확도가 개선되었습니다.

  • 가독성을 위해 1,234 형태의 포맷 적용 고려(큰 수에서 효과적).
  • PageInfoModel 기본값(totalElements=0 등) 보장 여부 확인(Null/음수 방지).

302-309: 프리뷰 데이터 보강 제안

프리뷰에 샘플 BookDetailModel 추가 좋습니다. Header가 pageInfo를 사용하므로, 프리뷰에서도 읽기 기록 수를 확인할 수 있도록 pageInfo/선택 상태를 함께 설정하면 화면 검증에 유용합니다.

적용 예시(해당 블록 내 인자 추가):

 BookDetailUi(
   state = BookDetailUiState(
     uiState = UiState.Success,
     bookDetail = BookDetailModel(
       title = "데미안",
       author = "헤르만 헤세",
       publisher = "민음사",
       pubDate = "2023-01-01",
       coverImageUrl = "",
     ),
+    readingRecordsPageInfo = com.ninecraft.booket.core.model.PageInfoModel(totalElements = 134),
+    selectedBookStatus = com.ninecraft.booket.core.common.constants.BookStatus.BEFORE_READING,
     eventSink = {},
   ),
 )
feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/ReadingRecordsHeader.kt (1)

43-46: 카운트 텍스트 숫자 포맷팅 제안(가독성/재구성 최소화)

큰 수 표기 시 가독성을 위해 천 단위 구분자를 적용하는 것이 좋습니다. 재구성을 최소화하려면 remember로 래핑하세요.

적용 예시:

+import androidx.compose.runtime.remember
+import java.text.NumberFormat
 ...
-Text(
-    text = "${pageInfo.totalElements}",
+val totalText = remember(pageInfo.totalElements) {
+    NumberFormat.getNumberInstance().format(pageInfo.totalElements)
+}
+Text(
+    text = totalText,
     color = ReedTheme.colors.contentBrand,
     style = ReedTheme.typography.headline2SemiBold,
 )
feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailUiState.kt (1)

31-31: 페이징 상태 중복 가능성 점검(PageInfo vs 별도 필드)

readingRecordsPageInfo 도입으로 currentStartIndex/isLastPage와 역할이 겹칠 수 있습니다. 가능하다면 PageInfoModel을 단일 진실 공급원(SSOT)으로 삼고 중복 상태를 줄이는 방향을 검토해 주세요.

feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/BookItem.kt (2)

65-96: 저자/출판사 영역 너비 배분 개선 제안(weight fill=false 이슈)

author는 widthIn(max = 70%)로 상한을 두고, publisher는 weight로 남은 영역을 쓰는 접근은 좋습니다. 다만 Text(weight, fill=false)는 남은 공간을 충분히 사용하지 않아 불필요한 여백이 생길 수 있습니다. fill=true로 바꾸면 남은 영역을 확실히 활용해 엘리ipsis 동작이 안정적입니다.

아래만 교체하면 됩니다:

-                    Text(
+                    Text(
                         text = bookDetail.publisher,
                         color = ReedTheme.colors.contentTertiary,
                         overflow = TextOverflow.Ellipsis,
                         maxLines = 1,
                         style = ReedTheme.typography.label2Regular,
-                        modifier = Modifier.weight(1f, fill = false),
+                        modifier = Modifier.weight(1f, fill = true),
                     )

108-122: 프리뷰 시나리오 확장 제안(긴 텍스트 케이스)

박스 제약/ellipsis 검증을 위해 저자/출판사에 긴 문자열을 사용한 프리뷰를 하나 더 추가하면 레이아웃 검증에 도움이 됩니다.

feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/BookUpdateBottomSheet.kt (1)

116-118: 업데이트 버튼 활성 조건 개선 OK. currentBookStatus nullability 재검토 제안

current != selected 조건으로 UX가 선명해졌습니다. 도메인 상 currentBookStatus가 항상 존재한다면 nullable을 제거해 인터페이스 단순화가 가능합니다(검증 후 변경 권장).

feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailPresenter.kt (4)

74-74: selectedBookStatus 초기값 재검토

초기값을 READING으로 두면 초기 로딩 전 UI가 참조하는 경우 잘못된 하이라이트가 보일 수 있습니다(비록 BottomSheet가 기본 비활성이라 영향은 작음). 도메인 기본값(BEFORE_READING) 또는 currentBookStatus 오픈 시 동기화를 권장합니다.

-var selectedBookStatus by rememberRetained { mutableStateOf(BookStatus.READING) }
+var selectedBookStatus by rememberRetained { mutableStateOf(BookStatus.BEFORE_READING) }

105-105: PageInfo를 활용한 isLastPage 계산 권장

현재는 content.size < PAGE_SIZE로 마지막 페이지를 추정합니다. PageInfo에 last, totalPages, number 같은 필드가 있다면 이를 활용하면 불필요한 추가 호출을 줄일 수 있습니다.

예:

isLastPage = records.page.last
// 또는
isLastPage = records.page.number + 1 >= records.page.totalPages

220-221: BottomSheet 닫힘 시 선택값 리셋 고려

사용자가 저장 없이 닫을 경우 이전 선택이 남아 재오픈 시 혼란을 줄 수 있습니다. 닫기 이벤트에서 초기화하는 편이 UX 면에서 안전합니다.

예(참고: 다른 범위 수정):

 is BookDetailUiEvent.OnBookUpdateBottomSheetDismiss -> {
   isBookUpdateBottomSheetVisible = false
+  // 저장 없이 닫을 때는 선택값을 현재 저장 상태로 되돌림
+  selectedBookStatus = currentBookStatus
 }

224-225: 불필요한 업데이트 호출 가드 및 성공 후 동기화

이미 저장된 상태와 동일하면 호출을 생략하고 즉시 닫는 가드가 있으면 좋습니다.

- is BookDetailUiEvent.OnBookStatusUpdateButtonClick -> {
-   upsertBook(screen.isbn13, selectedBookStatus.value)
- }
+ is BookDetailUiEvent.OnBookStatusUpdateButtonClick -> {
+   if (selectedBookStatus == currentBookStatus) {
+     isBookUpdateBottomSheetVisible = false
+     return
+   }
+   upsertBook(screen.isbn13, selectedBookStatus.value)
+ }

또한 onSuccess 시 selectedBookStatus를 currentBookStatus로 한 번 더 맞춰두면 상태 일관성이 명확해집니다(현재도 동일 값이지만 의도 표현 차원에서 유익).

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between e5ad34d and 5df34fe.

📒 Files selected for processing (7)
  • feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailPresenter.kt (5 hunks)
  • feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailUi.kt (4 hunks)
  • feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailUiState.kt (2 hunks)
  • feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/BookItem.kt (5 hunks)
  • feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/BookUpdateBottomSheet.kt (4 hunks)
  • feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/CollectedSeeds.kt (1 hunks)
  • feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/ReadingRecordsHeader.kt (2 hunks)
🧰 Additional context used
🧠 Learnings (8)
📓 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: 2025-07-31T23:17:40.054Z
Learnt from: easyhooon
PR: YAPP-Github/Reed-Android#88
File: feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/RecordItem.kt:29-37
Timestamp: 2025-07-31T23:17:40.054Z
Learning: Reed-Android 프로젝트에서는 API가 준비되지 않은 상황에서 UI를 먼저 구현하고, API 연동 시점에 하드코딩된 데이터를 실제 데이터로 교체하는 개발 방식을 사용한다. RecordItem 컴포넌트의 emotionTags 매개변수도 API 연동 시점에 `text = emotionTags.joinToString(separator = "·") { "#$it" }`로 적용될 예정이다.

Applied to files:

  • feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/CollectedSeeds.kt
📚 Learning: 2025-07-08T12:33:01.863Z
Learnt from: seoyoon513
PR: YAPP-Github/Reed-Android#32
File: core/designsystem/src/main/kotlin/com/ninecraft/booket/core/designsystem/component/button/ButtonColorStyle.kt:10-16
Timestamp: 2025-07-08T12:33:01.863Z
Learning: Reed Android 프로젝트에서 KAKAO 버튼 스타일은 디자이너가 pressed 상태 색상을 별도로 정의하지 않았기 때문에 pressed 상태에서도 동일한 Kakao 색상을 사용한다.

Applied to files:

  • feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailUi.kt
📚 Learning: 2025-07-12T01:33:57.101Z
Learnt from: seoyoon513
PR: YAPP-Github/Reed-Android#45
File: core/designsystem/src/main/kotlin/com/ninecraft/booket/core/designsystem/component/appbar/ReedTopAppBar.kt:65-65
Timestamp: 2025-07-12T01:33:57.101Z
Learning: Reed Android 프로젝트에서 타이포그래피 사용 규칙: 톱 앱바(Top App Bar)에서는 `headline2SemiBold`를 사용하고, 바텀시트(Bottom Sheet)에서는 `heading2SemiBold`를 사용한다. 이는 의도적인 디자인 시스템 차별화이다.

Applied to files:

  • feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailUi.kt
📚 Learning: 2025-07-20T12:34:23.786Z
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/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailUi.kt
  • feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/BookItem.kt
📚 Learning: 2025-07-31T16:58:59.404Z
Learnt from: easyhooon
PR: YAPP-Github/Reed-Android#88
File: core/model/src/main/kotlin/com/ninecraft/booket/core/model/EmotionModel.kt:11-18
Timestamp: 2025-07-31T16:58:59.404Z
Learning: Reed-Android 프로젝트에서 core:model 모듈은 순수 Kotlin 모듈이므로 Android 리소스(R.string 등)에 접근할 수 없다.

Applied to files:

  • feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailUi.kt
📚 Learning: 2025-07-09T01:14:29.836Z
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/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailUi.kt
📚 Learning: 2025-07-31T23:22:02.816Z
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/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailUi.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 (11)
feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/CollectedSeeds.kt (1)

71-75: borderPrimary 적용 + 패딩 순서 변경: LGTM

보더 컬러를 디자인 토큰(borderPrimary)로 통일하고, 패딩을 보더 이후에 적용하여 보더 안쪽 여백을 확보한 점이 의도에 부합합니다. 시각적으로도 일관성 개선에 도움이 됩니다.

feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailUi.kt (1)

40-40: 프리뷰/모델 import 추가 적절

BookDetailModel 사용(프리뷰/BookItem)에 필요한 import 추가, 이상 없습니다.

feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/ReadingRecordsHeader.kt (1)

25-29: ReadingRecordsHeader 호출부 검증 완료
rg를 통해 기존 readingRecords 파라미터를 사용하는 호출부를 모두 확인했으며, 더 이상 남아있는 곳이 없습니다.
모든 호출부가 새로 도입된 pageInfo 파라미터를 사용하도록 정상적으로 업데이트되었습니다.

feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailUiState.kt (1)

35-35: 선택 상태 분리 의도 적합. 라이프사이클 동기화 확인 권장

selectedBookStatus 추가로 UX가 명확해졌습니다. 다만 아래 흐름이 보장되는지 확인 부탁드립니다.

  • 바텀시트 오픈 시: selected = current
  • 저장 성공 시: current = selected
  • 취소/닫기 시: selected = current로 롤백
feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/BookItem.kt (1)

49-53: 커버 이미지 라운드+보더 적용 적절

클립과 동일한 shape로 border 적용한 순서/구성 모두 적절합니다. UI 디테일 개선 LGTM.

feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/BookUpdateBottomSheet.kt (3)

51-51: selectedBookStatus 파라미터 추가 적절

선택 상태를 명시적으로 주입받도록 변경한 방향 좋습니다.


98-104: 선택 토글 가드 로직 적절

이미 선택된 항목 재선택 시 이벤트를 막아 불필요한 상태 변경을 방지하는 로직이 명확합니다.


171-172: 프리뷰 보완 LGTM

새 파라미터(selectedBookStatus) 반영된 프리뷰 정상입니다.

feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailPresenter.kt (3)

18-18: PageInfoModel import 적절

페이지네이션 메타데이터(totalElements 등) 전달을 위한 올바른 추가입니다.


101-103: 서버 상태 기준으로 current/selected 동기화: LGTM

서버에서 내려온 userBookStatus를 매핑해 둘 다 초기화하는 접근이 의도와 일치합니다.


261-266: UiState에 신규 필드 전달: LGTM

  • readingRecordsPageInfo와 selectedBookStatus 전달이 Presenter→UI 경로에 잘 반영되었습니다.

Comment on lines +70 to 71
var readingRecordsPageInfo by rememberRetained { mutableStateOf(PageInfoModel()) }
var currentStartIndex by rememberRetained { mutableIntStateOf(START_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

readingRecordsPageInfo 상태 도입: OK. 이후 페이지 로드/정렬 변경 시 최신화 필요

초기 로드에서만 설정되어 있어 추가 페이지 로드(loadMore)나 정렬 변경 시 totalElements 등 표시가 갱신되지 않을 수 있습니다. 아래 별도 코멘트에서 loadMore 분기 내 갱신을 제안합니다.


🏁 Script executed:

#!/bin/bash
echo "=== Context around readingRecordsPageInfo declaration ==="
sed -n '1,100p' feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailPresenter.kt

echo -e "\n=== loadMore occurrences ==="
rg -n "loadMore" feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailPresenter.kt

echo -e "\n=== readingRecordsPageInfo usages ==="
rg -n -C3 "readingRecordsPageInfo" feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailPresenter.kt

Length of output: 7418


🏁 Script executed:

#!/bin/bash
# Show loadMoreReadingRecords implementation for verification
sed -n '140,260p' feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailPresenter.kt

Length of output: 4648


loadMoreReadingRecords 함수에 페이지 정보 갱신 로직 추가 필요

loadMoreReadingRecords 호출 시 onSuccess 블록에서 readingRecordsPageInfo 를 업데이트하지 않아, totalElements 등 페이지 정보가 초기값에 고정됩니다. 아래 위치에 result.page 를 반영하는 코드를 추가해 주세요.

  • 파일: feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailPresenter.kt
  • 함수: loadMoreReadingRecords
  • onSuccess 블록 내

제안하는 수정 예시:

 recordRepository.getReadingRecords(
     userBookId = screen.userBookId,
     sort = currentRecordSort.value,
     page = startIndex,
     size = PAGE_SIZE,
 ).onSuccess { result ->
-    readingRecords = (readingRecords + result.content).toPersistentList()
+    readingRecords = (readingRecords + result.content).toPersistentList()
+    readingRecordsPageInfo = result.page
     currentStartIndex = startIndex
     isLastPage = result.content.size < PAGE_SIZE
     footerState = if (isLastPage) FooterState.End else FooterState.Idle
 }
🤖 Prompt for AI Agents
In
feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailPresenter.kt
around lines 70-71, the loadMoreReadingRecords function's onSuccess block does
not update the readingRecordsPageInfo with the latest page data, causing page
info like totalElements to remain at initial values. To fix this, add code
inside the onSuccess block of loadMoreReadingRecords to assign result.page to
readingRecordsPageInfo, ensuring the page information is refreshed correctly
after each successful load.

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 8d6f61a into develop Aug 9, 2025
2 checks passed
@seoyoon513 seoyoon513 deleted the BOOK-244-fix/#123 branch August 9, 2025 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 fix Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BOOK-244/fix] 도서 상세 UI 버그 수정

2 participants