Skip to content

feat: 댓글&답글 기능 추가#59

Merged
heeeeyong merged 6 commits into
developfrom
feature/feed
Jul 25, 2025
Merged

feat: 댓글&답글 기능 추가#59
heeeeyong merged 6 commits into
developfrom
feature/feed

Conversation

@heeeeyong
Copy link
Copy Markdown
Collaborator

@heeeeyong heeeeyong commented Jul 24, 2025

#️⃣연관된 이슈

앞선 이슈에서 누락된 내용이라 추가 작업했습니다.

📝작업 내용

https://github.com/user-attachments/assets/ed1f1d58-780a-4c12-9478-c118a388b74e
image
image

  1. 피그마 요구사항에 맞춰 MessageInput.tsx의 design 일부 수정했습니다. 또, 댓글&기록 작성 뿐만 아니라 일반적인 입력창으로써의 기능도 유지하도록 코드를 개선했습니다.
  2. API명세를 일부 참고해 댓글&답글 기능을 추가했습니다.
  • useReplyStore 에서 전역으로 상태를 관리합니다.
    isReplying: 현재 답글 작성 중인지 여부
    targetUserName: 답글 대상자의 닉네임
    parentId: 답글 달려는 부모 댓글의 ID
    replyContent: 현재 작성 중인 댓글/답글 내용
  • useReplyActinos 를 통해 전역상태를 기반으로 댓글/답글 API요청 및 상태 초기화를 담당하게끔 했습니다.
  • 필요한 화면에서 useReplyAction에서 가져온 상태를 MessageInput에 전달하면 답글달기인지 일반 댓글 작성인지 판단합니다.
    추후에, 훅안에있는 API는 따로 분리해서 호출할 예정입니다!

💬리뷰 요구사항

MessageInput는 UI컴포넌트용으로 랜더링이랑 입력이벤트만 관리하게끔 하고 나머지는 전부 훅으로 처리했는데 이게 젤 깔끔한 방식일까요?

*** axios 라이브러리 설치 바랍니당 ***

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • 피드 상세 게시글 전용 컴포넌트와 상세 게시글 본문 컴포넌트가 추가되었습니다.
    • 댓글에 답글(Reply) 기능이 추가되어, 답글 대상 표시 및 답글 취소가 가능합니다.
    • 댓글 및 대댓글 작성 시 답글 모드 UI가 표시됩니다.
  • 버그 수정

    • 모달 및 스낵바 표시 시 스크롤 차단 동작이 개선되었습니다.
  • UI/UX 개선

    • 댓글 및 대댓글의 사용자 정보, 작성일, 좋아요 등 표기 방식이 명확해졌습니다.
    • 댓글/답글 입력 UI가 개선되고, 답글 대상이 표시됩니다.
    • 댓글/대댓글의 좋아요 상태 및 카운트가 즉시 반영됩니다.
    • 상세 게시글에서 댓글 아이콘 클릭 시 이동이 제한됩니다.
  • 기타

    • 댓글 및 답글 데이터 구조가 변경되었습니다.
    • 댓글/답글 관련 상태 관리가 개선되었습니다.
    • 외부 라이브러리(axios) 및 타입이 추가되었습니다.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jul 24, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
thip ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 24, 2025 7:07pm

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jul 24, 2025

"""

Walkthrough

이 변경사항은 댓글 및 답글 기능의 리팩토링과 상세 피드 게시물 뷰의 도입, 스타일 구조 개선, 댓글/답글 데이터 및 타입 명명 규칙 일관화, 그리고 팝업 및 입력 UI의 동작 개선을 포함합니다. 새로운 커스텀 훅, Zustand 스토어, 상세 게시물 컴포넌트, 스타일 컴포넌트 등이 추가되었습니다.

Changes

파일/경로 그룹 변경 요약
package.json axios 및 @types/axios 의존성 추가
src/components/common/Modal/PopupContainer.tsx 팝업 열림/닫힘시 body overflow 처리 로직 명확화 및 스크롤 차단 동작 수정
src/components/common/Post/PostBody.tsx 태그 렌더링 기능 및 관련 스타일, props, JSX 제거, 클릭 핸들러 명명 및 전달 방식 변경
src/components/common/Post/PostFooter.tsx isDetail prop 추가, 댓글 아이콘 비활성화 및 커서 스타일 조건부 처리, 핸들러 로직 수정
src/components/common/Post/Reply.tsx props 명명 규칙 변경, isLike 추가, 좋아요 상태 관리 개선, 답글 작성 핸들러 및 훅 도입
src/components/common/Post/SubReply.tsx props 명명 규칙 변경, isLike/likeCount 상태 관리, 답글 작성 핸들러 및 훅 도입, alt 속성 추가
src/components/feed/FeedDetailPost.tsx 상세 피드 게시물 컴포넌트 신규 도입, 레이아웃 및 하위 컴포넌트 조합
src/components/feed/FeedDetailPostBody.tsx 상세 피드 게시물 본문 컴포넌트 신규 도입, 태그/이미지/책정보 렌더링
src/components/today-words/MessageInput.styled.ts 스타일 컴포넌트 구조 및 명칭 변경, ReplyContainer 추가, 입력창 및 버튼 스타일 개선
src/components/today-words/MessageInput.tsx 답글 모드 UI/인터랙션 추가, props/핸들러/렌더링 구조 개선
src/data/postData.ts 댓글/답글 mock 데이터 명명 규칙 및 필드 구조 변경, isLike 추가
src/hooks/useReplyActions.ts 댓글/답글 상태 및 액션 관리용 커스텀 훅 신규 도입
src/pages/feed/FeedDetailPage.tsx 댓글 입력 상태 관리 로컬 state → useReplyActions 훅으로 변경, 상세 게시물 컴포넌트 적용
src/stores/useReplyStore.ts 댓글/답글 상태 관리용 Zustand 스토어 신규 도입
src/types/post.ts 댓글/답글 타입 인터페이스 필드명, 구조, isLike 추가 등 명확화

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant FeedDetailPage
    participant MessageInput
    participant useReplyActions
    participant useReplyStore
    participant API

    User->>MessageInput: 댓글 입력/답글 작성
    MessageInput->>useReplyActions: submitComment 호출
    useReplyActions->>useReplyStore: 상태 확인 및 업데이트
    useReplyActions->>API: 댓글/답글 POST 요청
    API-->>useReplyActions: 응답
    useReplyActions->>useReplyStore: replyContent 초기화 및 reply 모드 해제
    useReplyActions-->>FeedDetailPage: (선택) 성공 콜백
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20분

Possibly related PRs

Suggested labels

✨ Feature, 🎨 Html&css

Poem

🐰
댓글 달고 답글 쓰니
토끼 마음 설렌다네
새로워진 상세 뷰,
스타일도 말끔하게!
Zustand와 훅이 와글와글
코드밭에 푸른 새싹
오늘도 리뷰, 깡총!

"""

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 84c3e6f and d4612c1.

📒 Files selected for processing (1)
  • src/stores/useReplyStore.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/stores/useReplyStore.ts
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/feed

🪧 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.
    • Explain this complex logic.
    • 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. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai 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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • 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.

@heeeeyong heeeeyong self-assigned this Jul 24, 2025
@heeeeyong heeeeyong added ✨ Feature 기능 개발 🎨 Html&css 마크업 & 스타일링 labels Jul 24, 2025
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (4)
src/stores/useReplyStore.ts (1)

27-27: 중복된 기능을 고려해보세요.

clearReplyContentcancelReply의 기능이 부분적으로 중복됩니다. clearReplyContent가 별도로 필요한 특별한 사용 사례가 있는지 검토해보세요.

src/hooks/useReplyActions.ts (1)

33-34: 개발용 로그를 제거하거나 환경별로 분리하세요.

프로덕션 환경에서는 불필요한 콘솔 로그가 출력될 수 있습니다.

-      console.log('댓글or답글 작성 API 요청');
+      // TODO: 개발 환경에서만 로그 출력하도록 수정 필요
src/components/feed/FeedDetailPostBody.tsx (2)

89-91: 이미지 렌더링에서 alt 속성이 누락되었습니다.

접근성을 위해 이미지에 alt 속성을 추가하는 것을 권장합니다.

            {images.map((src, i) => (
-             <img key={i} src={src} />
+             <img key={i} src={src} alt={`게시물 이미지 ${i + 1}`} />
            ))}

71-108: PostBody와 코드 중복이 있습니다.

FeedDetailPostBodyPostBody 컴포넌트 간에 상당한 코드 중복이 있습니다. 공통 부분을 추출하여 재사용성을 높이는 것을 고려해보세요.

공통 스타일이나 로직을 별도 컴포넌트나 유틸리티로 분리하거나, 조건부 props를 사용하여 하나의 컴포넌트로 통합하는 방안을 검토해보세요.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d2216c3 and 84c3e6f.

⛔ Files ignored due to path filters (2)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • src/assets/common/closeIcon.svg is excluded by !**/*.svg
📒 Files selected for processing (15)
  • package.json (2 hunks)
  • src/components/common/Modal/PopupContainer.tsx (1 hunks)
  • src/components/common/Post/PostBody.tsx (2 hunks)
  • src/components/common/Post/PostFooter.tsx (5 hunks)
  • src/components/common/Post/Reply.tsx (1 hunks)
  • src/components/common/Post/SubReply.tsx (1 hunks)
  • src/components/feed/FeedDetailPost.tsx (1 hunks)
  • src/components/feed/FeedDetailPostBody.tsx (1 hunks)
  • src/components/today-words/MessageInput.styled.ts (3 hunks)
  • src/components/today-words/MessageInput.tsx (1 hunks)
  • src/data/postData.ts (1 hunks)
  • src/hooks/useReplyActions.ts (1 hunks)
  • src/pages/feed/FeedDetailPage.tsx (2 hunks)
  • src/stores/useReplyStore.ts (1 hunks)
  • src/types/post.ts (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (6)
src/hooks/useReplyActions.ts (1)
src/stores/useReplyStore.ts (1)
  • useReplyStore (15-28)
src/components/feed/FeedDetailPostBody.tsx (1)
src/types/post.ts (1)
  • PostBodyProps (31-34)
src/components/today-words/MessageInput.tsx (1)
src/components/today-words/MessageInput.styled.ts (6)
  • MessageInput (62-90)
  • Wrapper (4-16)
  • ReplyContainer (32-60)
  • InputContainer (18-21)
  • MessageInputWrapper (23-30)
  • SendButton (92-115)
src/components/feed/FeedDetailPost.tsx (1)
src/types/post.ts (1)
  • FeedPostProps (26-29)
src/components/common/Post/Reply.tsx (2)
src/types/post.ts (1)
  • ReplyDataProps (51-64)
src/hooks/useReplyActions.ts (1)
  • useReplyActions (9-52)
src/components/today-words/MessageInput.styled.ts (1)
src/styles/global/global.ts (3)
  • semanticColors (80-153)
  • colors (4-53)
  • typography (56-77)
🔇 Additional comments (33)
package.json (1)

18-18: axios·@types/axios 버전 및 보안 확인 완료

  • npm view 결과 axios 1.11.0, @types/axios 0.14.4 모두 최신 버전입니다.
  • 현재 알려진 axios 관련 보안 취약점은 없습니다.
  • 참고: npm audit를 제대로 실행하려면 package-lock.json 생성 후 재검토를 권장합니다.
src/components/common/Modal/PopupContainer.tsx (1)

13-21: 개선된 스크롤 제어 로직입니다.

문서 body의 overflow 스타일 제어 로직이 더 명확하고 의미론적으로 개선되었습니다. 빈 문자열 대신 'auto'를 명시적으로 사용하는 것이 더 적절합니다.

src/components/feed/FeedDetailPost.tsx (2)

25-36: 깔끔한 컴포넌트 구성입니다.

상세 게시물 보기를 위한 컴포넌트 구성이 잘 설계되었습니다. props 구조분해와 전달, 그리고 isDetail={true} 플래그를 통한 PostFooter 동작 제어가 적절합니다.


7-23: 일관된 스타일링 패턴입니다.

CSS-in-JS를 사용한 스타일 컴포넌트 정의가 프로젝트의 다른 부분과 일관되며, flexbox 레이아웃과 컬러 변수 사용이 적절합니다.

src/pages/feed/FeedDetailPage.tsx (3)

16-18: 우수한 상태 관리 리팩토링입니다.

로컬 상태 관리를 useReplyActions 훅으로 중앙화한 것이 좋은 개선사항입니다. 코드의 재사용성과 유지보수성이 향상되었습니다.


57-67: MessageInput 통합이 잘 구현되었습니다.

답글 관련 모든 props가 적절히 전달되고 있으며, 한국어 플레이스홀더와 함께 사용자 경험이 개선되었습니다. submitComment 함수 호출도 올바른 매개변수를 전달하고 있습니다.


55-55: 컴포넌트 교체가 적절합니다.

FeedPost에서 FeedDetailPost로의 컴포넌트 교체가 상세 페이지의 요구사항에 더 적합하며, props 전달도 올바르게 구현되었습니다.

src/components/common/Post/PostBody.tsx (2)

58-62: 함수명 변경이 더 명확해졌습니다.

handlePostContent에서 handlePostClick으로 변경한 것이 함수의 역할을 더 명확하게 표현합니다.


67-67: 불필요한 클로저 생성을 피하는 좋은 개선입니다.

인라인 화살표 함수로 feedId를 직접 전달하는 것이 성능상 더 효율적입니다.

src/hooks/useReplyActions.ts (2)

4-8: 인터페이스 정의가 명확합니다.

SubmitCommentProps 인터페이스가 필요한 매개변수들을 잘 정의하고 있습니다.


21-24: 입력 검증 로직이 적절합니다.

trim()을 사용하여 공백만 있는 입력을 필터링하는 것이 좋습니다.

src/components/common/Post/Reply.tsx (4)

22-24: 초기 상태를 props에서 받아오는 개선이 좋습니다.

isLike prop을 사용하여 초기 좋아요 상태를 설정하는 것이 더 정확합니다.


28-29: 함수형 상태 업데이트 사용이 적절합니다.

setLiked(prev => !prev)를 사용하여 상태 업데이트의 안전성을 보장합니다.


32-34: 답글 기능 통합이 잘 구현되었습니다.

useReplyActions 훅을 사용하여 답글 기능을 깔끔하게 통합했습니다.


55-55: 접근성 개선을 위한 alt 속성 추가가 좋습니다.

이미지에 alt="좋아요" 속성을 추가하여 접근성을 개선했습니다.

src/components/common/Post/PostFooter.tsx (3)

51-60: 새로운 prop 추가와 기본값 설정이 적절합니다.

isDetail prop의 기본값을 false로 설정하여 기존 동작을 유지하면서 새로운 기능을 안전하게 추가했습니다.


38-40: 조건부 스타일 적용이 깔끔합니다.

isDetail prop에 따라 커서 스타일을 조건부로 적용하는 방식이 명확하고 효율적입니다.


77-80: 조건부 네비게이션 제어가 간단하고 명확합니다.

isDetail이 true일 때 early return으로 네비게이션을 방지하는 로직이 이해하기 쉽습니다.

src/data/postData.ts (2)

1-2: 타입 임포트가 올바르게 업데이트되었습니다.

업데이트된 인터페이스를 정확히 참조하고 있습니다.


66-117: 체계적인 네이밍 규칙 업데이트가 잘 적용되었습니다.

댓글 및 답글 데이터 구조의 필드명이 일관성 있게 업데이트되었습니다:

  • 사용자 관련 필드: profileImgUrlimageUrl, userNamenickName
  • 콘텐츠 필드: replyContentcontent
  • 좋아요 관련 필드: initialLikeCountlikeCount, isLike 추가
  • 답글 필드에 replyComment 접두사 적용

TypeScript 인터페이스 변경사항과 완벽히 일치하여 타입 안전성을 보장합니다.

src/components/today-words/MessageInput.tsx (4)

3-4: 답글 기능을 위한 인터페이스 확장이 적절합니다.

선택적 props로 isReplying, targetUserName, onCancelReply가 추가되어 기존 컴포넌트의 호환성을 유지하면서 새로운 기능을 지원합니다.

Also applies to: 19-22


34-34: 이벤트 핸들링 로직이 개선되었습니다.

IME 조합 상태(isComposing)를 추가하여 한글 입력 중 의도치 않은 전송을 방지하고, handleSend 함수로 전송 로직을 통합하여 코드 가독성과 유지보수성이 향상되었습니다.

Also applies to: 45-52, 90-91


64-80: 답글 UI 구현이 깔끔하고 사용자 친화적입니다.

조건부 렌더링으로 답글 상태를 명확히 표시하고, 타겟 사용자명과 취소 기능을 직관적으로 제공합니다. 접근성을 위한 alt 텍스트도 적절히 추가되었습니다.


94-94: 전송 버튼 상태 로직이 간소화되었습니다.

!!value.trim()을 사용한 불린 변환으로 비어있지 않은 입력에 대한 활성/비활성 상태를 명확하게 처리합니다.

src/components/today-words/MessageInput.styled.ts (3)

4-16: 레이아웃 구조 개선이 적절합니다.

Wrapper에 컬럼 방향 플렉스와 gap을 추가하여 답글 UI와 입력창을 적절히 배치할 수 있도록 구조를 개선했습니다. 고정 위치 지정으로 하단 입력창의 안정적인 배치를 유지합니다.

Also applies to: 18-21


32-60: ReplyContainer 스타일링이 체계적으로 구현되었습니다.

플렉스박스 레이아웃으로 답글 알림 영역을 적절히 배치하고, 디자인 시스템의 색상(neongreen, grey)과 타이포그래피를 일관성 있게 적용했습니다. 중첩된 클래스 선택자로 스타일 구조가 명확합니다.


66-66: 입력창과 버튼 스타일링이 적절히 조정되었습니다.

패딩 조정으로 절대 위치 지정된 전송 버튼과의 간격을 확보하고, 고정 높이와 캐럿 색상 설정으로 일관된 사용자 경험을 제공합니다. 전송 버튼의 위치와 정렬도 적절히 조정되었습니다.

Also applies to: 75-75, 78-78, 93-96, 103-103

src/types/post.ts (2)

38-47: SubReplyDataProps 인터페이스가 체계적으로 개선되었습니다.

replyComment 접두사로 대댓글 전용 필드를 명확히 구분하고, isLike 불린 필드 추가로 좋아요 상태 관리가 향상되었습니다. postDate 네이밍으로 다른 날짜 필드와의 일관성도 확보했습니다.


54-62: ReplyDataProps 인터페이스 개선이 일관성과 기능성을 향상시켰습니다.

필드명 간소화(replyContentcontent)와 통일된 네이밍(profileImgUrlimageUrl, userNamenickName)으로 가독성이 개선되었고, isLike 불린 필드 추가로 좋아요 상태 관리가 강화되었습니다.

src/components/common/Post/SubReply.tsx (4)

9-9: 컴포넌트 인터페이스가 업데이트된 타입과 정확히 일치합니다.

useReplyActions 훅 추가와 replyComment 접두사가 붙은 새로운 prop 구조로 답글 기능이 통합되었습니다.

Also applies to: 12-22


23-30: 상태 관리와 답글 기능 통합이 우수합니다.

props에서 초기 상태를 올바르게 설정하고, useReplyActions 훅을 통해 답글 기능을 깔끔하게 통합했습니다. 상태 동기화가 적절히 이루어집니다.


33-34: 좋아요 처리 로직이 개선되었습니다.

함수형 상태 업데이트(prev => !prev)를 사용하여 stale closure 문제를 방지하고, 현재 상태에 기반한 정확한 카운트 업데이트를 구현했습니다.


40-40: UI 개선과 접근성 향상이 적절히 구현되었습니다.

이미지에 적절한 alt 텍스트를 추가하고, 업데이트된 prop 구조를 정확히 반영했습니다. 답글 작성과 좋아요 기능의 이벤트 핸들링도 올바르게 연결되었습니다.

Also applies to: 44-49, 55-56, 60-61

Comment on lines +38 to +40
} catch (error) {
console.error('댓글/답글 작성 실패', error);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

에러 처리에 사용자 피드백이 부족합니다.

현재는 콘솔에만 에러를 로그하고 있어 사용자가 실패를 인지하기 어렵습니다.

사용자에게 에러 상태를 알리는 방법을 고려해보세요:

    } catch (error) {
      console.error('댓글/답글 작성 실패', error);
+     // TODO: 토스트 메시지나 에러 상태 관리를 통한 사용자 피드백 필요
    }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
} catch (error) {
console.error('댓글/답글 작성 실패', error);
}
} catch (error) {
console.error('댓글/답글 작성 실패', error);
// TODO: 토스트 메시지나 에러 상태 관리를 통한 사용자 피드백 필요
}
🤖 Prompt for AI Agents
In src/hooks/useReplyActions.ts around lines 38 to 40, the catch block only logs
the error to the console without notifying the user. To fix this, add a
user-facing error notification mechanism such as setting an error state or
triggering a toast message to inform the user that the reply or comment
submission failed. This will improve user experience by providing clear feedback
on the failure.

Comment thread src/stores/useReplyStore.ts Outdated
Comment thread src/stores/useReplyStore.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ Feature 기능 개발 🎨 Html&css 마크업 & 스타일링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant