Conversation
동아리 화면 중 activity가 선언되는 feature:club 모듈을 선언
Walkthrough앱에 새로운 feature/club 모듈을 추가하고, 클럽 온보딩용 Activity·Compose 화면·ViewModel·컴포넌트·리소스와 네비게이터 확장, Preference 항목 및 디자인시스템 편의 오버로드를 도입했습니다. (요약 50단어 이내) Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant Navigator as KuringNavigatorImpl
participant Activity as ClubOnboardingActivity
participant Screen as ClubOnboardingScreen
participant VM as ClubOnboardingViewModel
participant Pref as PreferenceUtil
User->>Navigator: navigateToClubOnboarding(context)
Navigator->>Activity: start(context) (Intent)
Activity->>Screen: setContent(Compose)
Screen->>VM: hiltViewModel() (주입)
User->>Screen: 카테고리 선택
Screen->>VM: setSelectedItem(index)
User->>Screen: CTA 클릭
Screen->>VM: saveInitialCategory()
VM->>Pref: clubInitialCategory = categoryId
Pref->>Pref: SharedPreferences 저장
VM-->>Screen: 저장 결과(Boolean)
Screen->>Activity: onClose() -> finish()
Possibly related PRs
시 🐰
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ 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: 3
🤖 Fix all issues with AI agents
In `@feature/club/build.gradle.kts`:
- Around line 10-13: Remove the duplicate namespace assignment inside the
android block: keep the LibraryExtension call setNameSpace("club") and delete
the direct property assignment namespace = "com.ku_stacks.ku_ring.club" (remove
the line that sets namespace explicitly) so only setNameSpace(...) is used to
configure the module namespace.
In
`@feature/club/src/main/java/com/ku_stacks/ku_ring/club/onboarding/ClubOnboardingActivity.kt`:
- Around line 11-20: The Activity ClubOnboardingActivity is missing the Hilt
entry point annotation causing runtime IllegalStateException when
ClubOnboardingScreen calls hiltViewModel(); add `@AndroidEntryPoint` to the
ClubOnboardingActivity class declaration so Hilt can provide ViewModel
dependencies to the Compose host (ensure the import for
dagger.hilt.android.AndroidEntryPoint is added and kept).
In
`@feature/club/src/main/java/com/ku_stacks/ku_ring/club/onboarding/ClubOnboardingViewModel.kt`:
- Around line 47-74: initOnboardingItems() currently sets
R.drawable.ic_academic_v2 for every ClubCategoryItemState (academic,
culture_art, social_value, activity); update the iconId for each
ClubCategoryItemState to the correct drawable resource (e.g., ic_culture_art,
ic_social_value, ic_activity) or, if the identical icon is intentional, add a
TODO comment documenting it next to the ClubCategoryItemState entries so
reviewers know it’s deliberate; ensure you edit the iconId values in
initOnboardingItems() where ClubCategoryItemState is constructed.
🧹 Nitpick comments (6)
app/src/main/AndroidManifest.xml (1)
97-99: 기존OnboardingActivity와 달리screenOrientation="portrait"누락기존 온보딩 액티비티(Line 74-76)에는
android:screenOrientation="portrait"가 설정되어 있습니다. 동아리 온보딩도 세로 고정이 의도된 것이라면 추가하는 것이 좋겠습니다.제안
<activity android:name=".club.onboarding.ClubOnboardingActivity" - android:exported="false" /> + android:exported="false" + android:screenOrientation="portrait" />feature/club/src/main/java/com/ku_stacks/ku_ring/club/onboarding/ClubOnboardingScreen.kt (2)
137-143: "건너뛰기" 텍스트의 터치 영역이 접근성 최소 기준(48dp)에 미달할 수 있음
clickablemodifier만 적용된Text는 텍스트 크기에 따라 터치 영역이 너무 작을 수 있습니다. 최소 터치 영역 48dp를 보장하기 위해minimumInteractiveComponentSize()를 추가하거나, 충분한 padding을 적용하는 것이 좋습니다.수정 제안
Text( text = stringResource(R.string.club_onboarding_dismiss), style = KuringTheme.typography.body2SB, color = KuringTheme.colors.textCaption1, textAlign = TextAlign.Center, - modifier = Modifier.clickable(onClick = onDismiss), + modifier = Modifier + .clickable(onClick = onDismiss) + .padding(vertical = 12.dp, horizontal = 16.dp), )
128-135: 선택 항목 없이 확인 버튼 클릭 시 사용자 피드백 부재
isSelectedItemIndexValid가false일 때 CTA 클릭이 아무 동작도 하지 않습니다. 버튼의enabled상태를 활용하거나, 시각적 피드백(예: 스낵바)을 제공하면 사용자 경험이 개선됩니다.예시: CTA 비활성화
KuringCallToAction이enabled파라미터를 지원한다면:KuringCallToAction( text = stringResource(R.string.club_onboarding_cta), - onClick = { - if (isSelectedItemIndexValid(selectedItemIndex)) { - saveSelectedCategory() - } - }, + onClick = saveSelectedCategory, + enabled = isSelectedItemIndexValid(selectedItemIndex), modifier = Modifier.fillMaxWidth(), )feature/club/src/main/java/com/ku_stacks/ku_ring/club/onboarding/components/ClubCategoryItem.kt (2)
45-59: Modifier 순서:clip→border→background순서 확인 필요현재 modifier 체인에서
.background()가.border()앞에 위치하고 있어, 배경색이 border 위에 그려질 수 있습니다. 일반적으로.border()를.background()앞에 배치하거나, 같은 shape를 사용하므로 시각적으로 큰 문제는 없을 수 있지만, 의도를 명확히 하기 위해 순서를 확인해 주세요.또한
.clip(shape)이 이미 적용되어 있으므로,.background()와.border()에shape을 다시 전달할 필요가 없습니다.♻️ 제안
Row( modifier = modifier .clip(shape) .clickable(onClick = onClick) - .background( - color = background, - shape = shape, - ) .border( width = 1.dp, color = borderColor, shape = shape, ) + .background( + color = background, + shape = shape, + ) .padding(16.dp) .fillMaxWidth(),
84-89:item이 public top-level 변수로 노출되어 있습니다.
item은 preview용 샘플 데이터인데,publictop-levelval로 선언되어 있고 이름도 너무 일반적입니다. 다른 파일에서 의도치 않게 import될 수 있고, 이름 충돌 가능성도 있습니다.private으로 변경하는 것을 권장합니다.♻️ 제안
-val item = ClubCategoryItemState( +private val sampleClubCategoryItem = ClubCategoryItemState( categoryName = R.string.category_academic, description = R.string.description_academic, categoryId = "", iconId = R.drawable.ic_academic_v2, )feature/club/src/main/java/com/ku_stacks/ku_ring/club/onboarding/ClubOnboardingViewModel.kt (1)
43-45:isSelectedItemIndexValid메서드의 사용 목적을 명확히 해주세요.이 메서드는 UI 레이어에서 저장 버튼의 onClick 핸들러에서
isSelectedItemIndexValid(selectedItemIndex)로 호출되어 현재 선택된 인덱스의 유효성을 검증합니다.setSelectedItem과 달리 이 메서드는 상태 업데이트가 아닌 UI 검증 목적입니다. 다만, 실제 호출에서는 항상selectedItemIndex가 전달되므로, 파라미터를 제거하고 내부 상태를 직접 검증하는 방식으로 리팩토링하면 의도가 더 명확해질 것입니다.
feature/club/src/main/java/com/ku_stacks/ku_ring/club/onboarding/ClubOnboardingActivity.kt
Show resolved
Hide resolved
feature/club/src/main/java/com/ku_stacks/ku_ring/club/onboarding/ClubOnboardingViewModel.kt
Show resolved
Hide resolved
| val item = ClubCategoryItemState( | ||
| categoryName = R.string.category_academic, | ||
| description = R.string.description_academic, | ||
| categoryId = "", | ||
| iconId = R.drawable.ic_academic_v2, | ||
| ) |
There was a problem hiding this comment.
이번에 PreviewParameterProvider로 프리뷰에 파라미터를 넣는 방식을 바꿔봤습니다.
메인 코드가 깔끔해지기도 하고, 재사용하기도 좋아서 참고해보시면 좋을 것 같습니다.
혹시라도 더 좋은 방법이 있다면 의견 남겨주세요!
| @LightAndDarkPreview | ||
| @Composable | ||
| private fun ClubCategoryItemPreview() { | ||
|
|
요약
동아리 온보딩 화면을 구현했습니다. 동아리를 4개의 카테고리로 나누고, 동아리 필터를 바꾸기 전까지는 여기에서 선택한 카테고리가 필터로 설정됩니다.
(아래 preview에서는 똑같은 카테고리가 4번 반복되고 있지만, 실제로는 서로 다른 값이 보입니다)
개발 시 참고사항
@boiledeggg
PreferenceUtil.clubInitialCategory로 정의하였습니다. 이 값이 비어있지 않을 때 필터를 설정하면 됩니다.Summary by CodeRabbit
새로운 기능
잡업(설정)