Skip to content

✨ Feat: 커뮤니티 게시물 댓글 기능 및 내 활동 조회 기능 구현 - #58

Merged
sooloin merged 4 commits into
DoDo-Project:developfrom
sooloin:feature/54
Jun 13, 2026
Merged

✨ Feat: 커뮤니티 게시물 댓글 기능 및 내 활동 조회 기능 구현#58
sooloin merged 4 commits into
DoDo-Project:developfrom
sooloin:feature/54

Conversation

@sooloin

@sooloin sooloin commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

📄 작업 내용 (Description)

이번 PR에서 변경되거나 추가된 주요 작업을 간단히 설명해주세요.

  • 게시글 상세에 댓글 목록 조회 API를 연동
  • 게시글 상세에서 댓글 작성, 수정, 삭제 기능을 구현
  • 대댓글 작성 UI와 인라인 댓글 수정 흐름을 추가
  • 댓글 입력창/수정창/답글창을 한 줄 시작 자동 확장 형태로 개선
  • 댓글 목록 및 댓글 작성 영역에서 프로필 아바타를 제거했
  • 내 활동 페이지에 내가 쓴 게시글 목록 조회를 연동
  • 내 활동 페이지에 내가 쓴 댓글 목록 조회를 연동
  • 내 활동 탭에 로딩, 에러, 빈 상태, 페이지 이동 UI를 추가

🔗 관련 이슈 (Related Issues)

작업한 이슈 번호를 아래 형식으로 PULL REQUEST BODY에 작성해주세요.
(PR 머지 시 해당 이슈가 자동으로 종료됩니다.)


✅ 체크리스트 (Checklist)

PR을 보내기 전 아래 항목들을 모두 확인해주세요.

  • PR 제목은 커밋 컨벤션을 따랐습니다.
  • 관련 이슈를 연결했습니다.
  • 스스로 코드를 검토하고 불필요한 코드를 제거했습니다.
  • 코드 스타일이 프로젝트 규칙과 일치합니다. (Style)
  • 새로운 기능에 대한 테스트 코드를 추가했거나, 기존 테스트가 모두 통과했습니다. (Test)

📸 스크린샷 (Screenshots)

작업 내용과 관련된 스크린샷이 있다면 첨부해주세요. (UI 변경이 있는 경우)

image

💬 기타 사항 (Etc)

리뷰어에게 전달하고 싶은 추가 정보가 있다면 자유롭게 작성해주세요.

sooloin added 3 commits June 13, 2026 20:47
- 댓글 목록 조회 API 연동 및 페이지네이션 추가
- 게시글 상세에서 댓글 작성/수정/삭제 기능 구현
- 대댓글 작성 UI 및 인라인 댓글 수정 흐름 추가
- 댓글 API 타입, react-query 훅, 쿼리 키 구성 추가
- 댓글 조회/변경 실패 메시지 및 상태 처리 정리

`DoDo-Project#54`
- 댓글창 및 댓글 목록에 프로필 이미지 제거
- 플레이스 홀더를 한 줄 크 변경

`DoDo-Project#54`
- 내 활동 페이지에 내가 쓴 게시글 목록 조회 연동
- 내 활동 페이지에 내가 쓴 댓글 목록 조회 연동
- 게시글/댓글 탭별 로딩, 에러, 빈 상태 UI 추가
- 내 활동 목록 페이지네이션 및 게시글 상세 이동 연결
- 내 활동용 API 타입, react-query 훅, 쿼리 키 추가

`DoDo-Project#54`
@sooloin
sooloin requested review from WhiteBin-bin and limhb708 June 13, 2026 12:13
@sooloin sooloin self-assigned this Jun 13, 2026
@sooloin sooloin added ✨ Feature 새 기능 혹은 요구 사항 😸 조수빈 조수빈 파트 labels Jun 13, 2026
@vercel

vercel Bot commented Jun 13, 2026

Copy link
Copy Markdown

@sooloin is attempting to deploy a commit to the sooloin's projects Team on Vercel.

A member of the Team first needs to authorize it.

@sooloin sooloin changed the title ✨ Feat: ✨ Feat: 커뮤니티 게시물 댓글 기능 및 내 활동 조회 기능 구현 Jun 13, 2026
@vercel

vercel Bot commented Jun 13, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
dodo-frontend Ready Ready Preview, Comment Jun 13, 2026 3:50pm

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements comment management and user activity tracking features for the community section, including API integrations, React Query hooks, and UI components for viewing, creating, updating, and deleting comments, as well as listing user-specific posts and comments. Key feedback points out a UX issue with a shared error state that displays far from the active action, a security concern where authorization checks rely on nicknames instead of unique user IDs, and performance inefficiencies where both user posts and comments are fetched simultaneously regardless of the active tab.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +141 to +146
const [draftComment, setDraftComment] = useState('');
const [replyTargetId, setReplyTargetId] = useState<number | null>(null);
const [replyDraft, setReplyDraft] = useState('');
const [editingCommentId, setEditingCommentId] = useState<number | null>(null);
const [editDraft, setEditDraft] = useState('');
const [formError, setFormError] = useState('');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

현재 formError 상태 하나를 댓글 등록, 답글 등록, 댓글 수정, 댓글 삭제 등 모든 작업에서 공유하고 있습니다. 하지만 이 에러 메시지는 페이지 최하단의 메인 댓글 입력창에만 렌더링되고 있습니다. 이로 인해 사용자가 페이지 상단에서 댓글을 수정하거나 답글을 달 때 에러가 발생하면, 에러 메시지가 현재 포커스된 위치가 아닌 최하단에 표시되어 인지하기 어렵고 혼란을 줄 수 있습니다. 각 작업별로 에러 상태를 분리(예: commentError, replyError, editError)하고, 해당 UI 컴포넌트(ReplyComposer, CommentRow 등) 내부 또는 근처에 에러 메시지를 표시하도록 개선하는 것을 권장합니다.

Comment on lines +540 to +546
const { nickname } = getCommentAuthor(comment);
const canManage = Boolean(
currentUserNickname &&
nickname.trim() &&
currentUserNickname.trim() === nickname.trim() &&
!isDeletedComment(comment),
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

현재 댓글의 수정/삭제 권한(canManage)을 확인하기 위해 사용자의 닉네임(nickname)을 비교하고 있습니다. 하지만 닉네임은 중복 가능성이 있거나 변경될 수 있으며, 특히 익명 댓글 처리 시 오동작할 우려가 있어 보안 및 기능상 취약할 수 있습니다. 닉네임 대신 고유한 식별자인 userId를 비교하여 권한을 검증하는 것이 훨씬 안전하고 정확합니다. (예: currentUser.userId === comment.userId 또는 currentUser.userId === comment.author.userId 형태)

Comment on lines +6 to +11
export function useMyBoardList(params: { page: number; size: number }) {
return useQuery({
queryKey: queryKeys.boards.mine(params),
queryFn: () => getMyBoardList(params),
});
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

useMyBoardList 훅이 항상 실행되는 대신, 특정 조건에서만 실행될 수 있도록 options 매개변수를 추가하여 enabled 설정을 지원하도록 개선하는 것이 좋습니다. 이를 통해 불필요한 API 호출을 방지할 수 있습니다.

Suggested change
export function useMyBoardList(params: { page: number; size: number }) {
return useQuery({
queryKey: queryKeys.boards.mine(params),
queryFn: () => getMyBoardList(params),
});
}
export function useMyBoardList(params: { page: number; size: number }, options?: { enabled?: boolean }) {
return useQuery({
queryKey: queryKeys.boards.mine(params),
queryFn: () => getMyBoardList(params),
...options,
});
}

Comment on lines +6 to +11
export function useMyCommentList(params: { page: number; size: number }) {
return useQuery({
queryKey: queryKeys.comments.mine(params),
queryFn: () => getMyCommentList(params),
});
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

useMyCommentList 훅이 항상 실행되는 대신, 특정 조건에서만 실행될 수 있도록 options 매개변수를 추가하여 enabled 설정을 지원하도록 개선하는 것이 좋습니다. 이를 통해 불필요한 API 호출을 방지할 수 있습니다.

Suggested change
export function useMyCommentList(params: { page: number; size: number }) {
return useQuery({
queryKey: queryKeys.comments.mine(params),
queryFn: () => getMyCommentList(params),
});
}
export function useMyCommentList(params: { page: number; size: number }, options?: { enabled?: boolean }) {
return useQuery({
queryKey: queryKeys.comments.mine(params),
queryFn: () => getMyCommentList(params),
...options,
});
}

Comment on lines +57 to +58
const myPostsQuery = useMyBoardList({ page: postsPage, size: PAGE_SIZE });
const myCommentsQuery = useMyCommentList({ page: commentsPage, size: PAGE_SIZE });

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

현재 활성화된 탭(activeTab)에 관계없이 useMyBoardListuseMyCommentList 쿼리가 항상 동시에 호출되고 있습니다. 이는 사용자가 '내 게시글' 탭에 있을 때도 '내 댓글' API를 조회하게 되어 불필요한 네트워크 요청과 서버 부하를 유발합니다. 각 쿼리에 enabled 옵션을 지정하여 현재 활성화된 탭에 해당하는 쿼리만 실행되도록 개선하는 것을 권장합니다.

Suggested change
const myPostsQuery = useMyBoardList({ page: postsPage, size: PAGE_SIZE });
const myCommentsQuery = useMyCommentList({ page: commentsPage, size: PAGE_SIZE });
const myPostsQuery = useMyBoardList({ page: postsPage, size: PAGE_SIZE }, { enabled: activeTab === 'posts' });
const myCommentsQuery = useMyCommentList({ page: commentsPage, size: PAGE_SIZE }, { enabled: activeTab === 'comments' });

- 댓글 작성, 답글, 수정, 삭제 에러 상태를 작업별로 분리
- 댓글 에러 메시지를 각 입력/액션 위치에 맞게 표시하도록 개선
- 댓글 수정/삭제 권한 판별을 닉네임 비교에서 userId 비교로 변경
- 내 활동 게시글/댓글 조회 훅에 enabled 옵션 추가
- 활성 탭에 따라 필요한 내 활동 쿼리만 호출하도록 최적화

`DoDo-Project#54`
@sooloin
sooloin merged commit 93ce739 into DoDo-Project:develop Jun 13, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ Feature 새 기능 혹은 요구 사항 😸 조수빈 조수빈 파트

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat] 커뮤니티 게시물 댓글 기능 및 내 활동 조회 기능 구현

2 participants