Skip to content

Comments

[FEATURE] 신고하기 기능 에러 처리#150

Open
sunhwaaRj wants to merge 4 commits intodevelopfrom
feature/#149-report-error
Open

[FEATURE] 신고하기 기능 에러 처리#150
sunhwaaRj wants to merge 4 commits intodevelopfrom
feature/#149-report-error

Conversation

@sunhwaaRj
Copy link
Contributor

@sunhwaaRj sunhwaaRj commented Feb 2, 2026

✅ PR 유형

어떤 변경 사항이 있었나요?

  • 새로운 기능 추가
  • 버그 수정
  • 코드에 영향을 주지 않는 변경사항(오타 수정, 탭 사이즈 변경, 변수명 변경)
  • 코드 리팩토링
  • 주석 추가 및 수정
  • 문서 수정
  • 빌드 부분 혹은 패키지 매니저 수정
  • 파일 혹은 폴더명 수정
  • 파일 혹은 폴더 삭제

📌 관련 이슈번호


✅ Key Changes

  • 키워드 코멘트 신고 시 에러 처리
  • 중복 키워드 프론트측에서도 막기

📸 스크린샷 or 실행영상

2026-02-03.000155.mp4

🎸 기타 사항 or 추가 코멘트

Summary by CodeRabbit

  • 새로운 기능

    • 신고 오류 시 별도 오류 모달로 안내(열리면 자동으로 닫힘)
    • 신고 제출 중 버튼에 로딩 스피너 표시 및 버튼 비활성화
    • 하단 댓글 시트의 최대 높이 조정(화면 내 표시 개선)
  • 버그 수정

    • 중복 신고 제출 방지
    • 제출 실패 시 인라인 오류 대신 오류 모달로 전환하여 안내

@sunhwaaRj sunhwaaRj self-assigned this Feb 2, 2026
@sunhwaaRj sunhwaaRj added the FEATURE 기능 구현 label Feb 2, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 2, 2026

Walkthrough

신고 제출 흐름에 로딩 및 중복 제출 방지 로직을 추가하고, 실패 시 3초 자동 닫힘하는 별도 에러 모달을 새로 등록하여 에러 표시 방식을 변경했습니다.

Changes

Cohort / File(s) Summary
신고 완료 모달 수정
src/components/modal/ReportCompleteModal.tsx
모달 컨텍스트(openModal) 사용 추가, usePostReportCommentisPending 관리로 중복 제출 방지, 제출 중 버튼 비활성화 및 스피너 표시, 실패 시 인라인 토스트 대신 reportError 모달 오픈으로 에러 처리 변경
신고 에러 모달 신규 생성
src/components/modal/ReportErrorModal.tsx
BaseModal 기반 새 컴포넌트 추가: isOpen/onClose props, 열릴 때 3초 타이머로 자동 닫힘, 타이머 정리 로직 포함, 이미지와 한 줄 텍스트로 구성
모달 설정 업데이트
src/constants/ModalList.ts
MODAL_COMPONENTSModalPropsMapreportError: ReportErrorModalreportError: BaseModalProps 매핑 추가

Sequence Diagram(s)

mermaid
sequenceDiagram
participant User as 사용자
participant ReportModal as ReportCompleteModal
participant API as usePostReportComment
participant ModalSvc as ModalContext
participant ErrorModal as ReportErrorModal

User->>ReportModal: 신고 내용 입력 후 제출 클릭
ReportModal->>ReportModal: isPending 확인, 중복 제출 차단
ReportModal->>API: 신고 요청 전송
API-->>ReportModal: 실패 응답
ReportModal->>ModalSvc: openModal('reportError')
ModalSvc->>ErrorModal: open(isOpen=true)
ErrorModal->>ErrorModal: 3초 타이머 시작
ErrorModal->>ModalSvc: onClose 호출 (3초 후)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested reviewers

  • woneeeee
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목은 신고 기능의 에러 처리라는 주요 변경사항을 명확하고 간결하게 요약하고 있습니다.
Description check ✅ Passed PR 설명은 템플릿 구조를 따르며 PR 유형, 관련 이슈번호, 주요 변경사항, 실행영상을 포함하고 있습니다.
Linked Issues check ✅ Passed PR은 #149의 요구사항을 충족하고 있습니다: 에러 처리(ReportErrorModal 추가, 실패 시 모달 표시), 중복 제출 방지(isPending으로 버튼 비활성화), 로딩 인디케이터(pending 중 스피너 표시).
Out of Scope Changes check ✅ Passed 모든 변경사항이 신고 기능 에러 처리와 중복 제출 방지라는 범위 내에 있으며, 관련 이슈 #149의 목표와 일치합니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/#149-report-error

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 and usage tips.

Copy link

@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: 1

🤖 Fix all issues with AI agents
In `@src/components/modal/ReportErrorModal.tsx`:
- Around line 30-31: In ReportErrorModal, the paragraph under the
already-reported heading contains a placeholder ("어쩌구저쩌구"); update the
user-facing copy in the <p> element (inside ReportErrorModal, the element with
classes "body-10 desktop:body-6 text-gray-700") to a proper Korean guidance
message (e.g., explain that the keyword has already been reported, what to
expect next, and how to contact support if needed) so the modal shows a real
instructional message instead of the placeholder.

Comment on lines 30 to 31
<h3 className="body-7 desktop:title-3 text-gray-800">이미 신고된 키워드입니다.</h3>
<p className="body-10 desktop:body-6 text-gray-700">어쩌구저쩌구</p>
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

사용자 메시지에 플레이스홀더 문구가 남아 있습니다.
실제 안내 문구로 교체해주세요.

📝 제안 수정안
-        <p className="body-10 desktop:body-6 text-gray-700">어쩌구저쩌구</p>
+        <p className="body-10 desktop:body-6 text-gray-700">
+          이미 신고된 키워드입니다. 다른 키워드를 선택해 주세요.
+        </p>
📝 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
<h3 className="body-7 desktop:title-3 text-gray-800">이미 신고된 키워드입니다.</h3>
<p className="body-10 desktop:body-6 text-gray-700">어쩌구저쩌구</p>
<h3 className="body-7 desktop:title-3 text-gray-800">이미 신고된 키워드입니다.</h3>
<p className="body-10 desktop:body-6 text-gray-700">
이미 신고된 키워드입니다. 다른 키워드를 선택해 주세요.
</p>
🤖 Prompt for AI Agents
In `@src/components/modal/ReportErrorModal.tsx` around lines 30 - 31, In
ReportErrorModal, the paragraph under the already-reported heading contains a
placeholder ("어쩌구저쩌구"); update the user-facing copy in the <p> element (inside
ReportErrorModal, the element with classes "body-10 desktop:body-6
text-gray-700") to a proper Korean guidance message (e.g., explain that the
keyword has already been reported, what to expect next, and how to contact
support if needed) so the modal shows a real instructional message instead of
the placeholder.

Copy link

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

🧹 Nitpick comments (1)
src/app/(main)/teampsylog/_components/BottomComment.tsx (1)

41-42: maxHeight 중복 및 h-full 레이아웃 오버플로우

두 가지 연관된 문제가 있습니다.

  1. maxHeight 중복: height가 이미 '80vh'로 고정되어 있으므로 maxHeight: '80vh'는 아무런 효과가 없습니다. maxHeightheightauto이거나 가변적일 때만 의미가 있습니다. 의도가 "컨텐츠가 적으면 더 작게, 최대 80vh"였다면 height: 'auto', maxHeight: '80vh'로 설정해야 합니다. 단순히 고정 높이라면 maxHeight를 제거하면 됩니다.

  2. h-full 오버플로우: 62번 줄의 컨텐츠 div에 h-full이 적용되면 부모의 높이인 80vh를 그대로 가져갑니다. 그런데 부모 내부에는 드래그 핸들 div(pt-3 pb-2 + 3px 바 ≈ 약 36~40px)도 포함되어 있으므로, 실제 총 높이가 80vh를 초과하여 바텀 시트 컨테이너를 벗어납니다. 부모에 overflow: hidden이 없기 때문에 스크롤 영역이 라운드 컨테이너 밖으로 누출될 수 있습니다.

Flexbox 레이아웃으로 개선하면 드래그 핸들과 스크롤 영역 간의 높이 분배를 정확하게 처리할 수 있습니다.

♻️ Flexbox 레이아웃 + maxHeight 정리 제안
  <div
    className="desktop:hidden fixed inset-x-0 bottom-0 z-50 rounded-t-2xl bg-gray-200"
    style={{
-     height: '80vh',
      maxHeight: '80vh',
      transform: isDragging
        ? `translateY(${dragCurrentY}px)`
        : isOpen && !isClosing
          ? 'translateY(0)'
          : 'translateY(100%)',
      transition: isDragging ? 'none' : 'transform 0.3s ease-out',
      visibility: shouldShow ? 'visible' : 'hidden',
      pointerEvents: shouldShow ? 'auto' : 'none',
    }}
+   className="desktop:hidden fixed inset-x-0 bottom-0 z-50 flex flex-col rounded-t-2xl bg-gray-200"
  >
    <div
      className="flex cursor-grab justify-center pt-3 pb-2 active:cursor-grabbing"
      ...
    >
      <div className="h-[3px] w-9.5 rounded-full bg-gray-400" />
    </div>
-   <div className="h-full overflow-y-auto pb-5">{children}</div>
+   <div className="min-h-0 flex-1 overflow-y-auto pb-5">{children}</div>
  </div>

height: auto + maxHeight: '80vh' 조합을 사용하면 컨텐츠 적을 때 자연스럽게 줄어들고, flexbox의 flex-1 min-h-0으로 스크롤 영역이 나머지 공간을 정확히 채웁니다. (min-h-0은 flex item이 overflow: auto와 함께 올바르게 축소되도록 하는 데 필요합니다.)

Also applies to: 62-62

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/app/`(main)/teampsylog/_components/BottomComment.tsx around lines 41 -
42, The container in BottomComment.tsx sets both height: '80vh' and maxHeight:
'80vh' and a child content div uses h-full causing overflow; change the
container to height: 'auto' and maxHeight: '80vh' (or simply remove maxHeight if
you want a fixed 80vh), make the container a column flexbox, add overflow-hidden
on the container, and replace the child content div's h-full with flex-1 min-h-0
and overflow-auto so the drag handle (the pt-3 pb-2 div) no longer causes the
scroll area to overflow the rounded bottom sheet.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/app/`(main)/teampsylog/_components/BottomComment.tsx:
- Around line 41-42: The container in BottomComment.tsx sets both height: '80vh'
and maxHeight: '80vh' and a child content div uses h-full causing overflow;
change the container to height: 'auto' and maxHeight: '80vh' (or simply remove
maxHeight if you want a fixed 80vh), make the container a column flexbox, add
overflow-hidden on the container, and replace the child content div's h-full
with flex-1 min-h-0 and overflow-auto so the drag handle (the pt-3 pb-2 div) no
longer causes the scroll area to overflow the rounded bottom sheet.

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.

[FEATURE] 신고하기 기능 에러 처리

1 participant