Conversation
개요홈 네비게이션 로직을 문자열 기반에서 타입 안전 방식으로 변경했습니다. 변경 사항
코드 리뷰 추정 난이도🎯 3 (보통) | ⏱️ ~20분 토끼의 축하 시
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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: 1
🧹 Nitpick comments (1)
app/src/main/java/com/threegap/bitnagil/navigation/home/HomeBottomNavigationBar.kt (1)
47-54: 현재 탭 재선택 이벤트는 가드하는 것을 권장합니다.Line 53에서 선택된 탭에도 콜백이 발생해 불필요한 네비게이션 호출이 생길 수 있습니다.
♻️ 제안 수정안
homeTabList.forEach { homeTab -> HomeBottomNavigationItem( modifier = Modifier.weight(1f), icon = homeTab.icon, title = homeTab.title, selected = selectedTab == homeTab.route, - onClick = { onTabSelected(homeTab.route) }, + onClick = { + if (selectedTab != homeTab.route) { + onTabSelected(homeTab.route) + } + }, ) }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/src/main/java/com/threegap/bitnagil/navigation/home/HomeBottomNavigationBar.kt` around lines 47 - 54, 현재 선택된 탭을 다시 누를 때 불필요한 네비게이션 콜백이 발생하므로 HomeBottomNavigationItem의 onClick에서 selectedTab과 homeTab.route를 비교해 같으면 onTabSelected를 호출하지 않도록 가드하세요; 구체적으로 homeTabList.forEach 블록의 HomeBottomNavigationItem(onClick = { ... }) 내부에서 selectedTab != homeTab.route 조건을 확인하고 참일 때만 onTabSelected(homeTab.route)를 호출하도록 변경하십시오.
🤖 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/threegap/bitnagil/navigation/home/HomeNavigator.kt`:
- Around line 33-36: The navigateTo implementation in HomeNavigator uses
popUpTo(0) which clears the entire back stack and loses UI state; update
navigateTo(navController.navigate(route) { ... }) to pop up to the start
destination ID instead (use navController.graph.findStartDestination().id),
enable saveState = true inside the popUpTo block, and also set launchSingleTop =
true and restoreState = true to preserve and restore tab state (scroll/input)
when switching HomeRoute tabs.
---
Nitpick comments:
In
`@app/src/main/java/com/threegap/bitnagil/navigation/home/HomeBottomNavigationBar.kt`:
- Around line 47-54: 현재 선택된 탭을 다시 누를 때 불필요한 네비게이션 콜백이 발생하므로
HomeBottomNavigationItem의 onClick에서 selectedTab과 homeTab.route를 비교해 같으면
onTabSelected를 호출하지 않도록 가드하세요; 구체적으로 homeTabList.forEach 블록의
HomeBottomNavigationItem(onClick = { ... }) 내부에서 selectedTab != homeTab.route
조건을 확인하고 참일 때만 onTabSelected(homeTab.route)를 호출하도록 변경하십시오.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: f4416fe4-3131-40a3-be95-5426e6e9b56e
📒 Files selected for processing (4)
app/src/main/java/com/threegap/bitnagil/navigation/home/HomeBottomNavigationBar.ktapp/src/main/java/com/threegap/bitnagil/navigation/home/HomeNavHost.ktapp/src/main/java/com/threegap/bitnagil/navigation/home/HomeNavigator.ktapp/src/main/java/com/threegap/bitnagil/navigation/home/HomeRoute.kt
[ PR Content ]
homeRoute 부분에 사용중이던 String 방식을 제거하고 type-safe 방식으로 통일했습니다.
Related issue
Screenshot 📸
Work Description
To Reviewers 📢
Summary by CodeRabbit
릴리스 노트