Skip to content

[fix] 둘러보기 selectedIndex 오류 수정 #95

Merged
maylh merged 1 commit intodevelopfrom
fix/#94/index
Aug 30, 2025
Merged

[fix] 둘러보기 selectedIndex 오류 수정 #95
maylh merged 1 commit intodevelopfrom
fix/#94/index

Conversation

@maylh
Copy link
Collaborator

@maylh maylh commented Aug 30, 2025

🛰️ 관련 이슈


✨ 주요 변경 사항

1️⃣


🔍 테스트 방법 / 체크리스트

  1. (테스트 방법 1)
  2. (테스트 방법 2)
  • 테스트 항목 1 완료
  • 테스트 항목 2 완료
  • (필요하다면 더 추가)

🗯️ PR 포인트


🚀 알게된 점


📖 참고 자료 (선택)

Summary by CodeRabbit

  • 신기능/개선
    • 디스커버에서 플레이리스트 선택 시 주소(URL)가 즉시 동기화되어 뒤로가기·공유·새로고침 시 동일한 상태로 접근 가능합니다.
    • URL로 진입한 플레이리스트가 목록 맨 앞으로 정렬되며 중복이 제거되었습니다.
    • 초기 진입 때 URL과 선택 인덱스가 일치하도록 동기화되고, 끝에 도달하면 다음 페이지를 불러오는 동작은 유지됩니다.
  • 기타
    • 불필요한 콘솔 로그 최소화 및 주석 추가로 개발 편의성과 로그 가독성을 개선했습니다.

@maylh maylh requested a review from hansololiviakim as a code owner August 30, 2025 05:08
@gemini-code-assist
Copy link

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai
Copy link

coderabbitai bot commented Aug 30, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

라우터 동기화를 포함한 Discover 페이지의 플레이리스트 인덱스/선택 로직이 재구성되었고, 선택 시 URL이 갱신되도록 navigate가 추가되었습니다. SwipeCarousel에는 selectedIndex 디버그 로그가 추가되었고, ChatBottomSheet의 불필요한 콘솔 로그가 제거되었습니다. Cd 컴포넌트에는 주석 한 줄이 추가되었습니다.

Changes

Cohort / File(s) Summary
Discover 인덱스/URL 동기화
src/pages/discover/index.tsx
URL 파생 플레이리스트를 중복 없이 선두로 배치하는 계산 추가, getPlaylistIndexById 도입, 초기 선택 로직을 인덱스 기반으로 변경, 내부 인덱스 상태 도입, 선택 시 URL 동기화(navigate) 및 페이지네이션 트리거 유지, 의존성 정리
스와이프 캐러셀 로깅
src/features/swipe/ui/SwipeCarousel.tsx
onSelect 내 selectedIndex 콘솔 로그 추가
채팅 로그 정리
src/widgets/chat/ChatBottomSheet.tsx
console.log(allMessages) 제거
Cd 주석 추가
src/shared/ui/Cd.tsx
스티커 이미지에 crossOrigin 관련 주석 라인 추가(비기능 변경)

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User as User
  participant Discover as Discover Page
  participant Router as Router
  participant Swipe as SwipeCarousel

  Note over Discover,Router: 초기 로드
  Discover->>Discover: playlistsData 계산 (URL 파생 항목 선두 배치, 중복 방지)
  Discover->>Discover: getPlaylistIndexById(id)
  Discover->>Discover: currentIndex 설정 및 초기 플레이리스트 선택

  User->>Swipe: 아이템 선택/스와이프
  Swipe-->>Discover: onSelect(selectedIndex)
  Discover->>Discover: setCurrentIndex(selectedIndex)
  Discover->>Discover: setSelectedPlaylist(by index)
  alt URL과 선택 불일치
    Discover->>Router: navigate(/discover/:playlistId)
  end
  opt 마지막 아이템 선택
    Discover->>Discover: fetchNextPage()
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

Possibly related PRs

Suggested labels

HIGH

Suggested reviewers

  • hansololiviakim

Poem

새로 고른 트랙에 콩콩, 발끝 춤을 추네 🎵
인덱스 맞춰 찰칵, URL도 함께 가네
로그는 살짝 사라지고, 캐러셀은 빙글빙글
토끼는 귀를 세워, 다음 페이지로 핫!
디스커버 길 위에, 노랫바람 솔솔 🌬️


📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between ad06a47 and a49e9d1.

📒 Files selected for processing (4)
  • src/features/swipe/ui/SwipeCarousel.tsx (1 hunks)
  • src/pages/discover/index.tsx (5 hunks)
  • src/shared/ui/Cd.tsx (1 hunks)
  • src/widgets/chat/ChatBottomSheet.tsx (0 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/#94/index

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@maylh maylh changed the title fix: 둘러보기 selectedIndex 오류 수정 (#94) [fix] 둘러보기 selectedIndex 오류 수정 Aug 30, 2025
@hansololiviakim hansololiviakim added the CRITICAL 즉시 처리해야 하는 최고 우선순위 label Aug 30, 2025
@github-actions
Copy link

🎵 Storybook Link 🎵
🔗 https://689dbb45f8d09aea7832eeb1-gskspeejfk.chromatic.com/

@maylh maylh merged commit 977a9b4 into develop Aug 30, 2025
3 of 4 checks passed
@maylh maylh deleted the fix/#94/index branch August 30, 2025 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CRITICAL 즉시 처리해야 하는 최고 우선순위

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[fix] 둘러보기 selectedIndex 오류 수정

2 participants