Conversation
… into feat/scrollText
Feat/scroll text
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Review Summary by QodoVersion 2.3.0: Marquee text animation, ranking page recommendations, and UI improvements
WalkthroughsDescription• Add marquee text scrolling animation for long song titles and artists • Implement song recommendation feature on ranking page with thumb count display • Fix recent songs date filtering to use release date instead of created_at • Increase daily check-in reward points from 10 to 30 • Improve search results UI with expandable action buttons and thumb count display • Add total_stats relationship to song queries for thumb count aggregation Diagramflowchart LR
A["Song Data"] -->|"Include total_stats"| B["Search API"]
B -->|"Display thumb count"| C["Search Results"]
C -->|"Expandable buttons"| D["User Actions"]
E["Marquee Component"] -->|"Auto-scroll text"| F["Song Cards"]
G["Ranking Page"] -->|"Add recommendation"| H["ThumbUpModal"]
I["Recent Songs"] -->|"Filter by release date"| J["Monthly View"]
K["Check-in"] -->|"30 points reward"| L["User Points"]
File Changes1. apps/web/src/app/api/search/route.ts
|
Code Review by Qodo
1. Validate recent-add params
|
| const now = new Date(); | ||
| const year = Number(searchParams.get('year')); | ||
| const month = Number(searchParams.get('month')); | ||
|
|
||
| const startDate = new Date(year, month, 1); | ||
| const endDate = new Date(year, month + 1, 1); | ||
| // date-fns의 month는 0-indexed이므로 1을 빼줌 (사용자 입력은 1-12) | ||
| const baseDate = new Date(year, month, 1); | ||
| const startDate = format(startOfMonth(baseDate), 'yyyy-MM-01'); | ||
| const endDate = format(endOfMonth(baseDate), 'yyyy-MM-dd'); | ||
|
|
There was a problem hiding this comment.
1. Validate recent-add params 🐞 Bug ⛯ Reliability
The recent-add API converts year/month via Number() without validation; missing/invalid params become NaN, producing an Invalid Date and causing the handler to throw/return 500 instead of a 400 (bad request). This makes the endpoint fragile to malformed requests and can create noisy server errors.
Agent Prompt
### Issue description
`/api/songs/recent-add` builds date ranges from `year`/`month` query params without validation. If params are missing/invalid, `Number()` yields `NaN`, which can lead to invalid date computations and a 500 response instead of a clean 400.
### Issue Context
This endpoint is callable via HTTP and should be resilient to malformed input.
### Fix Focus Areas
- apps/web/src/app/api/songs/recent-add/route.ts[12-20]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| {data && data.length > 0 ? ( | ||
| data.map((item, index) => ( | ||
| <RankingItem key={index} {...item} rank={index + 1} value={item.total_thumb} /> | ||
| )) |
There was a problem hiding this comment.
2. Index key state bug 🐞 Bug ✓ Correctness
Popular ranking items use key={index} while each RankingItem maintains local dialog open state;
when the list refetches and order changes, React can re-use components by index and attach the open
state to the wrong song. This can manifest as the wrong song opening in the recommendation modal
after refresh/reorder.
Agent Prompt
### Issue description
`RankingItem` is rendered with `key={index}` even though it has local dialog state. If the list ordering changes, dialog state may attach to the wrong item.
### Issue Context
This is especially likely because the list supports manual `refetch()`.
### Fix Focus Areas
- apps/web/src/app/popular/PopularRankingList.tsx[33-36]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
📌 PR 제목
[Type] : 작업 내용 요약
📌 변경 사항
💬 추가 참고 사항