Skip to content

Conversation

@hyesngy
Copy link
Member

@hyesngy hyesngy commented Dec 1, 2025

✨ 작업 개요

코드 리팩토링 및 일부 파일 이동

📌 관련 이슈

✅ 작업 내용

코드 리팩토링 및 일부 파일 이동

📷 UI 스크린샷 (해당 시)

💬 기타 사항

Summary by CodeRabbit

Release Notes

  • Chores
    • 내부 컴포넌트 구조를 정리하였습니다. 사용자에게 영향을 주는 변경 사항은 없습니다.

✏️ Tip: You can customize this high-level summary in your review settings.

@hyesngy hyesngy self-assigned this Dec 1, 2025
@hyesngy hyesngy requested a review from a team as a code owner December 1, 2025 03:56
@hyesngy hyesngy linked an issue Dec 1, 2025 that may be closed by this pull request
1 task
@vercel
Copy link

vercel bot commented Dec 1, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
gotit Ready Ready Preview Comment Dec 1, 2025 3:56am

@coderabbitai
Copy link

coderabbitai bot commented Dec 1, 2025

개요

이 PR은 프로젝트의 UI 컴포넌트 구조를 재정렬하고 문서 주석을 제거하는 리팩토링 작업입니다. SortDropdown과 GlassButton 컴포넌트의 임포트 경로를 새로운 디렉토리 구조(dropdowns/, buttons/)로 업데이트하고, 여러 파일의 설명 주석을 제거했습니다.

변경 사항

코호트 / 파일 변경 요약
UI 컴포넌트 임포트 경로 업데이트
src/app/dashboard/components/ScrapSection.tsx, src/app/search/components/SearchResultsSection.tsx
SortDropdown 임포트 경로를 @/components/ui/SortDropdown에서 @/components/ui/dropdowns/SortDropdown로 변경
UI 버튼 컴포넌트 임포트 경로 업데이트
src/components/layout/header-parts/LoginButton.tsx, src/components/layout/header-parts/ProfileDropdown.tsx
GlassButton 임포트 경로를 @/components/ui/GlassButton에서 @/components/ui/buttons/GlassButton으로 변경
주석 제거
src/config/categories.ts, src/constants/theme.ts, src/contexts/auth/index.tsx, src/lib/bookmarks.ts
설명 주석, 섹션 헤더, JSDoc 주석 제거; 함수 서명 및 동작 변화 없음

코드 리뷰 예상 난이도

🎯 1 (Trivial) | ⏱️ ~5분

  • 모든 변경사항이 임포트 경로 업데이트 및 주석 제거로 구성되어 있으며, 함수 로직이나 컴포넌트 동작에 영향을 주지 않습니다.
  • 파일별로 검증이 필요하지만, 각 변경의 범위가 명확하고 제한적입니다.

관련 가능성 있는 PR

제안 레이블

🧹 Refactor

🐰 폴더 정리하는 날, 토끼가 왔어요
컴포넌트는 제 자리 찾고,
주석 정리되니 코드는 깔끔해요
UI는 버튼과 드롭다운이 손잡고,
구조 정렬된 정원에 행운을 심어요 🌱

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목이 실제 변경사항과 일치합니다. 코드 리팩토링과 파일 이동이 정확히 반영되어 있습니다.
Linked Issues check ✅ Passed PR이 연결된 이슈 #95의 코드 리팩토링 목표를 충족합니다. 임포트 경로 업데이트, 주석 정리 등의 리팩토링 작업이 완료되었습니다.
Out of Scope Changes check ✅ Passed 모든 변경사항이 코드 리팩토링과 파일 구조 개선 범위 내에 있으며, 기능적 변화는 없습니다.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/95

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

@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: 0

🧹 Nitpick comments (1)
src/lib/bookmarks.ts (1)

31-43: localStorage 에러 처리 추가 권장

toggleBookmark() 함수에서 localStorage.setItem() 호출 시 에러 처리가 없습니다. 대조적으로 getBookmarks() 함수는 try-catch로 localStorage 접근 에러를 처리합니다.

일관성 유지와 SSR 환경이나 저장소 할당량 초과 상황에서의 안정성을 위해 에러 처리를 추가하길 권장합니다.

 export function toggleBookmark(id: number): boolean {
 	const bookmarks = new Set(getBookmarks());
 
 	if (bookmarks.has(id)) {
 		bookmarks.delete(id);
 	} else {
 		bookmarks.add(id);
 	}
 
-	localStorage.setItem(STORAGE_KEY, JSON.stringify([...bookmarks]));
+	try {
+		localStorage.setItem(STORAGE_KEY, JSON.stringify([...bookmarks]));
+	} catch {
+		// localStorage 접근 실패 - 상태는 메모리에서만 유지됨
+		return bookmarks.has(id);
+	}
 
 	return bookmarks.has(id);
 }

동일하게 clearBookmarks() 함수에도 에러 처리를 고려하시기 바랍니다.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e0550bb and 1e5eb3f.

📒 Files selected for processing (8)
  • src/app/dashboard/components/ScrapSection.tsx (1 hunks)
  • src/app/search/components/SearchResultsSection.tsx (1 hunks)
  • src/components/layout/header-parts/LoginButton.tsx (1 hunks)
  • src/components/layout/header-parts/ProfileDropdown.tsx (1 hunks)
  • src/config/categories.ts (0 hunks)
  • src/constants/theme.ts (0 hunks)
  • src/contexts/auth/index.tsx (0 hunks)
  • src/lib/bookmarks.ts (1 hunks)
💤 Files with no reviewable changes (3)
  • src/config/categories.ts
  • src/contexts/auth/index.tsx
  • src/constants/theme.ts
🔇 Additional comments (5)
src/lib/bookmarks.ts (1)

2-3: 헤더 주석 정리 — 간결하고 명확함

헤더 주석을 간소화하여 현재 목적에 집중하도록 개선했습니다.

src/app/search/components/SearchResultsSection.tsx (1)

7-7: 일관된 리팩토링 적용 확인

SortDropdown import 경로가 ScrapSection.tsx와 동일하게 업데이트되어 코드베이스 전체에서 일관성이 유지되고 있습니다.

src/components/layout/header-parts/LoginButton.tsx (1)

1-1: 일관된 버튼 컴포넌트 경로 업데이트 확인

GlassButton import 경로가 ProfileDropdown.tsx와 일관되게 업데이트되었습니다. 프로젝트 전체에서 통일된 구조를 유지하고 있습니다.

src/app/dashboard/components/ScrapSection.tsx (1)

11-11: Import path refactoring successfully completed

Moving SortDropdown to the dropdowns subdirectory improves component organization. Verification confirms the old import path has been fully removed and the new path is consistently used across all files that reference this component.

src/components/layout/header-parts/ProfileDropdown.tsx (1)

6-6: 버튼 컴포넌트 구조 개선 확인 완료

GlassButton을 buttons 하위 디렉토리로 이동하여 컴포넌트를 타입별로 그룹화한 점이 좋습니다. 전체 import 경로 검증 결과, 모든 import가 새로운 경로(@/components/ui/buttons/GlassButton)로 올바르게 업데이트되었습니다. 이전 경로는 남아있지 않으며, ProfileDropdown.tsx와 LoginButton.tsx 두 파일에서 일관되게 새 경로를 사용 중입니다.

@hyesngy hyesngy merged commit 41ebf51 into develop Dec 1, 2025
4 checks passed
@hyesngy hyesngy deleted the refactor/95 branch December 1, 2025 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Refactor] 코드 리팩토링

2 participants