Skip to content

PrezelList 구현#72

Open
HamBeomJoon wants to merge 8 commits intodevelopfrom
feat/#71-prezel-list
Open

PrezelList 구현#72
HamBeomJoon wants to merge 8 commits intodevelopfrom
feat/#71-prezel-list

Conversation

@HamBeomJoon
Copy link
Contributor

@HamBeomJoon HamBeomJoon commented Feb 27, 2026

📌 작업 내용

PrezelList 컴포넌트 구현

🧩 관련 이슈


📸 스크린샷

스크린샷 2026-02-28 01 19 01 스크린샷 2026-02-28 01 19 23

📢 논의하고 싶은 내용

  • trailingContents: ImmutableList<@composable () -> Unit> = persistentListOf(), 으로받았는데 그냥 Composable로 받으면될까요?
  • size: PrezelListSize = PrezelListSize.REGULAR, 기본값으로 Regular를 했는데, 기본값 없애고 필수 파라미터로 변경하는게 좋을까요?

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능
    • 수평 리스트 컴포넌트 추가
    • 작음 및 일반 두 가지 크기 지원
    • 선행(leading) 및 후행(trailing) 콘텐츠 옵션으로 아이콘/커스텀 슬롯 제공
    • 중첩 형식 지원(내부 패딩/정렬 조정)
    • 크기별 텍스트·아이콘 간격 및 패딩 자동 조절
    • 각 사이즈별 미리보기 샘플 추가

디자인 시스템의 리스트 컴포넌트에서 공통으로 사용할 `PrezelListSize` 열거형과 사이즈별 스타일 처리 로직을 추가했습니다.

*   `PrezelListSize`: `SMALL`, `REGULAR` 사이즈 정의
*   `PrezelListIcon`: `IconSource`를 기반으로 사이즈에 따른 아이콘 렌더링 구현
*   `prezelListVerticalPadding`: 사이즈별 수직 패딩 값 제공
*   `prezelListTextStyle`: 사이즈별 타이포그래피 스타일 제공
*   사이즈별 간격 조절 함수(`prezelListIconTextSpacing`, `prezelListTextTrailingSpacing`, `prezelListTrailingIconSpacing`) 추가
디자인 시스템 가이드에 맞춘 리스트 아이템 컴포넌트인 `PrezelList`를 추가했습니다.

*   `PrezelListSize` (SMALL, REGULAR)에 따른 텍스트 스타일 및 간격 대응
*   `leadingContent` 및 `trailingContents`를 통한 아이콘/컨텐츠 삽입 지원
*   `nested` 파라미터를 통한 계층 구조 인덴트 지원
*   `ImmutableList`를 활용한 다중 트레일링 컨텐츠 렌더링 및 노출 제어 로직 구현
*   테마별 미리보기(Preview) 코드 추가
`PrezelList` 컴포넌트의 패딩 로직을 개선하고, 가독성을 위해 프리뷰 관련 코드를 별도 파일로 분리하였습니다.

*   **PrezelList**: `enabled`, `onClick` 등 미사용 파라미터를 제거하고, `nested` 상태에 따른 레이아웃 처리를 `prezelListContentPadding`으로 통합했습니다.
*   **PrezelListStyle**: `prezelListVerticalPadding`을 `prezelListContentPadding`으로 변경하여 `nested` 여부에 따른 `PaddingValues`를 반환하도록 수정했습니다.
*   **PrezelListPreview**: 기존 `PrezelList.kt`에 있던 프리뷰 코드를 `PrezelListPreview.kt`로 분리하고, 사이즈별(SMALL, REGULAR) 및 케이스별(Nested, Leading, Trailing) 상세 프리뷰를 추가했습니다.
@HamBeomJoon HamBeomJoon self-assigned this Feb 27, 2026
@HamBeomJoon HamBeomJoon added the ✨ feat 새로운 기능 추가 또는 기존 기능 확장 label Feb 27, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 27, 2026

Walkthrough

세 개의 파일을 추가해 PrezelList 컴포넌트를 구현합니다. PrezelList.kt는 제목과 선택적 리딩·트레일링 슬롯을 가진 가로 행을 렌더링하는 공개 컴포저블 PrezelList(...)와 내부 헬퍼들을 제공합니다. PrezelListStyle.ktPrezelListSize(SMALL, REGULAR)와 아이콘 크기, 패딩, 텍스트 스타일 및 간격을 결정하는 내부 유틸 컴포저블들을 정의합니다. PrezelListPreview.kt는 크기·중첩·리딩·트레일링 조합을 보여주는 프리뷰 컴포저블들을 추가합니다.

Possibly related PRs

  • PrezelButton 구현 #25: IconSource/DrawableIcon 추상화(아이콘 타입과 렌더링)를 도입하여 PrezelListPrezelListIcon 등 아이콘 관련 코드와 직접적인 코드 수준 연관성이 있음.
🚥 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 제목은 주요 변경사항(PrezelList 컴포넌트 구현)을 명확하게 요약하고 있으며, 간결하고 구체적입니다.
Description check ✅ Passed PR 설명은 요구되는 템플릿 섹션(작업 내용, 관련 이슈, 스크린샷, 논의 내용)을 모두 포함하고 있어 완전합니다.
Linked Issues check ✅ Passed 코드 변경사항이 #71 이슈의 PrezelList 컴포넌트 구현 목표를 완벽하게 충족합니다(leading/trailing 콘텐츠, nested 상태, SMALL/REGULAR 크기 변형 포함).
Out of Scope Changes check ✅ Passed 모든 변경사항이 PrezelList 컴포넌트 구현(메인 컴포넌트, 스타일, 프리뷰)에 관련되어 있으며 범위를 벗어난 변경이 없습니다.

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

🧹 Nitpick comments (2)
Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/list/PrezelList.kt (1)

30-35: showFirstTrailingContent 네이밍과 실제 동작 의미를 맞춰주세요.

현재는 showFirstTrailingContent = false일 때만 첫 아이템 1개로 제한되고, true면 전체가 노출됩니다. 호출자 입장에서 의미를 반대로 해석하기 쉬운 API입니다. 동작을 뒤집거나(이름 유지), 파라미터명을 showAllTrailingContents/limitToFirstTrailingContent처럼 명확하게 바꾸는 쪽이 안전합니다.

예시: 의미를 드러내는 파라미터명으로 변경
-    showFirstTrailingContent: Boolean = true,
+    showAllTrailingContents: Boolean = true,
...
-    val visibleTrailingContents =
-        if (!showFirstTrailingContent) trailingContents.take(1) else trailingContents
+    val visibleTrailingContents =
+        if (showAllTrailingContents) trailingContents else trailingContents.take(1)
🤖 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/list/PrezelList.kt`
around lines 30 - 35, The parameter showFirstTrailingContent is misnamed vs its
behavior; rename it to showAllTrailingContents (or an equivalent clear name) and
update the logic in visibleTrailingContents so that when showAllTrailingContents
is true you return trailingContents, otherwise limit to
trailingContents.take(1); also update the parameter default and any call sites
that use showFirstTrailingContent to the new name to keep the API meaning clear.
Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/list/PrezelListPreview.kt (1)

57-67: prezelListTrailingIcons@Composable은 제거해도 됩니다.

이 함수는 컴포지션 상태를 읽지 않고 정적 리스트를 만드는 역할이라 일반 함수로 두는 편이 더 단순합니다.

정리 예시
-@Composable
 private fun prezelListTrailingIcons(size: PrezelListSize): ImmutableList<@Composable () -> Unit> =
     List(2) {
         `@Composable` {
             PrezelListIcon(
                 icon = IconSource(resId = PrezelIcons.Blank),
                 size = size,
             )
         }
     }.toPersistentList()
🤖 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/list/PrezelListPreview.kt`
around lines 57 - 67, Remove the unnecessary `@Composable` annotation from the
prezelListTrailingIcons function signature so it becomes a regular function that
returns ImmutableList<@Composable () -> Unit>; keep the inner lambdas (the
`@Composable` { PrezelListIcon(...) }) as-is so callers still get composable
trailing icon lambdas. Update the declaration of prezelListTrailingIcons (and
any related imports if needed) to be a plain function using PrezelListSize and
returning the same List(...).toPersistentList() result.
🤖 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/list/PrezelList.kt`:
- Around line 55-66: The Spacer with
Modifier.width(prezelListTextTrailingSpacing(size = size)) is always rendered
causing unwanted space even when showTrailingContent is false; move the Spacer
inside the same conditional as the trailing Row so both the trailing spacing and
the Row (which renders visibleTrailingContents) are only rendered when
showTrailingContent is true—i.e., wrap the Spacer and the Row together under the
showTrailingContent check (references: Spacer, prezelListTextTrailingSpacing,
showTrailingContent, Row, visibleTrailingContents).

---

Nitpick comments:
In
`@Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/list/PrezelList.kt`:
- Around line 30-35: The parameter showFirstTrailingContent is misnamed vs its
behavior; rename it to showAllTrailingContents (or an equivalent clear name) and
update the logic in visibleTrailingContents so that when showAllTrailingContents
is true you return trailingContents, otherwise limit to
trailingContents.take(1); also update the parameter default and any call sites
that use showFirstTrailingContent to the new name to keep the API meaning clear.

In
`@Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/list/PrezelListPreview.kt`:
- Around line 57-67: Remove the unnecessary `@Composable` annotation from the
prezelListTrailingIcons function signature so it becomes a regular function that
returns ImmutableList<@Composable () -> Unit>; keep the inner lambdas (the
`@Composable` { PrezelListIcon(...) }) as-is so callers still get composable
trailing icon lambdas. Update the declaration of prezelListTrailingIcons (and
any related imports if needed) to be a plain function using PrezelListSize and
returning the same List(...).toPersistentList() result.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5423a9e and ee3fe36.

📒 Files selected for processing (3)
  • Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/list/PrezelList.kt
  • Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/list/PrezelListPreview.kt
  • Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/list/PrezelListStyle.kt

`PrezelList` 컴포넌트의 가독성과 유지보수성을 높이기 위해 내부 구현을 서브 컴포저블로 분리하고 로직을 정리했습니다.

*   `PrezelListLeadingSlot`, `PrezelListTitle`, `PrezelListTrailingSlot` 비공개 컴포너트 추출
*   `visibleTrailingContents` 생성 시 `toImmutableList()`를 사용하여 타입 안정성 확보
*   트레일링 콘텐츠가 없을 경우 불필요한 `Spacer` 및 `Row`가 생성되지 않도록 조건부 렌더링 최적화
*   불필요한 파라미터 명칭 생략 및 코드 스타일 정리
`PrezelList` 컴포넌트에서 리스트 끝에 표시되는 아이콘(Trailing Content)의 전달 방식을 리스트 형태에서 단일 컴포저블 람다 방식으로 변경하여 유연성을 높였습니다.

*   `PrezelList` 및 `PrezelListTrailingSlot`의 `trailingContents: ImmutableList<@composable () -> Unit>` 파라미터를 `trailingContent: @composable () -> Unit`으로 변경
*   내부적으로 `ImmutableList`를 처리하던 로직을 제거하고 호출부에서 UI 구성을 제어하도록 수정
*   `PrezelListPreview.kt` 내 미리보기 코드를 변경된 구조에 맞게 업데이트
*   불필요한 `kotlinx.collections.immutable` 관련 임포트 제거
`PrezelList` 컴포넌트에서 가시성 제어를 위한 Boolean 파라미터들을 제거하고, 람다의 null 여부에 따라 콘텐츠를 표시하도록 리팩토링했습니다.

*   `PrezelList`: `showLeadingContent`, `showTrailingContent`, `showFirstTrailingContent` 파라미터 제거
*   `leadingContent` 및 `trailingContent` 타입을 옵셔널(`@Composable () -> Unit?`)로 변경하여 null이 아닐 경우에만 렌더링하도록 수정
*   `PrezelListLeadingSlot`, `PrezelListTrailingSlot` 내부 로직을 null 체크 방식으로 변경
*   `PrezelListPreview`: 파라미터 변경에 맞춰 프리뷰 코드 수정 및 간소화
`PrezelList` 컴포넌트의 내부 가독성을 높이고 불필요한 레이아웃 구조를 정리했습니다.

*   `PrezelListLeading` 및 `PrezelListTrailing` 내부의 `let` 확장 함수 사용을 조기 리턴(Early Return) 방식으로 변경하여 코드 가독성을 개선했습니다.
*   `PrezelListTrailing`에서 불필요하게 사용되던 `it()` 호출을 명시적인 `trailingContent()` 호출로 수정했습니다.
*   프리뷰 코드에서 사용하지 않는 `PrezelListSizeCases` 함수와 `HorizontalDivider`를 제거하고, `PrezelListPreviewBySize`를 사용하도록 구조를 단순화했습니다.
*   불필요한 `Column` 및 `import` 문을 정리했습니다.
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

🧹 Nitpick comments (1)
Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/list/PrezelList.kt (1)

82-102: 프리뷰를 전용 파일로 모으면 컴포넌트 파일 응집도가 더 좋아집니다.

현재 구조도 동작에는 문제 없지만, 이미 프리뷰 전용 파일이 있는 구조라면 이 프리뷰 엔트리들도 그쪽으로 모으는 편이 유지보수에 유리합니다.

🤖 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/list/PrezelList.kt`
around lines 82 - 102, Move the two preview composables (PrezelListSmallPreview
and PrezelListRegularPreview) out of the component file and into the existing
preview-only file to improve cohesion; locate the Preview composables that call
PrezelListPreviewBySize and reference PrezelListSize, cut them from
PrezelList.kt and paste them into the dedicated preview file (keeping the
`@ThemePreview/`@Composable annotations and imports), then run a build to ensure
package/imports are correct and remove any now-unused imports from
PrezelList.kt.
🤖 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/list/PrezelList.kt`:
- Around line 56-62: The Text composable rendering the title in PrezelList (the
Text call using title, Modifier.weight(1f), and style =
prezelListTextStyle(size)) only sets maxLines = 1 and should also specify an
overflow behavior so long titles show an ellipsis; update the Text invocation to
include overflow = TextOverflow.Ellipsis (and ensure the TextOverflow import is
added) so truncated titles remain readable.

---

Nitpick comments:
In
`@Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/list/PrezelList.kt`:
- Around line 82-102: Move the two preview composables (PrezelListSmallPreview
and PrezelListRegularPreview) out of the component file and into the existing
preview-only file to improve cohesion; locate the Preview composables that call
PrezelListPreviewBySize and reference PrezelListSize, cut them from
PrezelList.kt and paste them into the dedicated preview file (keeping the
`@ThemePreview/`@Composable annotations and imports), then run a build to ensure
package/imports are correct and remove any now-unused imports from
PrezelList.kt.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ee3fe36 and 0f6da17.

📒 Files selected for processing (2)
  • Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/list/PrezelList.kt
  • Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/list/PrezelListPreview.kt
🚧 Files skipped from review as they are similar to previous changes (1)
  • Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/list/PrezelListPreview.kt

Comment on lines +56 to +62
Text(
text = title,
modifier = Modifier.weight(1f),
color = LocalContentColor.current,
maxLines = 1,
style = prezelListTextStyle(size),
)
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

긴 제목이 잘릴 때 가독성이 떨어집니다.

maxLines = 1만 설정되어 있어 긴 텍스트가 잘릴 때 의미 전달이 약해질 수 있습니다. 말줄임표를 추가하는 편이 안전합니다.

수정 제안
 import androidx.compose.material3.Text
+import androidx.compose.ui.text.style.TextOverflow
@@
     Text(
         text = title,
         modifier = Modifier.weight(1f),
         color = LocalContentColor.current,
         maxLines = 1,
+        overflow = TextOverflow.Ellipsis,
         style = prezelListTextStyle(size),
     )
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Text(
text = title,
modifier = Modifier.weight(1f),
color = LocalContentColor.current,
maxLines = 1,
style = prezelListTextStyle(size),
)
import androidx.compose.material3.Text
import androidx.compose.ui.text.style.TextOverflow
Text(
text = title,
modifier = Modifier.weight(1f),
color = LocalContentColor.current,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
style = prezelListTextStyle(size),
)
🤖 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/list/PrezelList.kt`
around lines 56 - 62, The Text composable rendering the title in PrezelList (the
Text call using title, Modifier.weight(1f), and style =
prezelListTextStyle(size)) only sets maxLines = 1 and should also specify an
overflow behavior so long titles show an ellipsis; update the Text invocation to
include overflow = TextOverflow.Ellipsis (and ensure the TextOverflow import is
added) so truncated titles remain readable.

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.

PrezelList 구현

1 participant