Skip to content

Conversation

@HamBeomJoon
Copy link
Contributor

@HamBeomJoon HamBeomJoon commented Jan 27, 2026

📌 작업 내용

  1. PrezelImage 구현
    오버로딩으로 Url인 Image와 Drawable인 Image를 구분했습니다.
  • Url인 경우에만 Success, Error 처리
  • Drawable인 경우 실패할 일이 없음
  1. R.drawable파일들 prefix로 core_designsystem 추가 (R.string에 붙인 이유와 동일)
스크린샷 2026-01-27 14 53 47

🧩 관련 이슈


📸 스크린샷

  • Drawable
스크린샷 2026-01-28 00 26 00
  • Url (round 없는 버전, round있고 border 없는 버전, round와 border 다 있는 버전)
Screenshot_1769493047

📢 논의하고 싶은 내용

  1. size가 100.dp로 고정되어있던데 외부에서 받도록 할까요??
  2. drawable도 하라해서 했는데, icon사이즈는 그럼 몇으로 해야하나요? (현재는 48.dp로 함)

Summary by CodeRabbit

  • 새로운 기능

    • 원격 URL 및 로컬 이미지 리소스를 지원하는 새 이미지 컴포넌트 추가
    • 라운드 코너 및 1dp 테두리 옵션 제공
    • 이미지 로드 성공/실패 콜백 지원 및 미리보기 제공
    • 이미지 소스 타입을 명시하는 새 타입 도입(Url / Drawable)
  • 스타일

    • 아바타 및 아이콘 시각 자산 참조를 새 리소스 이름으로 일괄 갱신하여 스타일 일관성 향상

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

디자인시스템에 다양한 이미지 소스(URL, Drawable)를 처리할 수 있는 `PrezelImage` 컴포넌트를 추가했습니다.

* `PrezelImageSource` sealed interface를 통해 이미지 소스 타입 정의 (Url, Drawable)
* `rounded`, `border` 옵션을 통한 이미지 스타일 커스텀 기능 지원
* `PrezelAsyncImage`를 사용한 네트워크 이미지 로딩 및 Drawable 리소스 표시 대응
* 컴포넌트 동작 확인을 위한 Preview 코드 추가
아이콘 리소스 파일명에 `core_designsystem_` 접두사를 추가하고 관련 코드를 수정했습니다.

*   `res/drawable` 내 모든 아이콘 파일명 변경 (예: `ic_arrow_left` -> `core_designsystem_ic_arrow_left`)
*   `PrezelIcons.kt` 내 리소스 참조 경로 업데이트
*   `PrezelAvatar.kt` 내 하드코딩된 리소스 참조 수정
*   `PrezelImage.kt`, `PrezelImageSource.kt` 내 불필요한 개행 제거
* `PrezelImage` 내부 `Modifier`의 가독성 개선을 위해 줄바꿈을 추가했습니다.
* `LaunchedEffect`의 key를 `Unit`에서 `source`로 변경하여 이미지 소스 변경 시 `onSuccess` 콜백이 적절히 재실행되도록 수정했습니다.
@HamBeomJoon HamBeomJoon self-assigned this Jan 27, 2026
@HamBeomJoon HamBeomJoon added the ✨ feat 새로운 기능 추가 또는 기존 기능 확장 label Jan 27, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 27, 2026

Walkthrough

디자인 시스템의 드로어블 참조명을 ic_*에서 core_designsystem_ic_*로 교체하고 DefaultAvatarIcon의 아이콘 리소스 참조를 갱신했습니다. 새로 PrezelImageSource(sealed interface: Url, Drawable)를 추가했고, 원격 URL 이미지(PrezelAsyncImage 기반)와 로컬 드로어블을 렌더링하는 두 개의 PrezelImage 컴포저블 오버로드를 도입했습니다. PrezelImage는 모서리 둥글기와 1dp 테두리 옵션을 적용하고 성공/오류 콜백을 노출합니다.

Possibly related PRs

  • PR 19: PrezelIcons 매핑과 드로어블 리소스 식별자 추가/변경을 다루어 리소스 참조 변경과 직접 연관됨.
  • PR 26: DefaultAvatarIcon 리소스 참조 및 PrezelImage/PrezelAsyncImage 연동 관련 구현이 중복되거나 겹침.
  • PR 38: PrezelAvatar.kt 파일의 아바타 아이콘 리소스 및 시각적 속성(크기/톤) 변경과 코드 수준에서 직접적으로 충돌 가능.
🚥 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 제목 'PrezelImage 구현'은 변경사항의 주요 내용인 PrezelImage 컴포넌트 구현을 명확하게 설명하고 있습니다.
Linked Issues check ✅ Passed 코드 변경사항이 이슈 #36의 모든 요구사항을 충족합니다: PrezelImage 컴포넌트 구현, Drawable과 URL 구분 처리, 올바른 렌더링 구현.
Out of Scope Changes check ✅ Passed core_designsystem 접두사 추가는 리소스 관리의 일관성을 위한 필요한 변경이며, 이슈 범위 내의 관련 작업입니다.
Description check ✅ Passed PR 설명이 요구되는 템플릿의 모든 필수 섹션을 포함하고 있으며, 작업 내용, 관련 이슈, 스크린샷, 논의 사항이 명확하게 기술되어 있습니다.

✏️ 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
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: 1

🤖 Fix all issues with AI agents
In
`@Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/image/PrezelImage.kt`:
- Line 97: The preview label "Drawable / No Round / No Border" is inconsistent
with the PrezelImage call that sets rounded = true; update the Text label in
PrezelImage.kt to reflect the actual configuration (e.g., "Drawable / Rounded /
No Border") or change the PrezelImage parameter (rounded) to false so the label
matches—locate the Text(...) and the PrezelImage(...) usage to keep the
description and the rounded property in sync.
🧹 Nitpick comments (2)
Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/image/PrezelImageSource.kt (1)

12-15: @DrawableRes 어노테이션 추가를 권장합니다.

기존 DrawableIcon 클래스(IconSource.kt, line 21)와 일관성을 유지하고, 컴파일 타임에 올바른 리소스 타입이 전달되는지 검증하기 위해 @DrawableRes 어노테이션을 추가하는 것이 좋습니다.

♻️ 제안하는 수정
+import androidx.annotation.DrawableRes
+
 `@Immutable`
 data class Drawable(
-    val resId: Int,
+    `@DrawableRes` val resId: Int,
 ) : PrezelImageSource
Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/image/PrezelImage.kt (1)

44-44: 컨테이너 크기를 외부에서 설정 가능하게 만드는 것을 권장합니다.

PR 설명에서 언급된 것처럼, 고정된 100.dp 크기는 재사용성을 제한합니다. size: Dp = 100.dp 파라미터를 추가하면 다양한 사용 케이스를 지원할 수 있습니다.

♻️ 제안하는 수정
 `@Composable`
 fun PrezelImage(
     source: PrezelImageSource,
     contentDescription: String,
     modifier: Modifier = Modifier,
+    size: Dp = 100.dp,
     rounded: Boolean = false,
     border: Boolean = false,
     onSuccess: () -> Unit = {},
     onError: (Throwable?) -> Unit = {},
 ) {
     // ...
     Box(
         modifier = modifier
-            .size(100.dp)
+            .size(size)
             .clip(shape)

`PrezelImage` 컴포넌트 내부에 하드코딩되어 있던 `100.dp` 크기 설정을 제거하고, 외부에서 전달받은 `modifier`를 통해 크기를 결정하도록 수정했습니다. 또한 미리보기(Preview) 코드를 보완했습니다.

*   `PrezelImage` 내부 `Box` 및 `Image`의 고정 크기 제거
*   Preview에서 각 케이스별로 `Modifier.size(100.dp)` 명시적 추가
*   Preview 내 누락된 테두리(Border) 테스트 케이스 추가 및 텍스트 수정
PrezelImage의 프리뷰 코드에서 반복되는 부분을 별도의 컴포저블 함수인 `PrezelImagePreviewItem`으로 분리하여 가독성을 높였습니다.
`PrezelImageSource`를 사용하는 방식 대신 URL과 Drawable 리소스를 각각 처리하는 오버로딩 함수로 분리했습니다. 또한 공통 스타일 로직을 `prezelImageContainer` 확장 함수로 추출하여 코드 중복을 제거했습니다.

*   `PrezelImageSource` 기반의 조건부 렌더링 제거
*   URL 입력을 받는 `PrezelImage`와 Drawable 리소스를 받는 `PrezelImage`로 분리
*   공통 스타일(shape, border) 처리를 위한 `prezelImageContainer` Modifier 추가
*   불필요한 `LaunchedEffect` 제거 및 import 정리
@HamBeomJoon HamBeomJoon merged commit e4ff3ae into develop Jan 28, 2026
2 checks passed
@HamBeomJoon HamBeomJoon deleted the feat/#36-prezel-image branch January 28, 2026 16:52
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.

PrezelImage 구현

3 participants