Conversation
디자인 시스템의 리스트 컴포넌트에서 공통으로 사용할 `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) 상세 프리뷰를 추가했습니다.
Walkthrough세 개의 새로운 파일을 추가하여 PrezelList 컴포넌트를 구현합니다. PrezelList.kt에서는 제목, 선택적 리딩 콘텐츠, 트레일링 콘텐츠를 포함하는 가로 방향 목록 행을 렌더링하는 컴포저블을 정의합니다. PrezelListStyle.kt에서는 SMALL과 REGULAR 두 가지 크기 변형을 지정하는 PrezelListSize 열거형과 아이콘, 패딩, 텍스트 스타일, 간격을 관리하는 내부 컴포저블들을 제공합니다. PrezelListPreview.kt에서는 다양한 구성(중첩, 리딩 표시, 트레일링 표시)을 보여주는 미리보기 컴포저블들을 추가합니다. Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ 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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (3)
Prezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/list/PrezelList.ktPrezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/list/PrezelListPreview.ktPrezel/core/designsystem/src/main/java/com/team/prezel/core/designsystem/component/list/PrezelListStyle.kt
📌 작업 내용
PrezelList 컴포넌트 구현
🧩 관련 이슈
📸 스크린샷
📢 논의하고 싶은 내용
Summary by CodeRabbit
릴리스 노트