-
Notifications
You must be signed in to change notification settings - Fork 1
♻️Refactor : 행사 날짜 - 당일로 포맷팅 #143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,11 +20,11 @@ export default function PopupSet({ text, onClose }: PopupSetProps) { | |
|
|
||
| return ( | ||
| <> | ||
| <Overlay /> | ||
| <Overlay onClick={handleClose} /> | ||
| {/* 중앙 고정 */} | ||
| <div | ||
| className={cn( | ||
| 'fixed inset-0 z-[100]', | ||
| 'fixed inset-0 z-[10000]', | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion | 🟠 Major z-index 값이 과도하게 높습니다. z-index를 100에서 10000으로 변경한 것은 Overlay 컴포넌트의 9999와 일관성을 유지하기 위한 것으로 보이지만, 두 값 모두 불필요하게 높습니다. Overlay(9999)와 PopupSet(10000)의 1 차이는 의미가 있지만, 전체적인 z-index 스케일을 낮추는 것을 권장합니다 (예: Overlay 100, PopupSet 101). 🤖 Prompt for AI Agents |
||
| 'flex items-center justify-center', | ||
| )} | ||
| > | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,7 +9,7 @@ const Overlay = ({ onClick, opacity = 30, className }: OverlayProps) => { | |
| <div | ||
| onClick={onClick} | ||
| className={` | ||
| fixed inset-0 z-[99] | ||
| fixed inset-0 z-[9999] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainz-index 값이 과도하게 높습니다. z-index를 99에서 9999로 변경하는 것은 100배 증가이며, 이는 z-index 관리 전략에 문제가 있을 수 있음을 시사합니다. 이러한 높은 값은 다음과 같은 문제를 야기할 수 있습니다:
100~200 범위의 값으로도 충분할 가능성이 높으니, 실제로 이렇게 높은 값이 필요한지 검토해주세요. 다음 스크립트로 프로젝트 전체의 z-index 사용 현황을 확인할 수 있습니다: 🏁 Script executed: #!/bin/bash
# z-index 사용 패턴 분석
# Tailwind z-index 클래스 검색
rg -nP 'z-\[?\d+\]?' --type ts --type tsx -C2
# CSS 파일에서 z-index 검색
rg -nP 'z-index:\s*\d+' --type css -C2Length of output: 27 z-index 사용 현황을 정확히 파악하기 위해 수정된 스크립트를 실행하겠습니다. 🏁 Script executed: #!/bin/bash
# z-index 사용 패턴 분석 (수정)
# Tailwind z-index 클래스 검색 (ts, tsx, jsx 파일)
echo "=== Tailwind z-index 클래스 (z-[숫자]) ==="
rg -nP 'z-\[\d+\]' -g '*.ts' -g '*.tsx' -g '*.jsx' -C2
# 대체 방식: z- 패턴 검색
echo "=== Tailwind z- 패턴 ==="
rg -n 'z-\d+' -g '*.ts' -g '*.tsx' -g '*.jsx' -C2
# CSS 파일에서 z-index 검색
echo "=== CSS z-index ==="
rg -nP 'z-index' -g '*.css' -g '*.scss' -C2
# Overlay.tsx 파일 내용 확인
echo "=== Overlay.tsx 파일 확인 ==="
fd -t f 'Overlay.tsx' -x cat {}Length of output: 8186 z-index 관리 체계 개선이 필수입니다. 더 심각한 우선순위 문제도 발견되었습니다. 코드베이스 검토 결과, 리뷰 우려가 타당합니다:
수정 필요 사항:
🤖 Prompt for AI Agents |
||
| transition-opacity duration-300 | ||
| ${className ?? ''} | ||
| `} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
미사용 변수: startOfToday가 선언되었으나 사용되지 않습니다.
startOfToday변수가 27-32라인에서 선언되었지만, 92-93라인의 관련 코드가 주석 처리되어 실제로는 사용되지 않습니다. 이는 리팩토링이 완료되지 않았음을 시사합니다.다음 중 하나를 선택하세요:
startOfToday를 사용하는 기능을 구현하고 92-93라인의 주석을 해제startOfToday변수 선언을 제거주석 처리된 코드는 향후 구현 예정인 기능인가요? 그렇다면 TODO 주석을 추가하거나 이슈를 생성하는 것을 권장합니다.
이 기능 구현을 도와드릴까요? 또는 추적을 위한 이슈를 생성해드릴까요?
Also applies to: 92-93
🤖 Prompt for AI Agents
성능 이슈: 매 렌더링마다 날짜 객체가 재생성됩니다.
today와startOfToday가 컴포넌트 본문 내에서 선언되어 매 렌더링마다 새로운 Date 객체가 생성됩니다. 이는 불필요한 메모리 할당과 성능 저하를 야기합니다.다음과 같이 수정하여 최적화하세요:
...calendarProps }: DatePickerProps) { const [open, setOpen] = useState(false); + const [today] = useState(() => new Date()); + const [startOfToday] = useState(() => { + const t = new Date(); + return new Date(t.getFullYear(), t.getMonth(), t.getDate()); + }); - const today = new Date(); - const startOfToday = new Date( - today.getFullYear(), - today.getMonth(), - today.getDate(), - ); const [innerDate, setInnerDate] = useState<Date | undefined>(또는 컴포넌트 외부에서 한 번만 계산하도록 이동하세요.
📝 Committable suggestion
🤖 Prompt for AI Agents