-
Notifications
You must be signed in to change notification settings - Fork 1
sp1 1차 QA 반영 (대시보드-기능 관련) #130
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 5 commits
a59f353
981cab9
238f04d
3cd0693
eca6513
a16259d
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 | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,4 +1,4 @@ | ||||||||||||||||||
| import { useState } from 'react'; | ||||||||||||||||||
| import { useMemo, useState } from 'react'; | ||||||||||||||||||
| import { Badge, Card } from '@pinback/design-system/ui'; | ||||||||||||||||||
| import CardEditModal from '@shared/components/cardEditModal/CardEditModal'; | ||||||||||||||||||
| import OptionsMenuPortal from '@shared/components/sidebar/OptionsMenuPortal'; | ||||||||||||||||||
|
|
@@ -20,16 +20,18 @@ import NoRemindArticles from './components/noRemindArticles/NoRemindArticles'; | |||||||||||||||||
| const Remind = () => { | ||||||||||||||||||
| const [isEditOpen, setIsEditOpen] = useState(false); | ||||||||||||||||||
| const [activeBadge, setActiveBadge] = useState<'read' | 'notRead'>('notRead'); | ||||||||||||||||||
| const formattedDate = formatLocalDateTime(); | ||||||||||||||||||
| const formattedDate = useMemo(() => { | ||||||||||||||||||
| return formatLocalDateTime(); | ||||||||||||||||||
| }, [activeBadge]); | ||||||||||||||||||
|
|
||||||||||||||||||
| const queryClient = useQueryClient(); | ||||||||||||||||||
|
|
||||||||||||||||||
| const { mutate: updateToReadStatus } = usePutArticleReadStatus(); | ||||||||||||||||||
| const { mutate: deleteArticle } = useDeleteRemindArticle(); | ||||||||||||||||||
| const { data, isPending } = useGetRemindArticles( | ||||||||||||||||||
| const { data } = useGetRemindArticles( | ||||||||||||||||||
| formattedDate, | ||||||||||||||||||
| activeBadge === 'read', | ||||||||||||||||||
| 1, | ||||||||||||||||||
| 0, | ||||||||||||||||||
| 10 | ||||||||||||||||||
| ); | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
@@ -71,9 +73,9 @@ const Remind = () => { | |||||||||||||||||
| }; | ||||||||||||||||||
|
|
||||||||||||||||||
| // TODO: 로딩 상태 디자인 필요 | ||||||||||||||||||
| if (isPending) { | ||||||||||||||||||
| return <div>Loading...</div>; | ||||||||||||||||||
| } | ||||||||||||||||||
| // if (isPending) { | ||||||||||||||||||
| // return <div>Loading...</div>; | ||||||||||||||||||
| // } | ||||||||||||||||||
|
|
||||||||||||||||||
| return ( | ||||||||||||||||||
| <div className="flex flex-col py-[5.2rem] pl-[8rem] pr-[5rem]"> | ||||||||||||||||||
|
|
@@ -103,10 +105,6 @@ const Remind = () => { | |||||||||||||||||
| content={article.memo} | ||||||||||||||||||
| timeRemaining={article.remindAt} | ||||||||||||||||||
| category={article.category.categoryName} | ||||||||||||||||||
| {...(activeBadge === 'notRead' && { | ||||||||||||||||||
| onOptionsClick: (e) => | ||||||||||||||||||
| openMenu(article.category.categoryId, e.currentTarget), | ||||||||||||||||||
| })} | ||||||||||||||||||
| onClick={() => { | ||||||||||||||||||
| window.open(article.url, '_blank'); | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
@@ -121,6 +119,10 @@ const Remind = () => { | |||||||||||||||||
| }, | ||||||||||||||||||
| }); | ||||||||||||||||||
| }} | ||||||||||||||||||
| onOptionsClick={(e) => { | ||||||||||||||||||
| e.stopPropagation(); | ||||||||||||||||||
| openMenu(article.category.categoryId, e.currentTarget); | ||||||||||||||||||
| }} | ||||||||||||||||||
|
Comment on lines
+132
to
+135
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 chain잘못된 ID 전달: categoryId를 articleId로 교체 openMenu에 categoryId를 넘기고 이후 onEdit/onDelete에서 같은 값을 articleId로 취급합니다. 삭제/수정이 오동작합니다. - onOptionsClick={(e) => {
- e.stopPropagation();
- openMenu(article.category.categoryId, e.currentTarget);
- }}
+ onOptionsClick={(e) => {
+ e.stopPropagation();
+ openMenu(article.articleId, e.currentTarget);
+ }}후속으로 OptionsMenuPortal의 prop 명(categoryId)을 의미에 맞게 articleId(또는 entityId)로 리네이밍하는 것을 권장합니다. 🏁 Script executed: #!/bin/bash
# openMenu 호출 인자 일관성 점검(가능한 articleId 사용 여부 확인)
rg -nP 'openMenu\(([^,]+),' -C2Length of output: 1302 openMenu에 articleId 전달로 수정 필요 (apps/client/src/pages/remind/Remind.tsx:124) Remind.tsx에서 openMenu에 article.category.categoryId를 전달하고 있어 onEdit/onDelete가 articleId로 처리될 때 오동작합니다. MyBookmark.tsx와 일관되게 article.articleId를 전달하도록 변경하세요. - onOptionsClick={(e) => {
- e.stopPropagation();
- openMenu(article.category.categoryId, e.currentTarget);
- }}
+ onOptionsClick={(e) => {
+ e.stopPropagation();
+ openMenu(article.articleId, e.currentTarget);
+ }}OptionsMenuPortal의 prop명(categoryId)을 의미에 맞게 articleId 또는 entityId로 리네이밍 권장. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||
| /> | ||||||||||||||||||
| ))} | ||||||||||||||||||
| </div> | ||||||||||||||||||
|
|
@@ -145,7 +147,7 @@ const Remind = () => { | |||||||||||||||||
| onClose={closeMenu} | ||||||||||||||||||
| /> | ||||||||||||||||||
|
|
||||||||||||||||||
| {isEditOpen && ( | ||||||||||||||||||
| {isEditOpen && articleDetail && ( | ||||||||||||||||||
| <div className="fixed inset-0 z-[1000]" aria-modal="true" role="dialog"> | ||||||||||||||||||
| <div | ||||||||||||||||||
| className="absolute inset-0 bg-black/60 backdrop-blur-[2px]" | ||||||||||||||||||
|
|
||||||||||||||||||
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.
🧩 Analysis chain
카테고리별 읽음 필터 캐시 키 누락 가능성 안내(별도 파일 패치)
useGetCategoryBookmarkArticles는 readStatus로 결과가 달라지지만 queryKey에 포함되어 있지 않아 배지 전환 시 캐시 재조회가 되지 않을 수 있습니다.
아래 패치를 별도 파일에 적용해 주세요.
파일: apps/client/src/pages/myBookmark/apis/queries.ts
export const useGetCategoryBookmarkArticles = ( categoryId: string | null, readStatus: boolean, page: number, size: number ): UseQueryResult<CategoryBookmarkArticleResponse, AxiosError> => { return useQuery({ - queryKey: ['categoryBookmarkArticles', categoryId, page, size], + queryKey: ['categoryBookmarkArticles', categoryId, readStatus, page, size], queryFn: () => getCategoryBookmarkArticles(categoryId, readStatus, page, size), enabled: !!categoryId, }); };검증 스크립트(키에 readStatus 누락된 다른 훅도 있는지 확인):
🏁 Script executed:
Length of output: 1836
쿼리 키에 readStatus 누락 — 수정 필요
useGetCategoryBookmarkArticles의 queryKey에 readStatus가 빠져 있어 배지(읽음/전체) 전환 시 캐시가 재조회되지 않습니다. 아래 패치를 apps/client/src/pages/myBookmark/apis/queries.ts에 적용하세요.
파일: apps/client/src/pages/myBookmark/apis/queries.ts
export const useGetCategoryBookmarkArticles = ( categoryId: string | null, readStatus: boolean, page: number, size: number ): UseQueryResult<CategoryBookmarkArticleResponse, AxiosError> => { return useQuery({ - queryKey: ['categoryBookmarkArticles', categoryId, page, size], + queryKey: ['categoryBookmarkArticles', categoryId, readStatus, page, size], queryFn: () => getCategoryBookmarkArticles(categoryId, readStatus, page, size), enabled: !!categoryId, }); };검증 결과:
📝 Committable suggestion
🤖 Prompt for AI Agents