Skip to content

[fix] discovery 셔플 이슈 해결 #87

Merged
maylh merged 2 commits intodevelopfrom
fix/#86/discovery
Aug 29, 2025
Merged

[fix] discovery 셔플 이슈 해결 #87
maylh merged 2 commits intodevelopfrom
fix/#86/discovery

Conversation

@maylh
Copy link
Collaborator

@maylh maylh commented Aug 29, 2025

🛰️ 관련 이슈


✨ 주요 변경 사항

1️⃣ discovery 자동 셔플 이슈 해결 (discovery/40 과 같이 특정 id로 접근 시에도 셔플 로직이 발생하여 다른 플레이리스트가 재생되던 이슈 입니다)
2️⃣ 채팅 삭제 api 연결 (쿼리 키 invalidate가 안되고 있는 거 같은데 이건 qa때 같이 확인하겠습니다)


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

  • 없음

🗯️ PR 포인트


🚀 알게된 점


📖 참고 자료 (선택)

Summary by CodeRabbit

  • 신규 기능

    • 채팅에서 개별 메시지 삭제 지원 및 신고 액션에 토스트 피드백 추가
    • /discover 접속 시 자동으로 셔플 첫 플레이리스트로 리다이렉트
    • 채팅 액션 권한이 작성자/플레이리스트 소유자/기타 사용자에 따라 구분 적용
  • 개선 사항

    • 둘러보기 탭 클릭 시, 현재 /discover/:id에 있다면 해당 아이템을 유지하도록 동작 개선
    • 둘러보기 캐러셀이 URL의 id를 우선해 초기 선택 및 탐색 로직 정교화
    • 플레이리스트 CD 스티커 데이터가 없을 때 대체 소스로 안정적으로 표시

@maylh maylh requested a review from hansololiviakim as a code owner August 29, 2025 16:27
@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 29, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

채팅 메시지 삭제 기능을 도입하고, Discover 라우팅을 재구성하여 /discover 진입 시 셔플 첫 아이템으로 리다이렉트하도록 변경. NavBar의 “둘러보기” 링크 동작을 경로 상태 기반으로 조정. 플레이리스트 타입에 onlyCdResponse를 추가하고 관련 소비 컴포넌트의 prop 전달을 업데이트.

Changes

Cohort / File(s) Summary
Chat deletion flow
src/features/chat/api/chat.ts, src/features/chat/model/useChat.ts, src/features/chat/model/sendMessage.ts, src/entities/comment/ui/Comment.tsx, src/widgets/chat/ChatBottomSheet.tsx, src/widgets/chat/ChatButton.tsx
메시지 삭제 API 추가, 삭제 훅(useDeleteChatMessage) 도입 및 쿼리 무효화, ChatMessage에 roomId 필드 추가, Comment에 roomId/messageId 전달 및 삭제/신고 토스트 처리, BottomSheet에서 역할 계산 로직 교체 및 Comment로 role/ids 전달, ChatButton/BottomSheet에 creatorId 전달 경로 추가
Discover redirect & routing
src/shared/config/routesConfig.ts, src/pages/discover/ui/RedirectToShuffle.tsx, src/widgets/layout/NavBar.tsx, src/pages/discover/index.tsx
/discover 진입 시 셔플 첫 아이템으로 리다이렉트하는 컴포넌트 추가 및 라우트 구조 변경(/discover, /discover/:id, /discover/:id/playlist), NavBar에서 현재 /discover/:id 유지 또는 첫 셔플 id로 링크 결정, Discover 페이지 데이터 결합 및 선택 로직 조정
Playlist typing & consumption
src/entities/playlist/types/playlist.ts, src/widgets/playlist/PlaylistLayout.tsx, src/widgets/playlist/ActionBar.tsx
PlaylistDetailResponse에 onlyCdResponse?: { cdItems } 추가, Cd 스티커 소스에 onlyCdResponse를 폴백으로 사용, ActionBar/ChatButton에 creatorId 전달 경로 추가

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant UI as Comment (BottomSheet)
  participant Hook as useDeleteChatMessage
  participant API as deleteChatMessage
  participant Cache as QueryClient

  User->>UI: 클릭 "삭제"
  UI->>Hook: mutate(messageId)
  Hook->>API: DELETE /chat/rooms/{roomId}/messages/{messageId}
  API-->>Hook: 200 OK
  Hook->>Cache: invalidateQueries(['chat-history', roomId])
  Hook-->>UI: onSuccess
  UI->>UI: 토스트(COMMENT) 표시 및 시트 닫기
Loading
sequenceDiagram
  autonumber
  participant Router as Router(/discover)
  participant Redirect as RedirectToShuffle
  participant Data as useShufflePlaylists
  participant Nav as Browser

  Router->>Redirect: 렌더
  Redirect->>Data: fetchNextPage (on mount/updates)
  Data-->>Redirect: pages[0].content[0].playlistId
  alt 첫 아이템 존재
    Redirect->>Nav: navigate("/discover/{id}", replace: true)
  else 없음
    Redirect->>Redirect: 대기/재시도
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Assessment against linked issues

Objective Addressed Explanation
discovery 리다이렉트 이슈 해결 (#86)

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
채팅 메시지 삭제 API 추가 및 훅 도입 (src/features/chat/api/chat.ts, src/features/chat/model/useChat.ts) #86의 리다이렉트 문제와 무관한 기능 추가임.
Comment/BottomSheet에 roomId/messageId/role 처리 로직 추가 (src/entities/comment/ui/Comment.tsx, src/widgets/chat/ChatBottomSheet.tsx) 디스커버리 라우팅 이슈와 직접 관련 없음.
ChatButton/ActionBar에 creatorId 전달 경로 확장 (src/widgets/chat/ChatButton.tsx, src/widgets/playlist/ActionBar.tsx) 링크 리다이렉트와는 별개의 채팅 권한/표시 관련 변경.
PlaylistDetailResponse에 onlyCdResponse 필드 추가 (src/entities/playlist/types/playlist.ts) 리다이렉트 문제 해결 범위를 벗어나는 타입 확장.

Possibly related PRs

Suggested labels

HIGH

Suggested reviewers

  • hansololiviakim

Poem

툭—토스트가 뜨고, 딜리트는 슝—
탐험의 길목은 /discover로 쓩—
첫 셔플 길 안내, 토끼 발로 쿵쿵!
채팅은 말끔, 라우트는 반짝—
당근처럼 깔끔한 머지, 야호! 🥕✨


📜 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 35eb49b and 161a638.

📒 Files selected for processing (13)
  • src/entities/comment/ui/Comment.tsx (2 hunks)
  • src/entities/playlist/types/playlist.ts (1 hunks)
  • src/features/chat/api/chat.ts (1 hunks)
  • src/features/chat/model/sendMessage.ts (1 hunks)
  • src/features/chat/model/useChat.ts (2 hunks)
  • src/pages/discover/index.tsx (4 hunks)
  • src/pages/discover/ui/RedirectToShuffle.tsx (1 hunks)
  • src/shared/config/routesConfig.ts (2 hunks)
  • src/widgets/chat/ChatBottomSheet.tsx (2 hunks)
  • src/widgets/chat/ChatButton.tsx (2 hunks)
  • src/widgets/layout/NavBar.tsx (1 hunks)
  • src/widgets/playlist/ActionBar.tsx (2 hunks)
  • src/widgets/playlist/PlaylistLayout.tsx (1 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/#86/discovery

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 self-assigned this Aug 29, 2025
@maylh maylh added the HIGH 빠르게 처리해야 하는 높은 우선순위 label Aug 29, 2025
@github-actions
Copy link

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

@maylh maylh changed the title [fix] discovery 리다이렉트 이슈 해결 [fix] discovery 셔플 이슈 해결 Aug 29, 2025
@maylh maylh merged commit a449e9f into develop Aug 29, 2025
3 of 4 checks passed
@maylh maylh deleted the fix/#86/discovery branch August 29, 2025 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

HIGH 빠르게 처리해야 하는 높은 우선순위

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[fix] discovery 리다이렉트 이슈 해결

2 participants