-
Notifications
You must be signed in to change notification settings - Fork 1
PrezelCheckbox 구현 #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
디자인시스템에 커스텀 체크박스 컴포넌트인 `PrezelCheckbox`를 추가했습니다. * `REGULAR(24dp)`, `LARGE(32dp)` 두 가지 사이즈 지원 * 선택 상태에 따른 아이콘 및 컬러 분기 처리 * 클릭 인터랙션 및 Preview 코드 포함
`PrezelCheckbox`의 내부 상태 관리 방식을 제거하고, 외부에서 전달받은 `checked` 상태를 직접 사용하도록 수정했습니다. 또한 컴포넌트의 유연성과 미리보기 가독성을 개선했습니다. * `PrezelCheckbox` 내 불필요한 `currentState` (mutableStateOf) 제거 및 상태 호이스팅 적용 * `modifier` 파라미터 추가 * `CheckboxSize` enum 위치를 상단으로 이동 * 코드 가독성 향상을 위한 조건문 개행 적용 * `CheckboxRowPreview` 공통 함수 추가 및 Preview 코드 구조 리팩터링
디자인시스템 모듈 내 리소스 식별자 이름을 변경하고, 하드코딩된 문자열을 `strings.xml`로 추출했습니다. * `close_floating_btn_content_desc`를 `core_designsystem_close_floating_btn_content_desc`로 변경 * `PrezelCheckbox`의 하드코딩된 `contentDescription`을 `core_designsystem_checkbox_desc` 리소스로 대체 * 리소스 이름 변경에 따른 `PrezelFloatingMenuButton`의 참조 코드 수정
`PrezelCheckbox` 컴포넌트에 접근성을 위한 설정을 추가했습니다. * `contentDescription` 파라미터를 필수 인자로 추가했습니다. * `Modifier.semantics`를 통해 `Role.Checkbox`를 지정했습니다. * 미리보기(Preview) 코드에 변경된 파라미터를 반영했습니다.
Walkthrough이 PR은 디자인 시스템에 PrezelCheckbox 컴포저블을 추가하고 문자열 리소스를 정리합니다. 공개 함수 Possibly related PRs
🚥 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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🤖 Fix all issues with AI agents
In
`@Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/PrezelCheckbox.kt`:
- Around line 93-108: The preview uses empty contentDescription values in
CheckboxRowPreview for PrezelCheckbox which is inappropriate; update the
contentDescription arguments in the Preview composables (the CheckboxRowPreview
block and the similar block around lines 126-138) to meaningful, non-empty
strings (e.g., "Regular checkbox (checked)" and "Regular checkbox (unchecked)"
or other concise descriptions) so that PrezelCheckbox receives proper
accessibility text for both states.
- Around line 64-72: The Box uses .semantics { role = Role.Checkbox } with
.clickable which doesn't expose checked state to accessibility; replace the
clickable usage with the toggleable modifier so the system announces
checked/unchecked automatically. Update the modifier chain in PrezelCheckbox
(the Box's modifier) to use androidx.compose.foundation.selection.toggleable
(preserving interactionSource, indication, and the onCheckedChange boolean flip)
and remove manual checkbox semantics so the checked parameter passed into
PrezelCheckbox is reflected by toggleable's checked argument.
In `@Prezel/core/designsystem/src/main/res/values/strings.xml`:
- Around line 3-4: Ensure the new string resource keys
core_designsystem_close_floating_btn_content_desc and
core_designsystem_checkbox_desc are added to all other locale strings.xml files
(e.g., values-*/strings.xml) so translations aren’t missing; for each locale,
add the same keys with the proper translated text or a placeholder translation
and keep the exact resource names to avoid runtime missing-resource errors.
...ore/designsystem/src/main/java/com/team/prezel/core/designsystem/component/PrezelCheckbox.kt
Show resolved
Hide resolved
...ore/designsystem/src/main/java/com/team/prezel/core/designsystem/component/PrezelCheckbox.kt
Show resolved
Hide resolved
`clickable`과 `semantics`를 이용한 체크박스 클릭 로직을 `toggleable`로 변경하여 가독성과 컴포넌트 역할을 명확히 했습니다. * `clickable` 대신 `toggleable` 속성 사용 * `semantics` 내 `Role.Checkbox` 중복 설정 제거
moondev03
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
피그마에는 나와있지 않지만 보통 체크박스는 텍스트가 함께 사용될 것 같습니다.
이를 위한 별도의 컴포넌트를 구현하거나 해당 컴포넌트에서 처리하는게 좋을 것 같습니다.
참고로 예시 화면은 작업중인 UI 페이지에 있어요.
...ore/designsystem/src/main/java/com/team/prezel/core/designsystem/component/PrezelCheckbox.kt
Outdated
Show resolved
Hide resolved
...ore/designsystem/src/main/java/com/team/prezel/core/designsystem/component/PrezelCheckbox.kt
Outdated
Show resolved
Hide resolved
...ore/designsystem/src/main/java/com/team/prezel/core/designsystem/component/PrezelCheckbox.kt
Show resolved
Hide resolved
...ore/designsystem/src/main/java/com/team/prezel/core/designsystem/component/PrezelCheckbox.kt
Show resolved
Hide resolved
- `MinTouchTargetSize(48.dp)`를 적용하여 체크박스의 터치 영역을 확장했습니다. - 아이콘 리소스를 `PrezelIcons` 오브젝트 참조 방식으로 변경했습니다. - `toggleable` 파라미터 순서를 조정했습니다.
- `MinTouchTargetSize(48.dp)`를 적용하여 체크박스의 터치 영역을 확장했습니다. - 아이콘 리소스를 `PrezelIcons` 오브젝트 참조 방식으로 변경했습니다. - `toggleable` 파라미터 순서를 조정했습니다.
`PrezelCheckbox` 컴포넌트 호출 시 매번 `contentDescription`을 주입받는 대신, 디자인 시스템 내부의 공통 문자열 리소스를 사용하도록 변경했습니다. * `PrezelCheckbox` 파라미터에서 `contentDescription` 제거 * 내부 `Icon`의 `contentDescription`을 `R.string.core_designsystem_checkbox_desc`로 고정 * Preview 및 호출부의 불필요한 인자 제거
`MinTouchTargetSize` 상수를 제거하고, 해당 값이 사용되던 부분을 하드코딩된 값(48.dp)으로 교체했습니다.
PrezelCheckbox의 `toggleable` modifier에서 불필요한 `MutableInteractionSource` 생성을 제거하고 `null`을 전달하도록 수정했습니다.
📌 작업 내용
PrezelCheckbox 컴포저블 추가
• size 옵션: REGULAR, LARGE
• checked 상태 외부에서 관리 (stateless)
• 클릭 시 onCheckedChange 호출
• 접근성: contentDescription 및 Role.Checkbox 적용
Preview에서도 클릭시 상태 변경가능하도록 했습니다.
🧩 관련 이슈
📸 스크린샷
📢 논의하고 싶은 내용
contentDescription, semantic이 맞나요
Summary by CodeRabbit
새로운 기능
개선사항
✏️ Tip: You can customize this high-level summary in your review settings.