Skip to content

Conversation

@HamBeomJoon
Copy link
Contributor

@HamBeomJoon HamBeomJoon commented Jan 25, 2026

📌 작업 내용

PrezelChip 구현

분기처리

  • Feedback = BAD일 때 -> 붉은색
  • Feedback = DEFAULT일때 -> Interaction으로 DEFAULT, ACTIVE, DISABLED 분기처리

🧩 관련 이슈


📸 스크린샷

  • PrezelChip
스크린샷 2026-01-26 01 44 37
  • IconChip
스크린샷 2026-01-26 01 44 45
  • Custom Chip
스크린샷 2026-01-26 01 44 51

📢 논의하고 싶은 내용

  1. 우선, 라이트테마에 맞게 설정했습니다. (피그마에 역시 안맞는 색상들이 좀 있어서,,,)
  2. 전반적으로 PrezelButton 코드랑 비슷하게 했기때문에 읽기 쉬울거라 예상합니다. 오버로딩쪽봐주세요

Summary by CodeRabbit

릴리스 노트

  • 신규 기능
    • 새로운 Chip 컴포넌트 시스템 추가: 다양한 크기, 스타일, 상호작용 및 피드백 상태를 지원합니다.
    • 텍스트, 아이콘 또는 둘 다를 포함한 칩 생성 가능
    • 컨테이너 및 콘텐츠 색상 커스터마이징 지원

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

`PrezelChip` 및 `PrezelIconChip` 컴포넌트를 새롭게 추가했습니다.

*   `PrezelChipType` (FILLED, OUTLINED), `PrezelChipSize` (SMALL, REGULAR) 등 다양한 스타일 옵션 제공
*   `PrezelChipInteraction` (DEFAULT, ACTIVE, DISABLED) 및 `PrezelChipFeedback` (DEFAULT, BAD) 상태 지원
*   아이콘 유무 및 텍스트 포함 여부에 따른 유연한 레이아웃 구성
*   컴포넌트별 테마 적용 및 스타일링 로직(`PrezelChipStyle.kt`) 분리
*   미리보기를 위한 `PrezelChipPreview` 유틸리티 추가
PrezelChip 컴포넌트에서 외부로부터 직접 색상을 주입받을 수 있도록 개선하고, 이를 확인하기 위한 커스텀 프리뷰 코드를 추가했습니다.

* `PrezelChip` 파라미터에서 `containerColor`와 `contentColor` 타입을 `PrezelColors`에서 `Color?`로 변경 및 기본값(null) 설정
* 외부 색상 주입 시 테두리(border)를 투명하게 처리하도록 로직 수정
* 다양한 색상 조합을 테스트할 수 있는 `PrezelCustomChipPreview.kt` 추가
@HamBeomJoon HamBeomJoon self-assigned this Jan 25, 2026
@HamBeomJoon HamBeomJoon added the ✨ feat 새로운 기능 추가 또는 기존 기능 확장 label Jan 25, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 25, 2026

Walkthrough

이 풀 리퀘스트는 Prezel 디자인 시스템에 칩 컴포넌트를 추가합니다. Public API로 PrezelChip(텍스트/아이콘/아이콘전용 지원, 색상·테두리 오버라이드 가능)와 PrezelIconChip를 도입하고, 칩의 타입·상호작용·피드백·크기 열거형 및 PrezelChipStyle 데이터 클래스를 추가했습니다. 내부에는 색상, 테두리, 패딩, 텍스트 스타일, 아이콘 렌더링 등 테마 기반 스타일 유틸리티와 여러 미리보기(Preview) 컴포저블이 포함되어 있습니다.

Possibly related PRs

  • Team-Prezel/Prezel-Android PR #18: PrezelChip 구현이 해당 PR에서 도입한 PrezelTheme의 shapes, spacing, stroke 토큰과 직접 연동됩니다.
  • Team-Prezel/Prezel-Android PR #25: PrezelChip 컴포넌트가 PR #25에서 사용되는 IconSource/DrawableIcon 추상화 및 버튼 관련 스타일 패턴과 코드 레벨에서 유사성을 가집니다.
🚥 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 PR 제목 'PrezelChip 구현'은 PR의 핵심 변화(PrezelChip 컴포넌트 구현)를 명확하고 간결하게 요약하고 있습니다.
Description check ✅ Passed PR 설명은 필수 섹션(작업 내용, 관련 이슈, 스크린샷, 논의 내용)을 모두 포함하고 있으며 템플릿 구조를 따르고 있습니다.
Linked Issues check ✅ Passed PR의 코드 변경사항들이 이슈 #27의 요구사항(PrezelChip, PrezelIconChip 구현 및 테마 적용)을 모두 충족하고 있습니다.
Out of Scope Changes check ✅ Passed 모든 변경사항이 PrezelChip 컴포넌트 구현 범위 내에 있으며 이슈 #27의 목표와 일치합니다.

✏️ 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.

`PrezelChip` 컴포저블 내부의 복잡한 색상 및 테두리 결정 로직을 별도의 private 함수로 분리하여 가독성을 개선했습니다.

* `resolveChipBorder`, `resolveChipContainerColor`, `resolveChipContentColor` 함수 추가
* 커스텀 색상이 지정된 경우의 테두리 처리 로직 수정 (0.dp 대신 null 반환)
* 불필요한 import 제거 및 코드 구조 정리
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.

린트도 확인해주세요 :)

Comment on lines +74 to +75
containerColor: Color? = null,
contentColor: Color? = null,
Copy link
Member

Choose a reason for hiding this comment

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

Colornullable로 처리하기보다는 Color.Unspecified를 사용하는 편이 코드 가독성 측면에서 더 깔끔해 보입니다.
또한 기본 Material3 컴포넌트의 설계 방식과도 일관성을 유지할 수 있을 것 같아요.

Comment on lines +63 to +64
PrezelChipSize.SMALL -> 12.dp
PrezelChipSize.REGULAR -> 14.dp
Copy link
Member

Choose a reason for hiding this comment

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

image

Icon 크기가 피그마와 차이가 있는 것 같아요.
PrezelChipSize.SMALL -> 14
PrezelChipSize.SMALL -> 16

Comment on lines +102 to +128
Surface(
modifier = modifier,
shape = prezelChipShape(chipSize),
color = resolvedContainerColor,
border = resolvedBorder,
) {
CompositionLocalProvider(
LocalTextStyle provides prezelChipTextStyle(chipSize),
LocalContentColor provides resolvedContentColor,
) {
Row(
modifier = Modifier.padding(prezelChipContentPadding(size = chipSize, onlyIcon = hasIcon && !hasText)),
horizontalArrangement = Arrangement.Center,
verticalAlignment = Alignment.CenterVertically,
) {
PrezelChipIcon(icon = icon, size = chipSize)

if (!hasText) return@Row
if (hasIcon) {
val spacing = if (chipSize == PrezelChipSize.REGULAR) PrezelTheme.spacing.V4 else PrezelTheme.spacing.V2
Spacer(modifier = Modifier.width(width = spacing))
}

Text(text = text)
}
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Line 27 ~와 중복 코드인 것 같아요.
혹시 resolvedXxx가 때문이라면 CompositionLocal을 활용해주세요

}

@Immutable
data class PrezelChipStyle(
Copy link
Member

Choose a reason for hiding this comment

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

Style 정보를 바탕으로 contentColor, textStyle 같은 파생 값을 계산해야 하는데, 코드를 보다 보니 이런 로직들은 최상위 함수로 분리하기보다 PrezelChipStyle 내부의 함수로 묶어두는 편이 더 자연스럽고 코드도 간결해질 것 같아요.

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.

PrezelChip 구현

3 participants