Conversation
- 검색바 도입 - 기능 간 간격 조정 - 기능명 강조를 위한 문구 수정
Walkthrough일반 검색 기능을 홈 화면에 추가합니다. HomeFragment에 새로운 클릭 핸들러를 구현하여 검색 버튼 상호작용을 처리하고, 레이아웃에 검색 UI 요소를 도입하며, 문자열 리소스를 업데이트합니다. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (2 warnings, 1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@app/src/main/java/com/into/websoso/ui/main/home/HomeFragment.kt`:
- Around line 115-121: onNormalSearchButtonClick uses startActivity(intent)
which bypasses the existing ActivityResultLauncher and prevents the result
handling that onPostInterestNovelClick achieves; replace the startActivity call
to launch NormalExploreActivity via the same startActivityLauncher (call
startActivityLauncher.launch(NormalExploreActivity.getIntent(requireContext())))
so the returned NormalExploreBack.RESULT_OK will trigger
homeViewModel.updateFeed() and homeViewModel.updateNovel() as in
onPostInterestNovelClick; ensure you reference the same startActivityLauncher
instance used elsewhere in the fragment.
In `@app/src/main/res/layout/fragment_home.xml`:
- Around line 53-88: cl_home_normal_search (the clickable search entry) and
iv_home_normal_search (the ImageView) lack accessible labels; add descriptive
accessibility text so screen readers can announce the control. Update
cl_home_normal_search to be focusable/clickable for accessibility and set
android:contentDescription to a concise string resource like
"@string/explore_normal_search" (or use tv_home_normal_hint's text) and set
iv_home_normal_search's android:contentDescription to the same string (or to
`@null` if you mark the container as the accessible element and set
android:importantForAccessibility="yes" on cl_home_normal_search and
android:importantForAccessibility="no" on iv_home_normal_search) so TalkBack
correctly describes the control.
| private fun onNormalSearchButtonClick() { | ||
| binding.clHomeNormalSearch.setOnClickListener { | ||
| tracker.trackEvent("general_search") | ||
| val intent = NormalExploreActivity.getIntent(requireContext()) | ||
| startActivity(intent) | ||
| } | ||
| } |
There was a problem hiding this comment.
startActivity 대신 startActivityLauncher를 사용해야 합니다.
onPostInterestNovelClick() (Line 304-312)에서 동일한 NormalExploreActivity를 startActivityLauncher.launch()로 실행하고 있으며, 이를 통해 NormalExploreBack.RESULT_OK 결과를 수신하여 homeViewModel.updateFeed()와 homeViewModel.updateNovel()을 호출합니다 (Line 76-80).
반면 이 메서드는 startActivity(intent)를 사용하므로, 검색 화면에서 돌아왔을 때 결과 콜백이 동작하지 않아 홈 화면의 피드/소설 데이터가 갱신되지 않습니다.
🐛 startActivityLauncher 사용으로 수정
private fun onNormalSearchButtonClick() {
binding.clHomeNormalSearch.setOnClickListener {
tracker.trackEvent("general_search")
val intent = NormalExploreActivity.getIntent(requireContext())
- startActivity(intent)
+ startActivityLauncher.launch(intent)
}
}📝 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 fun onNormalSearchButtonClick() { | |
| binding.clHomeNormalSearch.setOnClickListener { | |
| tracker.trackEvent("general_search") | |
| val intent = NormalExploreActivity.getIntent(requireContext()) | |
| startActivity(intent) | |
| } | |
| } | |
| private fun onNormalSearchButtonClick() { | |
| binding.clHomeNormalSearch.setOnClickListener { | |
| tracker.trackEvent("general_search") | |
| val intent = NormalExploreActivity.getIntent(requireContext()) | |
| startActivityLauncher.launch(intent) | |
| } | |
| } |
🤖 Prompt for AI Agents
In `@app/src/main/java/com/into/websoso/ui/main/home/HomeFragment.kt` around lines
115 - 121, onNormalSearchButtonClick uses startActivity(intent) which bypasses
the existing ActivityResultLauncher and prevents the result handling that
onPostInterestNovelClick achieves; replace the startActivity call to launch
NormalExploreActivity via the same startActivityLauncher (call
startActivityLauncher.launch(NormalExploreActivity.getIntent(requireContext())))
so the returned NormalExploreBack.RESULT_OK will trigger
homeViewModel.updateFeed() and homeViewModel.updateNovel() as in
onPostInterestNovelClick; ensure you reference the same startActivityLauncher
instance used elsewhere in the fragment.
| <androidx.constraintlayout.widget.ConstraintLayout | ||
| android:id="@+id/cl_home_normal_search" | ||
| android:layout_width="0dp" | ||
| android:layout_height="wrap_content" | ||
| android:layout_marginHorizontal="20dp" | ||
| android:layout_marginTop="12dp" | ||
| android:background="@drawable/btn_explore_gray50_radius_14dp" | ||
| android:paddingHorizontal="16dp" | ||
| android:paddingVertical="12dp" | ||
| app:layout_constraintEnd_toEndOf="parent" | ||
| app:layout_constraintStart_toStartOf="parent" | ||
| app:layout_constraintTop_toTopOf="parent"> | ||
|
|
||
| <TextView | ||
| android:id="@+id/tv_home_normal_hint" | ||
| android:layout_width="wrap_content" | ||
| android:layout_height="wrap_content" | ||
| android:text="@string/explore_normal_search_hint" | ||
| android:textAppearance="@style/label1" | ||
| android:textColor="@color/gray_200_949399" | ||
| app:layout_constraintBottom_toBottomOf="@id/cl_home_normal_search" | ||
| app:layout_constraintStart_toStartOf="@id/cl_home_normal_search" | ||
| app:layout_constraintTop_toTopOf="@id/cl_home_normal_search" /> | ||
|
|
||
| <ImageView | ||
| android:id="@+id/iv_home_normal_search" | ||
| android:layout_width="wrap_content" | ||
| android:layout_height="wrap_content" | ||
| android:contentDescription="@null" | ||
| android:src="@drawable/ic_explore_search" | ||
| app:layout_constraintBottom_toBottomOf="parent" | ||
| app:layout_constraintEnd_toEndOf="parent" | ||
| app:layout_constraintHorizontal_chainStyle="packed" | ||
| app:layout_constraintTop_toTopOf="parent" /> | ||
|
|
||
| </androidx.constraintlayout.widget.ConstraintLayout> |
There was a problem hiding this comment.
검색 영역에 접근성(contentDescription) 설정이 필요합니다.
cl_home_normal_search는 클릭 가능한 검색 진입점이지만, contentDescription이 설정되어 있지 않습니다. 내부 ImageView의 contentDescription도 @null로 지정되어 있어, TalkBack 등 스크린 리더 사용자가 이 요소의 용도를 인식할 수 없습니다.
♿ 접근성 개선 제안
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_home_normal_search"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="20dp"
android:layout_marginTop="12dp"
android:background="@drawable/btn_explore_gray50_radius_14dp"
+ android:contentDescription="@string/explore_normal_search_hint"
android:paddingHorizontal="16dp"
android:paddingVertical="12dp"🤖 Prompt for AI Agents
In `@app/src/main/res/layout/fragment_home.xml` around lines 53 - 88,
cl_home_normal_search (the clickable search entry) and iv_home_normal_search
(the ImageView) lack accessible labels; add descriptive accessibility text so
screen readers can announce the control. Update cl_home_normal_search to be
focusable/clickable for accessibility and set android:contentDescription to a
concise string resource like "@string/explore_normal_search" (or use
tv_home_normal_hint's text) and set iv_home_normal_search's
android:contentDescription to the same string (or to `@null` if you mark the
container as the accessible element and set
android:importantForAccessibility="yes" on cl_home_normal_search and
android:importantForAccessibility="no" on iv_home_normal_search) so TalkBack
correctly describes the control.
📌𝘐𝘴𝘴𝘶𝘦𝘴
📎𝘞𝘰𝘳𝘬 𝘋𝘦𝘴𝘤𝘳𝘪𝘱𝘵𝘪𝘰𝘯
📷𝘚𝘤𝘳𝘦𝘦𝘯𝘴𝘩𝘰𝘵
💬𝘛𝘰 𝘙𝘦𝘷𝘪𝘦𝘸𝘦𝘳𝘴
Summary by CodeRabbit
릴리스 노트
홈 화면에 새로운 검색 기능이 추가되었습니다. 홈 화면의 전반적인 레이아웃이 개선되어 더 나은 사용성을 제공합니다. 섹션 라벨도 업데이트되었습니다.
New Features
Style