Skip to content

PrezelChip 변경사항 반영, 아이콘, ColorToken 변경#97

Merged
HamBeomJoon merged 10 commits intodevelopfrom
refactor/#96-chip-icon-colorToken
Apr 8, 2026
Merged

PrezelChip 변경사항 반영, 아이콘, ColorToken 변경#97
HamBeomJoon merged 10 commits intodevelopfrom
refactor/#96-chip-icon-colorToken

Conversation

@HamBeomJoon
Copy link
Copy Markdown
Contributor

@HamBeomJoon HamBeomJoon commented Apr 6, 2026

📌 작업 내용

  • icon/script 추가

  • bg_large: cool gray_50 -> cool gray_100 변경

  • bg_disabled: cool gray_100 -> cool gray_50 변경

type = filled, size = regular, interaction = default, feedback = default인 PrezelChip

  • 컨테이너 : bgMedium -> bgLarge 변경
  • 텍스트 : text/medium 변경
  • 아이콘 : icon/medium 변경

Chip의 contentColor를 하나로받고 있었는데, iconColor, textColor로 분리했습니다.


🧩 관련 이슈


📸 스크린샷

스크린샷 2026-04-07 01 04 53

📢 논의하고 싶은 내용

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능

    • 스크립트 아이콘 추가.
    • 칩 컴포넌트에 텍스트 필수화 및 명시적 타입/크기/상호작용/피드백 옵션과 기본 구성 제공.
    • 아이콘 전용 및 텍스트+아이콘 조합을 지원하는 새로운 레이아웃과 미리보기 단순화.
  • 버그 수정

    • 라이트 테마 배경 색상 조정(대체 색상 업데이트).
  • Chores

    • 칩 관련 내부 아키텍처 및 스타일 구성 재정비.

* `ic_script` 아이콘 애셋 추가 (`core_designsystem_ic_script.xml`)
PrezelColorScheme 내의 배경색 관련 토큰 값을 디자인 가이드에 맞춰 조정했습니다.

* `bgLarge` 색상을 `CoolGray50`에서 `CoolGray100`으로 변경
* `bgDisabled` 색상을 `CoolGray100`에서 `CoolGray50`으로 변경
* refactor: PrezelChipStyle의 상태별 색상 매핑 수정

디자인 시스템 가이드에 맞춰 `PrezelChip`의 배경색과 아이콘 색상 결정 로직을 개선했습니다.

*   **배경색(`containerColor`)**:
    *   `DISABLED` 상태의 배경색을 `bgLarge`에서 `bgDisabled`로 변경했습니다.
    *   `FILLED` 타입의 기본 배경색을 `bgMedium`에서 `bgLarge`로 변경했습니다.
*   **아이콘 색상(`iconColor`)**:
    *   `FILLED` 타입일 때 기본 아이콘 색상을 `iconMedium`으로, `OUTLINED` 타입일 때 `iconRegular`를 사용하도록 세분화했습니다.
*   `build.gradle.kts` 내 `Detekt` 태스크 설정에 `jvmTarget = "21"`을 명시적으로 추가했습니다.
*   `io.gitlab.arturbosch.detekt.Detekt` 임포트문을 추가하고 관련 코드를 정리했습니다.
* refactor: PrezelChip 아이콘 및 텍스트 색상 관리 로직 분리

`PrezelChip`의 내부 색상을 결정하는 `PrezelChipColors` 구조를 개선하여 아이콘과 텍스트 색상을 개별적으로 설정할 수 있도록 변경했습니다.

*   `PrezelChipColors`에서 `contentColor`를 제거하고 `iconColor`와 `textColor`로 세분화
*   `LocalPrezelChipTextColor`, `LocalPrezelChipIconColor` 등 전용 `CompositionLocal` 추가
*   `PrezelChipStyle` 내에서 상호작용 및 피드백 상태에 따른 `iconColor()`와 `textColor()` 계산 로직 분리 구현
*   `PrezelChip` 컴포저블에서 `Icon`의 `tint`와 `Text`의 `color`에 각각 분리된 색상을 적용하도록 수정
*   기존 프리뷰 코드의 커스텀 컬러 설정을 변경된 구조에 맞게 업데이트 (예: `feedbackWarningRegular`를 아이콘과 텍스트 모두에 적용)
@HamBeomJoon HamBeomJoon self-assigned this Apr 6, 2026
@HamBeomJoon HamBeomJoon requested a review from moondev03 as a code owner April 6, 2026 16:07
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 6, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

칩 컴포넌트 API와 스타일 구현을 재구성(스타일 파일 제거 → Defaults/Models/Layout로 분리), 색상 토큰 교체, 새 스크립트 아이콘 추가, 그리고 Gradle Detekt 작업에 jvmTarget = "21" 설정이 추가되었습니다.

Changes

Cohort / File(s) Summary
Detekt 빌드 구성
Prezel/build.gradle.kts
Detekt task 설정을 정규화하고 tasks.withType<Detekt>().configureEach { jvmTarget = "21"; reports { txt.enable = true; html.enable = false; xml.enable = false; sarif.enable = false } } 적용.
칩 컴포넌트 API 변경
Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/chip/PrezelChip.kt, Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/chip/PrezelIconChip.kt
PrezelChip/PrezelIconChip 시그니처가 PrezelChipStyle 기반에서 type/size/interaction/feedbackconfig: PrezelChipDefault 사용으로 변경. 프리뷰 로직 단순화 및 내부 구현을 PrezelChipLayout 호출로 전환.
칩 스타일 로직 → 구성 모듈로 이동
Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/chip/config/PrezelChipDefaults.kt, Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/chip/config/PrezelChipModels.kt, .../config/PrezelChipLayout.kt
PrezelChipDefault 데이터 모델과 PrezelChipDefaults.getDefault(...) 컴포저블 추가, 칩 도메인 열거형(PrezelChipType/Size/Interaction/Feedback) 추가, 레이아웃 컴포저블(PrezelChipLayout) 및 아이콘 헬퍼 도입.
이전 스타일 모델 제거
Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/chip/PrezelChipStyle.kt
기존 PrezelChipStyle 파일 전체 제거(타입/상호작용/피드백/크기 열거형과 스타일링 유틸 포함).
색상 토큰 업데이트
Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/theme/PrezelColorScheme.kt
Light 스킴에서 bgLargeCoolGray50CoolGray100으로, bgDisabledCoolGray100CoolGray50으로 교체.
새 아이콘 리소스 추가
Prezel/core/designsystem/src/main/res/drawable/core_designsystem_ic_script.xml
스크립트 아이콘용 벡터 드로어블 추가(24dp, 단일 path, fill #6E737D).

Possibly related PRs

  • PrezelChip 구현 #41 — 동일 칩 컴포넌트(PrezelChip/PrezelIconChip) 및 스타일 체계 리팩터링과 강한 코드 수준 연관성 있음.
  • Color System 설계 및 적용 #10 — 디자인 시스템 테마/색상 모듈(PrezelColorScheme 등) 변경과 관련 있어 색상 토큰 수정과 연관될 가능성 있음.

Suggested labels

🔨 refactor

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning Detekt 설정 변경과 PrezelChipLayout/PrezelChipDefaults/PrezelChipModels 신규 생성은 #96 범위를 벗어나 있습니다. Detekt 설정과 아키텍처 리팩토링 변경을 별도 PR로 분리하거나, 범위를 명확히 문서화하세요.
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 (3 passed)
Check name Status Explanation
Title check ✅ Passed 제목은 주요 변경사항인 PrezelChip 컴포넌트 리팩토링, 아이콘 추가, ColorToken 변경을 정확하게 요약하고 있습니다.
Description check ✅ Passed PR 설명이 필수 섹션(작업 내용, 관련 이슈, 스크린샷)을 포함하고 구체적인 변경사항을 제시했으나, 일부 섹션이 불완전합니다.
Linked Issues check ✅ Passed 모든 코드 변경사항이 #96 이슈의 요구사항(아이콘 추가, ColorToken 변경, PrezelChip 스타일 업데이트)을 충족합니다.

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


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.

❤️ Share

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

Copy link
Copy Markdown
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.

🧹 Nitpick comments (1)
Prezel/core/designsystem/src/main/res/drawable/core_designsystem_ic_script.xml (1)

7-7: 아이콘 색상 하드코딩으로 상태별 tint 적용이 제한될 수 있습니다.

android:fillColor="#6E737D" 고정값은 컴포넌트에서 분리한 iconColor 정책과 어긋날 수 있습니다. 아이콘은 기본적으로 중립 색(예: black) + 런타임 tint 적용 또는 디자인시스템 color 리소스 참조로 맞추는 편이 안전합니다.

예시 수정안
-        android:fillColor="#6E737D"
+        android:fillColor="@android:color/black"

또는

-        android:fillColor="#6E737D"
+        android:fillColor="@color/core_designsystem_icon_medium"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@Prezel/core/designsystem/src/main/res/drawable/core_designsystem_ic_script.xml`
at line 7, Replace the hardcoded color in the vector drawable by removing or
replacing the android:fillColor="#6E737D" entry in
core_designsystem_ic_script.xml so the icon can be tinted at runtime; either set
the fillColor to a neutral default (e.g., black or `@android`:color/black) or
reference a design-system color resource/attribute (e.g., `@color/icon_neutral` or
?attr/colorControlNormal) so components can apply state-based tints. Ensure the
drawable remains a single-color vector (no multiple hardcoded fills) so
ImageView/AppCompatImageView tinting works as expected.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@Prezel/core/designsystem/src/main/res/drawable/core_designsystem_ic_script.xml`:
- Line 7: Replace the hardcoded color in the vector drawable by removing or
replacing the android:fillColor="#6E737D" entry in
core_designsystem_ic_script.xml so the icon can be tinted at runtime; either set
the fillColor to a neutral default (e.g., black or `@android`:color/black) or
reference a design-system color resource/attribute (e.g., `@color/icon_neutral` or
?attr/colorControlNormal) so components can apply state-based tints. Ensure the
drawable remains a single-color vector (no multiple hardcoded fills) so
ImageView/AppCompatImageView tinting works as expected.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c077f25f-5297-4154-8203-14d151e600e9

📥 Commits

Reviewing files that changed from the base of the PR and between f4d5771 and 95908cb.

📒 Files selected for processing (5)
  • Prezel/build.gradle.kts
  • Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/chip/PrezelChip.kt
  • Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/chip/PrezelChipStyle.kt
  • Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/theme/PrezelColorScheme.kt
  • Prezel/core/designsystem/src/main/res/drawable/core_designsystem_ic_script.xml

* refactor: PrezelChip 스타일 계산 로직 분리 및 Defaults 도입

기존 `PrezelChipStyle` 클래스에 집중되어 있던 스타일 계산 로직을 `PrezelChipDefaults` 객체로 분리하여 컴포넌트 구조를 개선했습니다.

*   `PrezelChipStyle.kt` 삭제 및 관련 로직을 `PrezelChipDefaults.kt`로 이동
*   `PrezelChipDefault` 데이터 클래스를 통해 계산된 스타일 값(`shape`, `border`, `color` 등)을 한 번에 전달하도록 변경
*   `PrezelChipDefaults.getDefault()`를 통해 상태별(Type, Size, Interaction, Feedback) 스타일 값을 동적으로 계산

* feat: PrezelChip 모델 정의 및 주석 추가

칩의 상태와 속성을 정의하는 enum 클래스들을 별도 파일로 분리하고 각 항목에 대한 설명을 추가했습니다.

*   `PrezelChipModels.kt` 신규 생성
*   `PrezelChipType`, `PrezelChipSize`, `PrezelChipInteraction`, `PrezelChipFeedback` 이동 및 KDoc 주석 추가

* refactor: PrezelChip 및 PrezelIconChip 파라미터 구조 변경

`style: PrezelChipStyle` 객체를 통째로 받던 방식에서 개별 상태 값(`type`, `size` 등)을 직접 받도록 변경하여 사용성을 높였습니다.

*   `PrezelChip`, `PrezelIconChip`의 파라미터를 `type`, `size`, `interaction`, `feedback`으로 명시화
*   `PrezelChip` 내부에서 `PrezelChipDefaults.getDefault`를 호출하여 스타일 설정 적용
*   `PrezelChipIcon` 컴포저블이 `PrezelChipDefault` 설정을 주입받아 렌더링하도록 수정

* refactor: PrezelChip 프리뷰 코드 구조 개선 및 분리

반복되는 프리뷰 로직을 별도의 파일로 추출하여 가독성을 높이고 유지보수를 용이하게 했습니다.

*   `PrezelChipPreview.kt` 생성 및 공통 프리뷰 콘텐츠 함수(`PrezelChipPreviewContent` 등) 정의
*   `PrezelChip.kt` 및 `PrezelIconChip.kt` 내 프리뷰 코드를 신규 분리된 함수를 사용하도록 리팩터링
*   사용자 정의 색상 테스트를 위한 `PrezelChipCustomPreviewContent` 추가
Copy link
Copy Markdown
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.

🧹 Nitpick comments (3)
Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/chip/PrezelChipDefaults.kt (1)

112-119: Border 색상에 chipColors.iconColor를 사용하는 로직이 의도된 것인지 확인 필요합니다.

OUTLINED 타입의 border 색상 결정 시 chipColors.iconColor를 참조하고 있습니다. 일관성을 위해 별도의 borderColor 필드를 PrezelChipColors에 추가하거나, 이 동작이 의도된 것이라면 주석으로 명시하는 것이 좋겠습니다.

val borderColor =
    when {
        chipColors.iconColor != Color.Unspecified -> chipColors.iconColor // iconColor를 border에도 사용
        ...
    }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/chip/PrezelChipDefaults.kt`
around lines 112 - 119, The border color logic in PrezelChipDefaults (the
borderColor when computing OUTLINED chips) currently falls back to
chipColors.iconColor (chipColors.iconColor) which may be unintended; either add
a dedicated border color property to PrezelChipColors (e.g., borderColor) and
use that in the borderColor when present, or if using iconColor for borders is
intentional, add a clarifying comment in PrezelChipDefaults next to the
chipColors.iconColor branch to document this behavior and update any
constructors/builders of PrezelChipColors to include/handle the new borderColor
field if you add it.
Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/chip/PrezelChipPreview.kt (1)

109-112: 하드코딩된 색상 값을 테마 토큰으로 대체하는 것을 고려해 주세요.

프리뷰 코드이므로 큰 문제는 아니지만, Color(0xFFDBFFF6)Color(0xFF00A37A) 같은 하드코딩 값이 디자인 시스템의 토큰과 일치하는지 확인하고, 가능하다면 테마 토큰으로 대체하는 것이 일관성 유지에 도움됩니다.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/chip/PrezelChipPreview.kt`
around lines 109 - 112, The preview is using hardcoded Color literals in
PrezelChipPreview when constructing PrezelChipColors (containerColor =
Color(0xFFDBFFF6), textColor = Color(0xFF00A37A)); replace these literals with
the appropriate design system theme tokens (e.g., use the color tokens exposed
by your theme/provider such as PrezelTheme.colors.<tokenName> or
DesignTokens.<tokenName>) so PrezelChipPreview and the PrezelChipColors instance
reflect the centralized theme values and maintain consistency.
Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/chip/PrezelIconChip.kt (1)

13-33: config 파라미터와 개별 파라미터 간 불일치 가능성이 있습니다.

호출자가 config를 직접 제공하면서 동시에 type, size 등의 개별 파라미터도 다른 값으로 전달할 경우, config의 스타일과 PrezelChip에 전달되는 type/size/interaction/feedback 값이 불일치할 수 있습니다.

♻️ 권장 수정안: config 제공 시 개별 파라미터 무시 또는 문서화
 `@Composable`
 fun PrezelIconChip(
     `@DrawableRes` iconResId: Int,
     modifier: Modifier = Modifier,
     type: PrezelChipType = PrezelChipType.FILLED,
     size: PrezelChipSize = PrezelChipSize.REGULAR,
     interaction: PrezelChipInteraction = PrezelChipInteraction.DEFAULT,
     feedback: PrezelChipFeedback = PrezelChipFeedback.DEFAULT,
-    config: PrezelChipDefault = PrezelChipDefaults.getDefault(
+    config: PrezelChipDefault? = null,
+) {
+    val resolvedConfig = config ?: PrezelChipDefaults.getDefault(
         iconOnly = true,
         type = type,
         size = size,
         interaction = interaction,
         feedback = feedback,
-    ),
-) {
+    )
+
     PrezelChip(
         modifier = modifier,
         iconResId = iconResId,
         type = type,
         size = size,
         interaction = interaction,
         feedback = feedback,
-        config = config,
+        config = resolvedConfig,
     )
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/chip/PrezelIconChip.kt`
around lines 13 - 33, PrezelIconChip may pass mismatched styling because callers
can supply a custom config while also passing different
type/size/interaction/feedback; update PrezelIconChip so it enforces consistency
by deriving type, size, interaction and feedback from the provided config
(config from PrezelChipDefaults.getDefault or a caller-supplied config) and pass
those derived values into PrezelChip instead of the independent params, or
alternatively make config nullable (default null) and if non-null ignore the
individual params (or validate and throw/log on mismatch). Locate PrezelIconChip
and the call to PrezelChip as well as PrezelChipDefaults.getDefault to implement
the chosen approach.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/chip/PrezelChipDefaults.kt`:
- Around line 112-119: The border color logic in PrezelChipDefaults (the
borderColor when computing OUTLINED chips) currently falls back to
chipColors.iconColor (chipColors.iconColor) which may be unintended; either add
a dedicated border color property to PrezelChipColors (e.g., borderColor) and
use that in the borderColor when present, or if using iconColor for borders is
intentional, add a clarifying comment in PrezelChipDefaults next to the
chipColors.iconColor branch to document this behavior and update any
constructors/builders of PrezelChipColors to include/handle the new borderColor
field if you add it.

In
`@Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/chip/PrezelChipPreview.kt`:
- Around line 109-112: The preview is using hardcoded Color literals in
PrezelChipPreview when constructing PrezelChipColors (containerColor =
Color(0xFFDBFFF6), textColor = Color(0xFF00A37A)); replace these literals with
the appropriate design system theme tokens (e.g., use the color tokens exposed
by your theme/provider such as PrezelTheme.colors.<tokenName> or
DesignTokens.<tokenName>) so PrezelChipPreview and the PrezelChipColors instance
reflect the centralized theme values and maintain consistency.

In
`@Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/chip/PrezelIconChip.kt`:
- Around line 13-33: PrezelIconChip may pass mismatched styling because callers
can supply a custom config while also passing different
type/size/interaction/feedback; update PrezelIconChip so it enforces consistency
by deriving type, size, interaction and feedback from the provided config
(config from PrezelChipDefaults.getDefault or a caller-supplied config) and pass
those derived values into PrezelChip instead of the independent params, or
alternatively make config nullable (default null) and if non-null ignore the
individual params (or validate and throw/log on mismatch). Locate PrezelIconChip
and the call to PrezelChip as well as PrezelChipDefaults.getDefault to implement
the chosen approach.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f35a628b-d681-4d85-b853-e275f2b1d6a3

📥 Commits

Reviewing files that changed from the base of the PR and between 95908cb and 86ecace.

📒 Files selected for processing (6)
  • Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/chip/PrezelChip.kt
  • Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/chip/PrezelChipDefaults.kt
  • Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/chip/PrezelChipModels.kt
  • Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/chip/PrezelChipPreview.kt
  • Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/chip/PrezelChipStyle.kt
  • Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/chip/PrezelIconChip.kt
💤 Files with no reviewable changes (1)
  • Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/chip/PrezelChipStyle.kt
✅ Files skipped from review due to trivial changes (1)
  • Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/chip/PrezelChipModels.kt

* refactor: PrezelIconChip의 config 파라미터 초기화 로직 수정

`PrezelIconChip` 컴포저블의 `config` 파라미터 기본값을 `null`로 변경하고, 내부에서 `resolvedConfig`를 통해 초기화하도록 수정했습니다. 이는 파라미터로 전달된 값이 없을 때만 `PrezelChipDefaults.getDefault`가 호출되도록 보장합니다.

* feat: PrezelChipColors 내 borderColor 필드 추가 및 적용

`PrezelChipColors` 데이터 클래스에 `borderColor` 필드를 추가하여 테두리 색상을 개별적으로 지정할 수 있도록 개선했습니다.

*   `PrezelChipColors`: `borderColor` 프로퍼티 추가
*   `PrezelChipDefaults`: `borderColor`가 명시적으로 지정된 경우 이를 우선적으로 사용하도록 로직 수정 (기존에는 `iconColor`를 참조함)
*   `PrezelChipPreview`: 커스텀 컬러 테스트 케이스에 `borderColor` 설정 추가
@HamBeomJoon HamBeomJoon added 🔨 refactor 기능 변경 없이 내부 구조, 설계, 가독성 개선 🎨 style 코드 포맷, 네이밍, 스타일 수정 (로직 변경 없음) and removed 🔨 refactor 기능 변경 없이 내부 구조, 설계, 가독성 개선 labels Apr 7, 2026
`PrezelChip`의 가독성과 유지보수성을 높이기 위해 내부 상태 관리 방식을 변경하고 관련 파일을 정리하였습니다.

* **refactor: Chip 설정 및 모델 구조 개선**
    * `PrezelChipModels.kt`와 `PrezelChipDefaults.kt`를 `config` 패키지로 이동하여 구조화했습니다.
    * `CompositionLocal`(`LocalPrezelChipColors` 등)을 통한 상태 전달 방식을 제거하고, `config` 객체를 직접 전달하거나 확장 함수를 통해 속성을 적용하도록 변경했습니다.
    * `PrezelChipDefault.withCustomColors` 확장 함수를 추가하여 사용자 정의 색상 적용 로직을 캡슐화했습니다.

* **refactor: PrezelChip 및 PrezelIconChip 구현 최적화**
    * `PrezelChip`의 중복 정의된 함수를 통합하고, 실제 UI 렌더링을 담당하는 `PrezelChipContent`를 분리했습니다.
    * `PrezelIconChip`에서 `config` 파라미터의 기본값 설정 로직을 개선했습니다.
    * 불필요한 `LocalTextStyle` 및 `LocalPrezelChipIconColor` 등의 사용을 제거하고 `config`에서 직접 값을 참조하도록 수정했습니다.

* **style: 미리보기(Preview) 코드 통합 및 개선**
    * `PrezelChipPreview.kt` 파일을 삭제하고, 해당 로직을 각 컴포넌트 파일(`PrezelChip.kt`, `PrezelIconChip.kt`) 내부로 통합했습니다.
    * `PreviewParameterProvider`를 도입하여 다양한 `PrezelChipType`에 대한 미리보기를 효율적으로 구성했습니다.
    * 미리보기 레이아웃을 `PreviewSection`과 `PreviewValueRow`를 사용하는 일관된 스타일로 업데이트했습니다.
Copy link
Copy Markdown
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.

🧹 Nitpick comments (1)
Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/chip/config/PrezelChipDefaults.kt (1)

203-214: when 표현식 순서 일관성 (선택 사항)

getIconTextSpacingREGULARSMALL 순서이고, getIconSizeSMALLREGULAR 순서입니다. 기능적으로는 문제없지만, 가독성을 위해 순서를 통일하면 좋습니다.

♻️ 순서 통일 제안
 `@Composable`
 private fun getIconTextSpacing(size: PrezelChipSize): Dp =
     when (size) {
-        PrezelChipSize.REGULAR -> PrezelTheme.spacing.V4
         PrezelChipSize.SMALL -> PrezelTheme.spacing.V2
+        PrezelChipSize.REGULAR -> PrezelTheme.spacing.V4
     }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/chip/config/PrezelChipDefaults.kt`
around lines 203 - 214, The two when-expressions have inconsistent case
ordering: getIconTextSpacing lists PrezelChipSize.REGULAR then SMALL, while
getIconSize lists SMALL then REGULAR; update getIconSize (or getIconTextSpacing)
so both when clauses use the same case order (preferably REGULAR then SMALL) to
improve readability—modify the when in getIconSize/getIconTextSpacing
accordingly while keeping the same return values.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/chip/config/PrezelChipDefaults.kt`:
- Around line 203-214: The two when-expressions have inconsistent case ordering:
getIconTextSpacing lists PrezelChipSize.REGULAR then SMALL, while getIconSize
lists SMALL then REGULAR; update getIconSize (or getIconTextSpacing) so both
when clauses use the same case order (preferably REGULAR then SMALL) to improve
readability—modify the when in getIconSize/getIconTextSpacing accordingly while
keeping the same return values.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6b3ee211-222a-406a-97d0-b3f541e9be8d

📥 Commits

Reviewing files that changed from the base of the PR and between e363168 and 0b3a673.

📒 Files selected for processing (4)
  • Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/chip/PrezelChip.kt
  • Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/chip/PrezelIconChip.kt
  • Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/chip/config/PrezelChipDefaults.kt
  • Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/chip/config/PrezelChipModels.kt
🚧 Files skipped from review as they are similar to previous changes (2)
  • Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/chip/PrezelIconChip.kt
  • Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/chip/PrezelChip.kt

`PrezelChip`과 `PrezelIconChip`의 공통 UI 렌더링 로직을 `PrezelChipLayout`으로 통합하고, 커스텀 스타일 적용 방식을 개선했습니다.
@moondev03
Copy link
Copy Markdown
Member

moondev03 commented Apr 8, 2026

Chip

image

IconChip

image

* refactor: PrezelChipType에 따른 borderColor 조건부 적용

`PrezelChipDefaults`에서 `borderColor`를 설정할 때, 칩의 타입이 `PrezelChipType.OUTLINED`인 경우에만 색상을 할당하고 그 외의 경우에는 `null`이 전달되도록 로직을 수정하였습니다.
Copy link
Copy Markdown
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: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/chip/config/PrezelChipLayout.kt`:
- Around line 56-60: 현재 Text( text = text, color = config.textColor, style =
config.textStyle )가 긴 문구로 인해 칩 높이를 늘리거나 레이아웃을 깨뜨릴 수 있으니 PrezelChipLayout의 해당
Text 컴포저블에 maxLines = 1 및 overflow = TextOverflow.Ellipsis 속성을 추가해 한 줄로 고정하고 넘치는
텍스트는 말줄임표로 처리되도록 수정하세요; TextOverflow를 사용하려면 필요한 import도 추가해 주세요.
- Around line 67-78: PrezelChipIcon always passes contentDescription = null
which makes icon-only chips nameless for TalkBack; update the API to accept a
contentDescription parameter and thread it from PrezelIconChip into
PrezelChipIcon (add a contentDescription: String? parameter to PrezelChipIcon
and to the PrezelIconChip/PrezelChipLayout call sites), ensure when a chip has
visible text you keep contentDescription = null (decorative), and when using the
icon-only path require/forward a non-null description so TalkBack receives an
accessible label.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3259af62-f271-4715-8c3c-482dd23f8d72

📥 Commits

Reviewing files that changed from the base of the PR and between 0b3a673 and 2f6deb9.

📒 Files selected for processing (4)
  • Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/chip/PrezelChip.kt
  • Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/chip/PrezelIconChip.kt
  • Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/chip/config/PrezelChipDefaults.kt
  • Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/chip/config/PrezelChipLayout.kt

@HamBeomJoon HamBeomJoon merged commit 6947629 into develop Apr 8, 2026
2 checks passed
@HamBeomJoon HamBeomJoon deleted the refactor/#96-chip-icon-colorToken branch April 8, 2026 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🎨 style 코드 포맷, 네이밍, 스타일 수정 (로직 변경 없음)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PrezelChip 변경사항 반영, 아이콘, ColorToken 변경

2 participants