Conversation
개요검색 기능을 구현하여 검색 아이콘을 클릭 가능하게 변경하고, 검색된 쿼리 상태를 상태 관리 계층을 통해 전파하며, 클라이언트 측 필터링 로직을 추가하고 포커스 외부 탭에서 키보드를 자동으로 숨기도록 수정합니다. 변경 사항
시퀀스 다이어그램sequenceDiagram
participant User
participant SearchTextField
participant ViewModel
participant UiState
participant FilteringContent
participant Display
User->>SearchTextField: 검색 아이콘 탭
SearchTextField->>ViewModel: onSearchAction(query)
ViewModel->>UiState: searchedQuery 업데이트
ViewModel->>ViewModel: 키워드 기반 필터링
UiState->>FilteringContent: searchedQuery 전달
FilteringContent->>FilteringContent: 검색어로 아이템 필터링
FilteringContent->>Display: 필터링된 결과 또는 빈 상태 렌더링
Display->>User: 검색 결과 표시
예상 코드 리뷰 시간🎯 3 (중간) | ⏱️ ~20분 관련 가능성 있는 PR
제안 검토자
🚥 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
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: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
app/src/main/java/com/cherrish/android/presentation/calendar/component/ProcedureSearchTextField.kt (1)
78-87: 클릭 가능한 검색 아이콘에 접근성 라벨이 필요합니다.현재
contentDescription = null으로 설정되어 있어 스크린리더가 이 버튼의 용도를 인지하지 못합니다. 아이콘이.noRippleClickable수정자로 상호작용 가능하므로 적절한 라벨을 제공해야 합니다.✅ 접근성 라벨 추가 예시
Icon( imageVector = ImageVector.vectorResource(id = R.drawable.ic_search), - contentDescription = null, + contentDescription = "검색", tint = CherrishTheme.colors.gray500, modifier = Modifier .align(Alignment.CenterEnd) .noRippleClickable { onSearchAction() keyboardController?.hide() } )
🧹 Nitpick comments (2)
app/src/main/java/com/cherrish/android/presentation/calendar/procedure/content/FilteringWithSearchContent.kt (1)
99-118: 필터링 결과 계산은remember/derivedStateOf로 캐싱 권장합니다.
현재 매 recomposition마다 리스트 필터링/할당이 발생합니다.derivedStateOf로 계산을 메모이즈하면 비용을 줄일 수 있어요.♻️ 캐싱 적용 예시
+import androidx.compose.runtime.derivedStateOf ... - val normalizedQuery = searchedQuery.trim() - val filteredItems = if (normalizedQuery.isEmpty()) { - cardItems - } else { - cardItems.filter { item -> - item.name.contains(normalizedQuery, ignoreCase = true) || - item.category.contains(normalizedQuery, ignoreCase = true) - }.toPersistentList() - } + val normalizedQuery = searchedQuery.trim() + val filteredItems by remember(cardItems, normalizedQuery) { + derivedStateOf { + if (normalizedQuery.isEmpty()) { + cardItems + } else { + cardItems.filter { item -> + item.name.contains(normalizedQuery, ignoreCase = true) || + item.category.contains(normalizedQuery, ignoreCase = true) + }.toPersistentList() + } + } + }Also applies to: 143-151
app/src/main/java/com/cherrish/android/presentation/calendar/procedure/ProcedureViewModel.kt (1)
437-453: 검색 필터링 로직이 ViewModel/UI에 중복되어 있어 정리가 필요합니다.
두 군데에서 필터링하면 매칭 규칙이 달라질 때 결과 불일치가 생길 수 있습니다. 한 곳으로 통일하거나 공용 matcher로 추출하는 방향을 권장합니다.

Related issue 🛠
Work Description ✏️
Screenshot 📸
Uncompleted Tasks 😅
N/A
To Reviewers 📢
초성으로 ㄱㄱ 검색 시 엠티 뷰 적용이 안되길래 이 로직도 추가해서 리팩했습니도 !
Summary by CodeRabbit
릴리스 노트
New Features
Improvements
✏️ Tip: You can customize this high-level summary in your review settings.