Skip to content

[FEAT] 투표·댓글 신고 기능 연동 - #154

Merged
Emithen merged 3 commits into
mainfrom
feat/report-user
Aug 5, 2026
Merged

[FEAT] 투표·댓글 신고 기능 연동#154
Emithen merged 3 commits into
mainfrom
feat/report-user

Conversation

@Emithen

@Emithen Emithen commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

‼️ ISSUE

서버에는 신고 API가 이미 구현되어 있었으나 웹에 연동되어 있지 않았습니다. (#84 의 미체크 항목 "신고 기능")

✅ 작업 내용

사용자 신고(Phase 1)만 포함합니다. CMS 관리자 신고 처리 화면은 후속 PR 예정.

  • api/report.tscreateReport() + ReportType/ReportReason 타입, 사유 9종 라벨(서버 ReportReason enum과 1:1), 상세 내용 1,000자 상수
  • ui/modal/reportSheet.tsx — 신고 사유 선택 + 상세 내용(선택) 바텀시트
  • hooks/utils/useReportAction.tsx — 로그인 게이트 → 시트 → 제출 → 결과 팝업 공용 훅
  • _shared/moreMenu.tsx — 케밥(⋮) 드롭다운 공용화. commentDetail 에 인라인으로 있던 메뉴를 대체
  • 진입점: 투표 상세 헤더 , 댓글·대댓글
  • ui/sheet.tsx — shadcn 기본 타이포(text-lg font-semibold, text-sm)를 typo-* 토큰으로 교체 (AGENTS.md §8)

사용 API

Method Endpoint 비고
POST /report/{targetId} body { reportType, reason, content? } · 로그인 필요

메뉴 노출 규칙

상황 처리
본인 게시글·댓글 신고 메뉴 미노출 (서버도 400 거부)
삭제된 댓글 신고 메뉴 미노출 (서버 응답 기준 deletedAt)
비로그인 메뉴는 노출, 클릭 시 로그인 유도 팝업 → 복귀 경로 유지
중복 신고 서버 400 이미 신고한 대상입니다. 메시지를 그대로 팝업 노출

🧪 검증

dev 서버 + dev 백엔드, 375×812 기준으로 확인:

  • 게시글/댓글/대댓글 → 신고 진입, 비로그인 시 로그인 유도 팝업
  • 바텀시트: 사유 9개 + 상세 입력, 하단 제출 버튼 고정, 사유 미선택 시 비활성
  • 삭제된 댓글 메뉴 미노출 / 살아있는 댓글 메뉴 노출
  • tsc --noEmit, eslint, prettier --check 통과

미검증: 로그인이 필요한 실제 POST 성공·중복 신고 팝업 경로 (리뷰 시 확인 부탁드립니다)

📝 영향받는 SCR-ID

  • SCR-POLL-001 — 레이아웃·사용자 액션·시나리오·예외 상황·사용 API 갱신

🔎 참고

  • 서버에 신고 취소 / 관리자 처리 상태(반려·완료) 엔드포인트가 없습니다. CMS 화면에서 처리 상태 개념이 필요하면 서버 스펙 논의가 선행되어야 합니다.
  • 내가 이미 신고했는지 조회하는 API가 없어 버튼 사전 비활성화는 불가, 400 응답으로 안내합니다.
  • Comment/Reply 인터페이스의 deleted: boolean 필드는 서버가 내려주지 않아 항상 undefined 입니다. 이번 PR에서는 손대지 않고 deletedAt 을 사용했습니다.

🤖 Generated with Claude Code

서버에 구현되어 있던 신고 API(POST /report/{targetId})를 웹에 연동한다.

- api/report.ts: createReport + ReportType/ReportReason 타입, 사유 9종 라벨(서버 enum과 1:1)
- reportSheet: 사유 선택 + 상세 내용(선택, 1000자) 바텀시트
- useReportAction: 로그인 게이트 → 시트 → 제출 → 결과 팝업 공용 훅
- moreMenu: 케밥 드롭다운 공용화 (commentDetail 인라인 메뉴 대체)
- 진입점: 투표 상세 헤더 ⋮, 댓글·대댓글 ⋮
  - 본인 글/댓글은 메뉴에서 제외 (서버도 400으로 거부)
  - 삭제된 댓글은 제외 (서버 응답 기준 deletedAt)
  - 비로그인은 메뉴 노출 후 클릭 시 로그인 유도
- sheet 프리미티브 타이포를 typo-* 토큰으로 교체 (AGENTS.md §8)

영향받는 문서: SCR-POLL-001

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
valan-se-web Ready Ready Preview Aug 2, 2026 10:41pm
valan-se-web-cms-19s6 Ready Ready Preview Aug 2, 2026 10:41pm
valanse-origin-repo Ready Ready Preview Aug 2, 2026 10:41pm

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 84738063-d49c-4100-8ef1-fb7781a2825b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/report-user

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

Comment @coderabbitai help to get the list of available commands.

관리자가 신고를 처리하기 전까지, 신고한 사용자에게만 해당 콘텐츠를 가린다.

서버에 "내가 이 대상을 신고했는지" 알려주는 필드·API 가 없어서
신고한 대상 id 를 localStorage 에 보관하고 그것을 기준으로 가린다.
서버가 reportedByMe 같은 값을 내려주면 저장소만 교체하면 된다.

- utils/reportedContent: 신고 대상 id 로컬 저장 + 구독. 다른 탭 storage
  이벤트 반영, JSON 파손·저장 실패 방어
- useReportedContent: useSyncExternalStore 구독 훅. 서버 스냅샷을 비워
  hydration 불일치 방지
- useReportAction: 신고 성공 시 markReported 기록
- commentDetail: 신고한 댓글·대댓글은 작성자·본문·좋아요·⋮ 를 모두 감추고
  "신고한 콘텐츠입니다" 만 노출 (원문 보기 토글 없음)
- mainPage·balansePage: 신고한 투표는 목록에서 제외, 비면 기존 EmptyState

한계: 기기·브라우저 단위라 다른 기기에서는 다시 보인다.

영향받는 문서: SCR-POLL-001, SCR-HOME-001, SCR-BALANSE-001

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant