Skip to content

Conversation

@HamBeomJoon
Copy link
Contributor

@HamBeomJoon HamBeomJoon commented Jan 24, 2026

📌 작업 내용

  • PrezelCheckbox 컴포저블 추가
    • size 옵션: REGULAR, LARGE
    • checked 상태 외부에서 관리 (stateless)
    • 클릭 시 onCheckedChange 호출
    • 접근성: contentDescription 및 Role.Checkbox 적용

  • Preview에서도 클릭시 상태 변경가능하도록 했습니다.


🧩 관련 이슈


📸 스크린샷

스크린샷 2026-01-24 22 02 46 스크린샷 2026-01-24 22 02 51

📢 논의하고 싶은 내용

contentDescription, semantic이 맞나요

Summary by CodeRabbit

  • 새로운 기능

    • 체크박스 UI 컴포넌트 추가(일반·큰 사이즈) 및 테마 미리보기 제공
  • 개선사항

    • 스크린리더용 접근성 설명 추가(체크박스 문자열 리소스)
    • 플로팅 버튼의 확장 상태 설명 문자열 키 정리로 일관성 향상

✏️ Tip: You can customize this high-level summary in your review settings.

디자인시스템에 커스텀 체크박스 컴포넌트인 `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) 코드에 변경된 파라미터를 반영했습니다.
@HamBeomJoon HamBeomJoon self-assigned this Jan 24, 2026
@HamBeomJoon HamBeomJoon added the ✨ feat 새로운 기능 추가 또는 기존 기능 확장 label Jan 24, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 24, 2026

Walkthrough

이 PR은 디자인 시스템에 PrezelCheckbox 컴포저블을 추가하고 문자열 리소스를 정리합니다. 공개 함수 PrezelCheckbox(checked: Boolean, modifier: Modifier = Modifier, size: CheckboxSize = CheckboxSize.REGULAR, onCheckedChange: (Boolean) -> Unit)와 enum CheckboxSize(REGULAR, LARGE)를 추가했습니다. 체크 상태에 따라 CheckCircleFilled/CheckCircleOutlined 아이콘과 테마 색상이 적용되며 48.dp 터치 대상과 크기별 아이콘(24.dp/32.dp)을 사용하고 Role.Checkbox 의미론을 설정합니다. 미리보기 컴포저블도 추가되었고, PrezelFloatingMenuButton의 닫기 콘텐츠 설명 키를 변경하며 strings.xmlcore_designsystem_checkbox_desc를 추가했습니다.

Possibly related PRs

  • PrezelFloatingButton 구현 #37: PrezelFloatingMenuButton.kt와 관련 문자열 리소스 키(close_floating_btn_content_desccore_designsystem_close_floating_btn_content_desc)를 변경한 커밋이 있어 코드 수준에서 직접적인 연관이 있습니다.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title "PrezelCheckbox 구현" clearly and concisely summarizes the main change - implementing the PrezelCheckbox component.
Description check ✅ Passed The description follows the template structure with all required sections (작업 내용, 관련 이슈, 스크린샷) properly filled, providing clear implementation details and addressing accessibility concerns.
Linked Issues check ✅ Passed The PR successfully implements the PrezelCheckbox component (#31) with theme-aligned design, proper size options, stateless API, and accessibility features (Role.Checkbox, contentDescription) as required.
Out of Scope Changes check ✅ Passed All changes are directly related to PrezelCheckbox implementation (#31). String resource updates support the checkbox feature, and the floating button change aligns with design system resource naming consistency.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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.

`clickable`과 `semantics`를 이용한 체크박스 클릭 로직을 `toggleable`로 변경하여 가독성과 컴포넌트 역할을 명확히 했습니다.

*   `clickable` 대신 `toggleable` 속성 사용
*   `semantics` 내 `Role.Checkbox` 중복 설정 제거
Copy link
Member

@moondev03 moondev03 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

피그마에는 나와있지 않지만 보통 체크박스는 텍스트가 함께 사용될 것 같습니다.

이를 위한 별도의 컴포넌트를 구현하거나 해당 컴포넌트에서 처리하는게 좋을 것 같습니다.

참고로 예시 화면은 작업중인 UI 페이지에 있어요.

- `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`을 전달하도록 수정했습니다.
@HamBeomJoon HamBeomJoon merged commit 47c995d into develop Jan 25, 2026
2 checks passed
@HamBeomJoon HamBeomJoon deleted the feat/#31-prezel-checkbox branch January 25, 2026 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ feat 새로운 기능 추가 또는 기존 기능 확장

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PrezelCheckbox 구현

3 participants