Skip to content

Conversation

@s9hn
Copy link
Member

@s9hn s9hn commented Aug 11, 2025

📌𝘐𝘴𝘴𝘶𝘦𝘴

📎𝘞𝘰𝘳𝘬 𝘋𝘦𝘴𝘤𝘳𝘪𝘱𝘵𝘪𝘰𝘯

  • 해당 뷰는 BaseActivity를 사용하지 않으므로, Scaffold로 감싸고, .windowInsetsPadding(WindowInsets.systemBars) 지정해줬습니다.

Summary by CodeRabbit

  • 새로운 기능
    • 평점에 0.5 단위 세분화(0.5~3.0 추가)로 보다 정밀한 평가 및 표시가 가능해졌습니다.
  • 버그 수정
    • 목록 새로고침 시 고정 시작점으로 로드되어 일관된 새로고침 동작을 제공합니다.
  • 리팩터링
    • 사용자 저장소 화면을 Compose 기반으로 전환하고 시스템바 여백을 반영한 Scaffold 구성으로 UI가 재구성되었습니다.

@s9hn s9hn self-assigned this Aug 11, 2025
@s9hn s9hn added ⚖️ 재상 세훈 전지적 세훈 시점 🔨 [FIX] 버그를 수정합니다. labels Aug 11, 2025
@coderabbitai
Copy link

coderabbitai bot commented Aug 11, 2025

Walkthrough

UserStorageActivity를 AppCompatActivity에서 ComponentActivity로 변경하고 Compose 기반 Scaffold로 UI를 구성하면서 시스템바 인셋 패딩을 적용했습니다. LibraryPagingSource의 getRefreshKey가 고정값(0L) 반환으로 변경되었고, Rating enum에 0.5~3.0 구간의 세부 단계가 추가되었습니다.

Changes

Cohort / File(s) Summary
UI Compose 마이그레이션 및 인셋 적용
app/src/main/java/com/into/websoso/ui/userStorage/UserStorageActivity.kt
Activity 상속을 AppCompatActivity(R.layout.activity_storage)ComponentActivity()로 변경. layout 리소스 제거, setContent로 Compose UI 구성. Scaffold/Box 사용 및 WindowInsets.systemBars 기반 windowInsetsPadding 적용. enableEdgeToEdge() 호출 제거.
레이아웃 삭제
app/src/main/res/layout/activity_storage.xml
activity_storage.xml 파일 삭제(빈 ConstraintLayout이었던 리소스 제거).
Paging refresh 키 정책 변경
data/library/src/main/java/com/into/websoso/data/library/paging/LibraryPagingSource.kt
getRefreshKey 로직에서 anchor 기반 계산 제거, 상수 DEFAULT_LAST_USER_NOVEL_ID(0L) 고정 반환으로 변경(로드 로직은 유지).
평점 단계 확장
domain/library/src/main/java/com/into/websoso/domain/library/model/Rating.kt
POINT_FIVE, ONE, ONE_POINT_FIVE, TWO, TWO_POINT_FIVE, THREE 등 6개 enum 상수(0.5f~3.0f) 추가. from(value: Float) 포맷 변경(동작 동일).

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant Activity as UserStorageActivity
  participant Compose as Scaffold/Box
  participant Screen as LibraryScreen

  User->>Activity: Start Activity
  Activity->>Compose: setContent(WebsosoTheme + Scaffold)
  Compose->>Compose: systemBars insets padding 적용
  Compose->>Screen: LibraryScreen(navigate lambdas)
Loading
sequenceDiagram
  participant UI as UI/Pager
  participant PS as LibraryPagingSource

  UI->>PS: refresh()
  PS-->>UI: getRefreshKey() = DEFAULT_LAST_USER_NOVEL_ID(0L)
  UI->>PS: load(key=0L)
  PS-->>UI: Page
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Assessment against linked issues

Objective Addressed Explanation
타유저 서재 뷰 상태바 패딩 적용 (#744)

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
Refresh 키를 고정값(0L)으로 변경 (data/library/.../LibraryPagingSource.kt) 페이징 재시작 정책 변경으로, 상태바 패딩(#744)과 직접 관련 없음.
Rating enum에 0.5~3.0 단계 추가 (domain/library/.../Rating.kt) UI 상태바 패딩 이슈와 무관한 도메인 모델 확장임.

Possibly related PRs

Suggested labels

♻️ [REFACTOR]

Suggested reviewers

  • junseo511
  • m6z1
  • yeonjeen

Poem

퐁당퐁당 창에 패딩 얹어,
Scaffold 위로 바람이 스며드네.
페이지는 0에서 다시 출발, 깡충!
별점은 더 작게, 반짝 반씩 늘어나—
토끼가 기뻐하며 코드밭을 뛰논다. 🐇✨


📜 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 daa7bb2 and 7336c98.

📒 Files selected for processing (3)
  • app/src/main/java/com/into/websoso/ui/userStorage/UserStorageActivity.kt (2 hunks)
  • app/src/main/res/layout/activity_storage.xml (0 hunks)
  • data/library/src/main/java/com/into/websoso/data/library/paging/LibraryPagingSource.kt (1 hunks)
💤 Files with no reviewable changes (1)
  • app/src/main/res/layout/activity_storage.xml
🚧 Files skipped from review as they are similar to previous changes (1)
  • data/library/src/main/java/com/into/websoso/data/library/paging/LibraryPagingSource.kt
🧰 Additional context used
🧬 Code Graph Analysis (1)
app/src/main/java/com/into/websoso/ui/userStorage/UserStorageActivity.kt (1)
feature/library/src/main/java/com/into/websoso/feature/library/LibraryScreen.kt (2)
  • LibraryScreen (48-113)
  • LibraryScreen (115-208)
⏰ 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: 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 feat/744

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

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

🧹 Nitpick comments (3)
data/library/src/main/java/com/into/websoso/data/library/paging/LibraryPagingSource.kt (1)

36-36: 리프레시 시작 키가 항상 0L로 설정됨 → 의도 여부 및 UX 영향 확인 필요

현재 LibraryPagingSource#getRefreshKey가 항상 DEFAULT_LAST_USER_NOVEL_ID(0L)를 반환하여 새로고침 시 무조건 첫 페이지부터 로드됩니다.
대용량 데이터에서 불필요한 네트워크 호출, 레이턴시 증가, 스크롤 위치 복원 실패 등의 UX 저하가 발생할 수 있으니, 변경 의도를 검토해 주세요.

점검된 위치:

  • data/library/src/main/java/com/into/websoso/data/library/paging/LibraryPagingSource.kt:36
    override fun getRefreshKey(state: PagingState<Long, NovelEntity>): Long = DEFAULT_LAST_USER_NOVEL_ID
  • core/database/src/main/java/com/into/websoso/core/database/datasource/library/paging/MapValuePagingSource.kt:34
    override fun getRefreshKey(state: PagingState<Key, To>): Key? = targetSource.getRefreshKey(...)

앵커 기반 리프레시 키 복원 예시:

override fun getRefreshKey(state: PagingState<Long, NovelEntity>): Long {
    val anchorPos = state.anchorPosition ?: return DEFAULT_LAST_USER_NOVEL_ID
    return state.closestItemToPosition(anchorPos)?.userNovelId
        ?: DEFAULT_LAST_USER_NOVEL_ID
}

– 의도된 동작인지, 아니면 위 예시처럼 앵커 기반 복원이 필요한지 확인 부탁드립니다.

domain/library/src/main/java/com/into/websoso/domain/library/model/Rating.kt (1)

22-25: Kotlin 1.9 미만 호환성 검증 필요
entries API는 Kotlin 1.9 이상에서만 안정화되었습니다. 프로젝트가 1.9 미만을 사용 중이라면 빌드 오류가 발생할 수 있으므로 아래 사항을 확인해주세요.

  • Gradle/Kotlin 플러그인 버전이 1.9 이상인지 검증
  • 만약 하위 호환성 유지가 필요하다면 values() 호출로 대체 고려
  • 새 enum 상수 삽입으로 ordinal 값이 변경될 수 있으니, 영속화/직렬화 로직에 미치는 영향 검토

File: domain/library/src/main/java/com/into/websoso/domain/library/model/Rating.kt
Lines: 22–25

-        fun from(value: Float): Rating =
-            entries.find {
+        fun from(value: Float): Rating =
+            values().find {
                 it.value.isCloseTo(value)
             } ?: DEFAULT
app/src/main/java/com/into/websoso/ui/userStorage/UserStorageActivity.kt (1)

39-39: 요구사항 확인: “상태바 패딩”만 필요하다면 systemBars 대신 statusBars 사용 권장

이슈/PR 제목은 상태바 패딩을 지칭합니다. 현재 WindowInsets.systemBars는 네비게이션 바까지 포함해 하단에도 패딩이 들어갑니다. 의도대로 상단만 필요하다면 아래 중 하나로 조정하세요.

  • 확장 함수 사용:
- .windowInsetsPadding(WindowInsets.systemBars)
+ .statusBarsPadding()
  • WindowInsets를 명시:
- .windowInsetsPadding(WindowInsets.systemBars)
+ .windowInsetsPadding(WindowInsets.statusBars)
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 46e3fa5 and daa7bb2.

📒 Files selected for processing (3)
  • app/src/main/java/com/into/websoso/ui/userStorage/UserStorageActivity.kt (2 hunks)
  • data/library/src/main/java/com/into/websoso/data/library/paging/LibraryPagingSource.kt (1 hunks)
  • domain/library/src/main/java/com/into/websoso/domain/library/model/Rating.kt (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
app/src/main/java/com/into/websoso/ui/userStorage/UserStorageActivity.kt (1)
feature/library/src/main/java/com/into/websoso/feature/library/LibraryScreen.kt (2)
  • LibraryScreen (48-113)
  • LibraryScreen (115-208)
🔇 Additional comments (2)
domain/library/src/main/java/com/into/websoso/domain/library/model/Rating.kt (1)

9-14: Rating.enum의 ordinal 변경 영향 없음 확인

확인 결과 Rating.ordinal은 영속화(Room/SharedPrefs)나 네트워크 직렬화에 사용되지 않으며, 별도의 TypeConverter@Serializable 어노테이션도 존재하지 않습니다. 따라서 중간 상수 삽입으로 인한 ordinal 변경이 다른 로직에 미치는 영향은 없습니다.

app/src/main/java/com/into/websoso/ui/userStorage/UserStorageActivity.kt (1)

42-53: LibraryScreen/네비게이션 람다 연결은 적절합니다

ViewModel 주입과 네비게이션 람다 위임 모두 자연스럽고 유지보수에 용이합니다.

Comment on lines +36 to +43
Scaffold(
modifier = Modifier
.fillMaxSize()
.windowInsetsPadding(WindowInsets.systemBars),
) { inner ->
Box(modifier = Modifier.padding(inner)) {
LibraryScreen(
libraryViewModel = libraryViewModel,
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

⚠️ Potential issue

Scaffold 기본 인셋 + windowInsetsPadding 동시 적용으로 중복 패딩 가능성

Material3 Scaffold는 기본적으로 contentWindowInsets를 통해 인셋을 컨텐츠 패딩(inner)로 전달합니다. 현재는

  • Modifier.windowInsetsPadding(WindowInsets.systemBars) +
  • Box(modifier = Modifier.padding(inner))

가 함께 적용되어 상하(특히 상단) 패딩이 두 번 들어갈 수 있습니다. 하나만 사용하세요.

권장안 A(간단): windowInsetsPadding 제거

-                Scaffold(
-                    modifier = Modifier
-                        .fillMaxSize()
-                        .windowInsetsPadding(WindowInsets.systemBars),
-                ) { inner ->
+                Scaffold(
+                    modifier = Modifier
+                        .fillMaxSize(),
+                ) { inner ->

대안 B(명시적 인셋 제어): windowInsetsPadding을 유지하고, Scaffold의 contentWindowInsets를 0으로 설정

-                Scaffold(
+                Scaffold(
+                    contentWindowInsets = WindowInsets(0),
                     modifier = Modifier
                         .fillMaxSize()
                         .windowInsetsPadding(WindowInsets.systemBars),
                 ) { inner ->
📝 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
Scaffold(
modifier = Modifier
.fillMaxSize()
.windowInsetsPadding(WindowInsets.systemBars),
) { inner ->
Box(modifier = Modifier.padding(inner)) {
LibraryScreen(
libraryViewModel = libraryViewModel,
Scaffold(
modifier = Modifier
.fillMaxSize(),
) { inner ->
Box(modifier = Modifier.padding(inner)) {
LibraryScreen(
libraryViewModel = libraryViewModel,
//
)
}
}
🤖 Prompt for AI Agents
In app/src/main/java/com/into/websoso/ui/userStorage/UserStorageActivity.kt
around lines 36 to 43, Scaffold is supplying contentWindowInsets to the inner
content and you also apply Modifier.windowInsetsPadding(WindowInsets.systemBars)
on the Scaffold, causing duplicate top/bottom padding; remove the duplicate by
either A) deleting the Modifier.windowInsetsPadding(WindowInsets.systemBars) so
Scaffold's passed inner padding (used by Box(modifier =
Modifier.padding(inner))) is the sole inset source, or B) keep the
windowInsetsPadding but explicitly disable Scaffold's contentWindowInsets (set
it to zero) so the Box padding(inner) no longer double-counts—pick one approach
and remove the other to eliminate the duplicated inset.

@s9hn s9hn merged commit bfcb2f4 into develop Aug 11, 2025
2 checks passed
@m6z1 m6z1 deleted the feat/744 branch August 11, 2025 15:07
@coderabbitai coderabbitai bot mentioned this pull request Sep 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⚖️ 재상 세훈 전지적 세훈 시점 🔨 [FIX] 버그를 수정합니다.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: 타유저 서재 뷰 상태바 패딩 적용

4 participants