Conversation
Walkthrough작가 클릭 시 해당 작가의 작품을 검색할 수 있는 기능을 구현했습니다. 작품 상세 화면에서 작가 텍스트를 클릭하면 검색 화면으로 이동하여 해당 작가의 작품들을 조회합니다. 상태 저장소를 통해 검색 데이터를 유지합니다. Changes
Sequence DiagramsequenceDiagram
actor User
participant NovelDetailActivity as Novel Detail<br/>Activity
participant NovelDetailClickListener as Click<br/>Listener
participant NormalExploreActivity as Normal Explore<br/>Activity
participant NormalExploreViewModel as View<br/>Model
participant SavedStateHandle as Saved<br/>State
participant UseCase as Use<br/>Case
User->>NovelDetailActivity: Click Author TextView
NovelDetailActivity->>NovelDetailClickListener: onAuthorClick(author)
NovelDetailClickListener->>NormalExploreActivity: getIntent(context, searchAuthor)
NormalExploreActivity->>NormalExploreViewModel: Create with SavedStateHandle
NormalExploreViewModel->>SavedStateHandle: Read SEARCH_AUTHOR
SavedStateHandle-->>NormalExploreViewModel: Return initialSearchWord
NormalExploreViewModel->>UseCase: updateSearchResult(initialSearchWord)
UseCase-->>NormalExploreViewModel: Return search results
NormalExploreViewModel-->>NovelDetailActivity: Display author's novels
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the 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. Comment |
m6z1
left a comment
There was a problem hiding this comment.
머지 할 브랜치 release/1.6.0 아니고 develop 으로 바꿔주세요!
이미 release/1.6.0 은 배포 됐습니다!
| val searchAuthor = intent.getStringExtra(SEARCH_AUTHOR).orEmpty() | ||
| if (searchAuthor.isBlank()) return |
There was a problem hiding this comment.
savedStateHandle 에 대해서 알아보시고 적용해보셔도 좋을 것 같아요!
There was a problem hiding this comment.
SavedStateHandle을 적용해 초기 검색어를 ViewModel에서 읽고 자동 검색이 수행되도록 수정했습니다. 후에 검색어 변경도 SavedStateHandle에 함께 반영되도록 처리했습니다!
d21937d
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
app/src/main/java/com/into/websoso/ui/normalExplore/NormalExploreActivity.kt (1)
78-82: 검색어 추출 로직 중복 고려검색 실행 전에
updateSearchWord를 호출하는 패턴이 두 곳(에디터 액션, 검색 버튼 클릭)에서 동일하게 반복됩니다. 현재 구현은 정상 작동하지만, 향후 유지보수를 위해 헬퍼 함수로 추출하는 것을 고려해볼 수 있습니다.♻️ 선택적 리팩토링 제안
private fun executeSearch() { val searchText = binding.etNormalExploreSearchContent.text?.toString().orEmpty() normalExploreViewModel.updateSearchWord(searchText) normalExploreViewModel.updateSearchResult(isSearchButtonClick = true) binding.etNormalExploreSearchContent.clearFocus() hideKeyboard() }Also applies to: 113-117
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/src/main/java/com/into/websoso/ui/normalExplore/NormalExploreActivity.kt` around lines 78 - 82, Duplicate logic extracting the search text and calling normalExploreViewModel.updateSearchWord appears in both the editor action and the search button click handlers; create a private helper (e.g., executeSearch) inside NormalExploreActivity that reads binding.etNormalExploreSearchContent.text?.toString().orEmpty(), calls normalExploreViewModel.updateSearchWord(searchText) and normalExploreViewModel.updateSearchResult(isSearchButtonClick = true), then clears focus on binding.etNormalExploreSearchContent and calls hideKeyboard(); replace the duplicated blocks at the editor action handler and the search button onClick with a call to this helper.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@app/src/main/java/com/into/websoso/ui/normalExplore/NormalExploreViewModel.kt`:
- Around line 30-31: searchWord currently exposes a MutableLiveData allowing
external mutation; change its public type to LiveData<String> by returning
_searchWord as LiveData (keep private val _searchWord =
MutableLiveData(initialSearchWord) and change val searchWord: LiveData<String>
get() = _searchWord) so only the ViewModel can modify state; if you rely on
two-way data binding, adapt the binding to call a ViewModel update method or use
a separate public MutableLiveData for binding while still encapsulating mutation
logic.
In `@app/src/main/res/layout/activity_novel_detail.xml`:
- Line 163: The author field in the binding
android:text='@{novelDetailViewModel.novelDetailModel.novel.author}' is showing
raw backend data (tools:text was only a preview); confirm whether the backend
already includes the "・ " separator and if not, add formatting either in the
mapping layer or viewmodel before binding—e.g. implement a formatter/mapper
method (e.g., NovelDetailMapper.formatAuthor or
NovelDetailViewModel.getFormattedAuthor) that returns "・ " + author when author
is non-empty and update the binding to use that formatted property instead of
novelDetailModel.novel.author.
---
Nitpick comments:
In
`@app/src/main/java/com/into/websoso/ui/normalExplore/NormalExploreActivity.kt`:
- Around line 78-82: Duplicate logic extracting the search text and calling
normalExploreViewModel.updateSearchWord appears in both the editor action and
the search button click handlers; create a private helper (e.g., executeSearch)
inside NormalExploreActivity that reads
binding.etNormalExploreSearchContent.text?.toString().orEmpty(), calls
normalExploreViewModel.updateSearchWord(searchText) and
normalExploreViewModel.updateSearchResult(isSearchButtonClick = true), then
clears focus on binding.etNormalExploreSearchContent and calls hideKeyboard();
replace the duplicated blocks at the editor action handler and the search button
onClick with a call to this helper.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d8e331a4-4ca0-4685-9baa-0125f66519fd
📒 Files selected for processing (6)
app/src/main/java/com/into/websoso/ui/normalExplore/NormalExploreActivity.ktapp/src/main/java/com/into/websoso/ui/normalExplore/NormalExploreViewModel.ktapp/src/main/java/com/into/websoso/ui/novelDetail/NovelDetailActivity.ktapp/src/main/java/com/into/websoso/ui/novelDetail/NovelDetailClickListener.ktapp/src/main/java/com/into/websoso/ui/novelDetail/model/NovelDetailModel.ktapp/src/main/res/layout/activity_novel_detail.xml
| private val _searchWord = MutableLiveData(initialSearchWord) | ||
| val searchWord: MutableLiveData<String> get() = _searchWord |
There was a problem hiding this comment.
searchWord가 MutableLiveData를 외부에 노출합니다
다른 속성들(uiState, isSearchCancelButtonVisibility, isNovelResultEmptyBoxVisibility)은 LiveData로 노출하고 있지만, searchWord는 MutableLiveData를 그대로 반환하여 외부에서 직접 값 변경이 가능합니다. 캡슐화를 위해 LiveData로 변경하는 것이 좋습니다.
🛡️ 수정 제안
- private val _searchWord = MutableLiveData(initialSearchWord)
- val searchWord: MutableLiveData<String> get() = _searchWord
+ private val _searchWord = MutableLiveData(initialSearchWord)
+ val searchWord: LiveData<String> get() = _searchWordNote: 이 변경 시 양방향 데이터 바인딩을 사용하고 있다면 별도 처리가 필요할 수 있습니다.
📝 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.
| private val _searchWord = MutableLiveData(initialSearchWord) | |
| val searchWord: MutableLiveData<String> get() = _searchWord | |
| private val _searchWord = MutableLiveData(initialSearchWord) | |
| val searchWord: LiveData<String> get() = _searchWord |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In
`@app/src/main/java/com/into/websoso/ui/normalExplore/NormalExploreViewModel.kt`
around lines 30 - 31, searchWord currently exposes a MutableLiveData allowing
external mutation; change its public type to LiveData<String> by returning
_searchWord as LiveData (keep private val _searchWord =
MutableLiveData(initialSearchWord) and change val searchWord: LiveData<String>
get() = _searchWord) so only the ViewModel can modify state; if you rely on
two-way data binding, adapt the binding to call a ViewModel update method or use
a separate public MutableLiveData for binding while still encapsulating mutation
logic.
| android:layout_width="wrap_content" | ||
| android:layout_height="wrap_content" | ||
| android:onClick="@{() -> onClick.onAuthorClick(novelDetailViewModel.novelDetailModel.novel.author)}" | ||
| android:text='@{novelDetailViewModel.novelDetailModel.novel.author}' |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Check how author data is mapped and whether it includes the separator
# Search for author field mapping in data layer
rg -n "author" --type=kt -C 3 | grep -E "(author\s*=|\.author)"
# Check if there's any formatting applied to author in mapper or model
ast-grep --pattern $'author = $_'Repository: Team-WSS/WSS-Android
Length of output: 90
🏁 Script executed:
#!/bin/bash
# Find Kotlin files related to Novel model
fd -e kt | grep -i novel | head -20Repository: Team-WSS/WSS-Android
Length of output: 1553
🏁 Script executed:
#!/bin/bash
# Search for author field in Kotlin files
rg -n "author" --glob="*.kt" -C 2 | head -100Repository: Team-WSS/WSS-Android
Length of output: 9775
🏁 Script executed:
#!/bin/bash
# Look for the NovelDetail model/data class
rg -n "data class.*Novel" --glob="*.kt"Repository: Team-WSS/WSS-Android
Length of output: 6531
🏁 Script executed:
#!/bin/bash
# Read the NovelDetailModel to see the full structure
cat -n app/src/main/java/com/into/websoso/ui/novelDetail/model/NovelDetailModel.ktRepository: Team-WSS/WSS-Android
Length of output: 3412
🏁 Script executed:
#!/bin/bash
# Read the UI mapper to see how author is transformed
cat -n app/src/main/java/com/into/websoso/ui/mapper/NovelMapper.ktRepository: Team-WSS/WSS-Android
Length of output: 4049
🏁 Script executed:
#!/bin/bash
# Search for binding adapters that might format author
rg -n "BindingAdapter" --glob="*.kt" -A 5 | grep -B 3 -A 5 "author"Repository: Team-WSS/WSS-Android
Length of output: 46
🏁 Script executed:
#!/bin/bash
# Look for the layout file to see full context around line 163
cat -n app/src/main/res/layout/activity_novel_detail.xml | sed -n '150,180p'Repository: Team-WSS/WSS-Android
Length of output: 2252
🏁 Script executed:
#!/bin/bash
# Double-check: search for any BindingAdapter that might be applied to author field
rg -n "BindingAdapter" --glob="*.kt" -A 10 | head -150Repository: Team-WSS/WSS-Android
Length of output: 6879
작가명 앞 구분자 처리 확인 필요
tools:text=" ・ 이보라"는 Android Studio의 디자인 타임 미리보기일 뿐 실제 런타임에 적용되지 않습니다. 현재 코드에서 author 필드는 백엔드에서 받은 값을 그대로 표시하며, 어떤 포매팅이나 구분자 추가 로직이 없습니다. 백엔드에서 순수 작가명만 제공한다면 실제 화면에는 구분자 없이 표시될 것입니다.
다음 중 하나를 확인하세요:
- 백엔드에서 구분자 포함 여부 확인
- 필요시 mapper에서 문자열 형식화 로직 추가
- 또는
tools:text를 실제 런타임 표시와 일치하도록 수정
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@app/src/main/res/layout/activity_novel_detail.xml` at line 163, The author
field in the binding
android:text='@{novelDetailViewModel.novelDetailModel.novel.author}' is showing
raw backend data (tools:text was only a preview); confirm whether the backend
already includes the "・ " separator and if not, add formatting either in the
mapping layer or viewmodel before binding—e.g. implement a formatter/mapper
method (e.g., NovelDetailMapper.formatAuthor or
NovelDetailViewModel.getFormattedAuthor) that returns "・ " + author when author
is non-empty and update the binding to use that formatted property instead of
novelDetailModel.novel.author.
📌𝘐𝘴𝘴𝘶𝘦𝘴
📎𝘞𝘰𝘳𝘬 𝘋𝘦𝘴𝘤𝘳𝘪𝘱𝘵𝘪𝘰𝘯
📷𝘚𝘤𝘳𝘦𝘦𝘯𝘴𝘩𝘰𝘵
Screen_recording_20260308_030830.mp4
💬𝘛𝘰 𝘙𝘦𝘷𝘪𝘦𝘸𝘦𝘳𝘴
변경사항
구현 이유
기존 UI 배치를 유지하면서 작가명에만 링크 스타일/클릭을 적용하기 위해 요약 정보와 작가명을 분리했습니다.
별도 검색 화면을 추가하지 않고 기존 NormalExploreActivity를 재사용하기 위해 Intent extra로 작가명을 전달해 초기 검색이 실행되도록 구현했습니다.
Summary by CodeRabbit
신규 기능
버그 수정