Skip to content

[REFACTOR] 아코디언 컴포넌트 아이콘 위치 조정 및 크기 조정#139

Merged
JangYEhoon00 merged 4 commits intomainfrom
refactor/#138-accordian
Mar 10, 2026
Merged

[REFACTOR] 아코디언 컴포넌트 아이콘 위치 조정 및 크기 조정#139
JangYEhoon00 merged 4 commits intomainfrom
refactor/#138-accordian

Conversation

@JangYEhoon00
Copy link
Copy Markdown
Collaborator

@JangYEhoon00 JangYEhoon00 commented Mar 4, 2026

🔥 연관 이슈

🚀 작업 내용

2026-03-05.1.01.38.mov

iconSIze, iconAlign 프롭스를 통해서 아이콘의 크기 조절 및 아이콘의 위치를 조정할 수 있습니다!

🤔 고민했던 내용

self-align을 사용했는데 이 요소를 사용하는 게 나았을지 className 을 프롭스로 전달하여 아이콘의 위치를 보다 더 자유롭게 설정을 할 수 있게 해야 할지 고민했습니다. 컴포넌트에서 사용된다면 보다 엄격한 것이 레이아웃을 해치지 않을 것으로 판단하여 self-align 요소를 사용했습니다.

💬 리뷰 중점사항

Summary by CodeRabbit

  • 새로운 기능
    • Accordion 아이콘 커스터마이징 추가
      • 아이콘 크기 조정 기능(개별 항목 또는 전체 Accordion에 적용)
      • 아이콘 정렬 선택 가능(시작/중앙/끝)
      • 아이콘에 대한 커스텀 스타일 적용 지원
  • 문서/예제
    • 새로운 데모 스토리 추가로 아이콘 크기·정렬 옵션 사용 예시 제공

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 4, 2026

Walkthrough

Accordion 루트와 아이템에 아이콘 크기(iconSize)와 수직 정렬(iconAlign) 제어가 추가되고, 이를 보여주는 두 가지 스토리(IconSizeAccordion, IconAlignAccordion)가 추가되었습니다.

Changes

Cohort / File(s) Summary
Accordion 컴포넌트 변경
src/shared/ui/Accordion/Accordion.tsx, src/shared/ui/Accordion/Accordion.context.tsx
AccordionRooticonSize?: number 컨텍스트 전달 추가. AccordionItemiconSize?: number, `iconAlign?: 'start'
스토리 추가
src/shared/ui/Accordion/Accordion.stories.tsx
IconSizeAccordion(단일 아이템, iconSize={12}) 및 IconAlignAccordion(여러 아이템, iconAlign에 따라 start/center/end 예시) 스토리 추가. 기존 스토리 로직은 변경 없음.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • yougyung
  • ujinsim
🚥 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 제목은 '[REFACTOR] 아코디언 컴포넌트 아이콘 위치 조정 및 크기 조정'으로 변경사항의 핵심을 정확하게 반영하고 있습니다.
Description check ✅ Passed PR 설명은 템플릿 구조를 따르고 있으며 연관 이슈, 작업 내용, 고민했던 내용, 리뷰 중점사항이 모두 포함되어 있습니다.
Linked Issues check ✅ Passed PR의 코드 변경사항이 연결된 이슈 #138의 요구사항을 충족합니다. iconSize와 iconAlign 프롭스 추가로 아이콘 크기 조절과 위치 조절이 구현되었습니다.
Out of Scope Changes check ✅ Passed 모든 변경사항이 연결된 이슈 #138의 범위 내에 있으며, 아코디언 컴포넌트의 아이콘 기능 추가와 관련된 변경만 포함되어 있습니다.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/#138-accordian

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 4, 2026

Update: 2026년 03월 09일 23시 08분 33초
Storybook 미리보기: https://677a9a76c58a295e9421d3ef-vbtdqhwvrw.chromatic.com/

Copy link
Copy Markdown

@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 `@src/shared/ui/Accordion/Accordion.tsx`:
- Around line 86-89: The prop name and comment for iconClassName in the
Accordion component are misleading because the prop is applied to the motion.div
wrapper around the arrow, not the SVG itself; update the API by renaming
iconClassName to iconWrapperClassName (and update its JSDoc) wherever
defined/used in Accordion (props interface and usages around the motion.div
rendering the arrow, e.g., the code referenced near lines 165-173), or
alternatively add a separate prop (e.g., iconSvgClassName) so callers can style
the SVG independently; change the prop name/introduce the new prop and update
all references and documentation/comments in the Accordion component and its
consumers to keep the API consistent.
- Around line 124-125: The prop iconSize passed into the Accordion component is
not validated so negative/NaN values flow through to Icon and become invalid CSS
sizes; normalize and validate iconSize inside the Accordion (where iconSize
default is defined and where it's forwarded to Icon around the existing usage at
line 175) by coercing to a Number, ensuring it is a finite positive value (e.g.,
Number(iconSize)), and falling back to the default (20) or clamping to a
sensible minimum if validation fails before passing it to the Icon component;
also ensure the Accordion prop type reflects a numeric value so callers are
guided to pass valid numbers.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: cc4dc2ec-bd6f-4515-9433-1c2ca4fb2503

📥 Commits

Reviewing files that changed from the base of the PR and between bb6c2f7 and ce48dc3.

📒 Files selected for processing (2)
  • src/shared/ui/Accordion/Accordion.stories.tsx
  • src/shared/ui/Accordion/Accordion.tsx

Copy link
Copy Markdown
Contributor

@keemsebin keemsebin left a comment

Choose a reason for hiding this comment

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

수고하셨습니다~! 피그마 icon이랑 아코디언 아이콘이랑 뭔가 미묘하게 다른데 확인 부탁드립니다~!

);
},
};
export const IconSizeAccordion: Story = {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

iconsize를 컨트롤할수있는 속성이 있음 좋을 것 같네용

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

510e296 수정완료입니당

Comment on lines +167 to +171
{
'self-start': iconAlign === 'top',
'self-center': iconAlign === 'center',
'self-end': iconAlign === 'bottom',
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

요 부분만 따로 객체형식으로 빼도 좋을 것 같네요~

start,center,end 라는 기존 네이밍을 따라가는건 어떠신가요?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

3ca1cd7 수정했습니다!

아이콘 사이즈를 상위 컴포넌트에서 조절이 가능합니다.
Copy link
Copy Markdown
Collaborator

@ujinsim ujinsim left a comment

Choose a reason for hiding this comment

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

고생하셨습니다!!

Copy link
Copy Markdown

@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

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

Inline comments:
In `@src/shared/ui/Accordion/Accordion.tsx`:
- Around line 99-103: The JSDoc `@default` for the iconSize prop is incorrect:
update the JSDoc comment for iconSize in Accordion.tsx to match the
implementation (iconSize ?? context.iconSize ?? 13.5) by changing `@default` 20 to
`@default` 13.5 so the documented default aligns with the actual default used by
the iconSize prop.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: b475fd3f-c46b-4872-986e-b21972790277

📥 Commits

Reviewing files that changed from the base of the PR and between ce48dc3 and 3066185.

📒 Files selected for processing (3)
  • src/shared/ui/Accordion/Accordion.context.tsx
  • src/shared/ui/Accordion/Accordion.stories.tsx
  • src/shared/ui/Accordion/Accordion.tsx

Comment on lines +99 to +103
/**
* icon size
* @default 20
*/
iconSize?: number;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

JSDoc의 @default 값이 실제 기본값과 불일치합니다.

JSDoc에서 @default 20으로 명시되어 있지만, 실제 코드(Line 146)에서는 iconSize ?? context.iconSize ?? 13.5로 기본값이 13.5입니다. 문서와 구현이 일치하도록 수정이 필요합니다.

📝 수정 제안
   /**
    * icon size
-   * `@default` 20
+   * `@default` 13.5
    */
   iconSize?: number;
📝 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
/**
* icon size
* @default 20
*/
iconSize?: number;
/**
* icon size
* `@default` 13.5
*/
iconSize?: number;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/shared/ui/Accordion/Accordion.tsx` around lines 99 - 103, The JSDoc
`@default` for the iconSize prop is incorrect: update the JSDoc comment for
iconSize in Accordion.tsx to match the implementation (iconSize ??
context.iconSize ?? 13.5) by changing `@default` 20 to `@default` 13.5 so the
documented default aligns with the actual default used by the iconSize prop.

@JangYEhoon00 JangYEhoon00 merged commit e4861c2 into main Mar 10, 2026
7 checks passed
@JangYEhoon00 JangYEhoon00 deleted the refactor/#138-accordian branch March 10, 2026 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[REFACTOR] 아코디언 컴포넌트 수정

3 participants