Conversation
- ButtonHTMLAttributes 확장으로 type, aria-*, data-* 등 자동 지원 - 하드코딩 색상을 테마 시스템(theme.colors)으로 교체 - transient props($animated, $width) 적용으로 DOM 전달 경고 제거
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning
|
| Cohort / File(s) | Summary |
|---|---|
문서 추가 frontend/docs/features/components/Button.md |
공유 Button 컴포넌트 문서 추가: 네이티브 버튼 속성 호환, width 및 animated props 설명, 사용 예시 및 테마 스타일링 토큰/레이아웃 값 문서화. |
컴포넌트 구현 리팩토링 frontend/src/components/common/Button/Button.tsx |
ButtonProps가 React.ButtonHTMLAttributes<HTMLButtonElement>를 확장하도록 변경. children, type, onClick, disabled, className 등 명시적 선언 제거. 트랜지언트 스타일 props ($animated, $width) 사용, hover/active 스타일은 비활성화 상태 제외 조건으로 적용, pulse 애니메이션은 스케일만 변경. type 기본값 'button', 나머지 네이티브 props는 ...rest로 전달. |
Sequence Diagram(s)
(해당 변경은 문서 추가 및 컴포넌트 내부 리팩토링으로, 복잡한 다중 컴포넌트 시퀀스 흐름 시각화 필요 없음.)
예상 코드 검토 난이도
🎯 3 (중간) | ⏱️ ~20분
관련 가능성이 있는 PR
- [feature] 메인페이지 동아리/홍보 필터 컴포넌트를 제작한다 #1129: 동일 파일(
frontend/src/components/common/Button/Button.tsx)의 props 선언 및 전달 로직 변경과 직접적으로 코드 수준에서 연관됨.
제안된 검토자
- lepitaaar
- oesnuj
- suhyun113
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | PR 제목은 Button 컴포넌트의 확장성 개선이라는 주요 변경사항을 명확하게 요약하고 있으며, 변경된 핵심 내용과 일치합니다. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches
📝 Generate docstrings
- Create stacked PR
- Commit on current branch
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Commit unit tests in branch
refactor/#1391-button-extensibility-MOA-788
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 @coderabbitai help to get the list of available commands and usage tips.
🎨 UI 변경사항을 확인해주세요
7개 스토리 변경 · 전체 56개 스토리 · 22개 컴포넌트 |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@frontend/src/components/common/Button/Button.tsx`:
- Around line 51-57: The Button component currently relies on the browser
default type (which is "submit") causing unintended form submits; update the
Button component (and ButtonProps if needed) to default the type prop to
"button" and ensure it is passed into <StyledButton $animated={animated}
$width={width} {...rest}> (e.g., set type = "button" in the destructured props
or merge a defaulted type into the spread) so callers can still override with
type="submit" when desired; reference the Button component, ButtonProps, and
StyledButton to locate and change the prop default.
- Around line 8-12: The pulse keyframes animation should be removed and replaced
by Framer Motion props inside the Button component's JSX: import motion from
'framer-motion' if not already, change the root element to motion.button, and
replace any CSS-based pulse/hover/active logic (the pulse symbol and the
previous hover/active styles) with whileHover={{ scale: 1.05 }} and whileTap={{
scale: 0.98 }} (adjust values to match existing visuals). Ensure you also remove
the keyframes declaration (pulse) and any CSS animation references so the
component uses only motion.button with whileHover/whileTap for consistent Framer
Motion behavior.
- Line 3: The file references the React namespace in the ButtonProps declaration
(extends React.ButtonHTMLAttributes<HTMLButtonElement>) but doesn't import
React, causing "Cannot find namespace 'React'"; fix by adding an explicit import
from 'react' and/or using a type-only import such as importing
ButtonHTMLAttributes (e.g. import React from 'react' or import type {
ButtonHTMLAttributes } from 'react') and update the ButtonProps declaration
accordingly so the React type is resolved (refer to the ButtonProps symbol and
its use of React.ButtonHTMLAttributes<HTMLButtonElement>).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c71a5bb1-431a-445f-9f7c-a430889f2a93
📒 Files selected for processing (2)
frontend/docs/features/components/Button.mdfrontend/src/components/common/Button/Button.tsx
폼 내부에서 의도치 않은 submit 방지
#️⃣연관된 이슈
📝작업 내용
ButtonHTMLAttributes<HTMLButtonElement>확장으로type,aria-*,data-*등 모든 HTML 버튼 속성 자동 지원#3a3a3a,#ffffff)을 테마 시스템(theme.colors)으로 교체$animated,$width) 적용으로 DOM 전달 경고 제거중점적으로 리뷰받고 싶은 부분(선택)
논의하고 싶은 부분(선택)
🫡 참고사항
Summary by CodeRabbit
릴리스 노트
새 기능
width및animated속성 추가로 너비 커스터마이징과 호버/클릭 애니메이션 가능.type이button으로 설정됨.개선 사항
문서