Skip to content

fix: 에러 페이지 및 갈등 유형 공유 페이지 개선 - #141

Merged
evenif99 merged 13 commits into
devfrom
feature/error-pages
Jun 24, 2026
Merged

fix: 에러 페이지 및 갈등 유형 공유 페이지 개선#141
evenif99 merged 13 commits into
devfrom
feature/error-pages

Conversation

@wjdalss21

@wjdalss21 wjdalss21 commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • 에러 페이지(error.tsx, global-error.tsx) 뒤로가기 버튼에 히스토리 없을 시 홈(/) 이동 폴백 추가
  • 갈등 유형 공유 링크(/disputes/[id]/type) 비로그인 접근 시 공유자(role_a) 이름 표시
  • 갈등 유형 공유 페이지 커스텀 헤더 → 공통 Header 컴포넌트로 교체
  • 유형 탭(JudgmentTypeResult) 하단 과도한 여백 제거

Test plan

  • 에러 페이지에서 히스토리 없을 때 '이전 페이지로 이동하기' 클릭 → 홈(/)으로 이동 확인
  • 갈등 유형 공유 링크를 비로그인 상태로 접근 → OO님의 갈등 유형은? 표시 확인
  • 갈등 유형 공유 페이지 상단 헤더 공통 스타일 적용 확인
  • 사건 상세 유형 탭에서 버튼 아래 과도한 여백 없는지 확인

🤖 Generated with Claude Code

Summary by CodeRabbit

릴리스 노트

  • 스타일/레이아웃
    • 분쟁 상세 페이지의 콘텐츠 스크롤/레이아웃 동작을 개선했습니다.
    • 분쟁 유형 페이지의 여백·스페이싱 규칙을 조정하고 일부 구성을 정리했습니다.
  • 새 기능
    • 분쟁 유형에 소유자 정보(표시명)를 추가했습니다.
  • 공유 개선
    • 카카오 공유에 기본 이미지/문구 및 공유 링크 구성을 보강했습니다.
    • 모바일 공유/다운로드 흐름을 더 자연스럽게 다듬었습니다.
  • 관리
    • 로컬 전용 문서 무시 설정을 추가했습니다.

wjdalss21 and others added 7 commits June 23, 2026 18:28
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 24, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
talky-owl Ready Ready Preview, Comment Jun 24, 2026 6:51am

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

An error occurred during the review process. Please try again later.

📝 Walkthrough

Walkthrough

분쟁 타입 응답에 ownerName이 추가되고, 관련 화면의 표시와 레이아웃이 함께 조정됩니다. Kakao 공유 타입과 구현이 추가되며 결과 공유 문구와 파일 처리도 바뀝니다. 로컬 전용 TROUBLESHOOTING.md는 Git에서 무시됩니다.

Changes

분쟁 타입 공개 응답과 화면 배치

Layer / File(s) Summary
공개 응답과 서버 페이지 데이터 확장
src/app/api/disputes/[id]/conflict-type/route.ts, src/app/(page)/disputes/[id]/type/page.tsx
ConflictTypePublicDtoownerName을 추가하고, 공개 API와 서버 페이지 조회에서 ROLE_A 참여자의 user.name을 함께 가져와 반환합니다. 서버 페이지 메타데이터의 description 기본 문구도 변경됩니다.
클라이언트 표시와 콘텐츠 배치
src/app/(page)/disputes/[id]/type/ConflictTypeClient.tsx, src/app/(page)/disputes/[id]/type/TypePage.module.scss, src/app/(page)/disputes/[id]/DisputePage.module.scss, src/app/(page)/disputes/[id]/page.tsx
ConflictTypeClient가 로고 이미지를 제거하고 Header를 렌더링하며, 타이틀 분기를 사용자 이름, ownerName, 기본 문구 순으로 재구성합니다. TypePage.module.scss의 여백과 콘텐츠 배치가 바뀌고, DisputePage.module.scss.contentType가 추가되며, 완료 상태에서 judgmentSubTab === 'type'일 때 해당 클래스를 사용하도록 분기합니다.

Kakao 공유와 결과 공유 문구

Layer / File(s) Summary
Kakao 타입과 공유 구현
src/types/kakao.d.ts, src/lib/utils/kakaoShare.ts
Window.Kakao, KakaoShareSettings, KakaoLink 타입이 추가되고, shareDisputeResult가 SSR과 미초기화 Kakao를 가드한 뒤 base URL과 인코딩된 disputeId로 공유 URL을 만들어 Feed payload를 전송합니다.
결과 공유 문구와 파일 처리
src/components/judgement/JudgmentTypeResult.tsx
navigator.share의 문구가 변경되고, 파일 공유 가능 여부에 따라 navigator.share 또는 기존 다운로드 링크를 사용하는 흐름으로 바뀝니다.

로컬 설정 무시 규칙

Layer / File(s) Summary
로컬 전용 파일 무시
.gitignore
.gitignore# Local only 섹션과 TROUBLESHOOTING.md 무시 규칙이 추가됩니다.

Sequence Diagram(s)

sequenceDiagram
  participant JudgmentTypeResult
  participant KakaoUtil
  participant WindowKakao
  JudgmentTypeResult->>KakaoUtil: shareDisputeResult(disputeId, title, description, imageUrl)
  KakaoUtil->>WindowKakao: init(NEXT_PUBLIC_KAKAO_JAVASCRIPT_KEY)
  KakaoUtil->>WindowKakao: Share.sendDefault(feed payload)
  WindowKakao-->>JudgmentTypeResult: 공유 완료
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • I5-Project/TALKY-OWL#53: DisputePage.module.scss.contentType 추가와 disputes/[id]/page.tsx의 content class 분기 변경이 같은 화면 흐름을 수정합니다.
  • I5-Project/TALKY-OWL#124: /api/disputes/[id]/conflict-type 응답과 /disputes/[id]/type 페이지·클라이언트의 같은 공개 타입 화면 구현과 연결됩니다.
  • I5-Project/TALKY-OWL#127: disputes/[id]/page.tsx의 완료 상태 처리와 UI 분기 수정이 이번 변경의 isCompleted 기반 className 선택과 겹칩니다.

Suggested reviewers

  • juahcheon
  • wjdals21

Poem

🐰 토끼가 폴짝, 분쟁 화면을 살피고
ownerName이 반짝, 이름을 더했네
카카오 공유도 슥—길을 열고
Header가 대신 서서 인사했지
로컬 노트는 조용히 숨겨두고
화면이 한결 또렷해졌답니다 ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning 템플릿의 대부분 섹션이 비어 있어 작업 내용, 담당 영역, 관련 이슈, 요구사항, 변경 사항 등이 충분히 채워지지 않았습니다. 템플릿의 1~12번 섹션을 모두 채우고, 특히 작업 내용·담당 작업 영역·관련 Issue·변경 사항·테스트 결과를 구체적으로 작성하세요.
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed 제목이 에러 페이지와 갈등 유형 공유 페이지 개선이라는 핵심 변경을 짧게 잘 요약합니다.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/error-pages

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/app/`(page)/disputes/[id]/page.tsx:
- Line 295: In the className ternary operator on line 295, the condition
checking for judgmentSubTab === 'type' to apply styles.contentType is missing a
check for the activeTab state. Currently, when isCompleted is true and
judgmentSubTab is 'type', the styles.contentType layout is applied regardless of
which tab (activeTab) is actually being viewed, causing the type-specific layout
to leak into non-type tabs like statement. Add an additional condition to verify
that activeTab is set to the appropriate tab (likely 'judgment' based on the
context) alongside the judgmentSubTab === 'type' check, so that
styles.contentType only applies when both conditions are met and the type layout
does not leak to other tabs.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 37b17086-c237-4b5e-bd0b-18f27f160a37

📥 Commits

Reviewing files that changed from the base of the PR and between b075658 and e646b05.

📒 Files selected for processing (6)
  • src/app/(page)/disputes/[id]/DisputePage.module.scss
  • src/app/(page)/disputes/[id]/page.tsx
  • src/app/(page)/disputes/[id]/type/ConflictTypeClient.tsx
  • src/app/(page)/disputes/[id]/type/TypePage.module.scss
  • src/app/(page)/disputes/[id]/type/page.tsx
  • src/app/api/disputes/[id]/conflict-type/route.ts

Comment thread src/app/(page)/disputes/[id]/page.tsx Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/lib/utils/kakaoShare.ts`:
- Around line 20-21: The default title and description strings in the kakaoShare
function do not adhere to the required 4 writing categories (연애, 가족, 친구, 직장).
Replace the current default values for the title and description properties to
use content that falls strictly within one of these allowed categories instead
of the generic "갈등 판결" reference, ensuring the default share message complies
with the coding guidelines for permitted writing categories.
- Line 14: The shareUrl construction in the kakaoShare.ts file does not encode
the disputeId parameter, which can cause the URL to break when special
characters are present in the disputeId. Wrap the disputeId variable with proper
URL encoding using JavaScript's built-in encoding function when constructing the
shareUrl on the line where it's appended to the baseUrl and path. This ensures
that any special characters in the disputeId are properly escaped and the
resulting URL remains valid.
- Line 7: The current guard on line 7 only checks for window.Kakao but fails to
first verify that the window object itself exists, which causes a reference
error in server-side or Node.js contexts. Add a guard check for the window
object existence before accessing window.Kakao by checking if typeof window is
not undefined, ensuring the code handles both browser and server environments
safely.
- Around line 9-11: The Kakao SDK initialization in the code lacks validation
for the environment variable process.env.NEXT_PUBLIC_KAKAO_JAVASCRIPT_KEY before
passing it to window.Kakao.init(). Add a check to ensure that the
NEXT_PUBLIC_KAKAO_JAVASCRIPT_KEY environment variable is defined and not empty
before attempting to initialize the SDK. If the key is missing or invalid,
handle the error appropriately by either logging a meaningful error message or
throwing an exception to prevent silent failures during initialization.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: d2f2da0a-43b7-4729-8e73-9a3bcd731bed

📥 Commits

Reviewing files that changed from the base of the PR and between e646b05 and 5ee4e69.

⛔ Files ignored due to path filters (2)
  • package-lock.json is excluded by !**/package-lock.json
  • public/images/characters/character-error.svg is excluded by !**/*.svg
📒 Files selected for processing (7)
  • .gitignore
  • src/app/(page)/disputes/[id]/DisputePage.module.scss
  • src/app/(page)/disputes/[id]/page.tsx
  • src/app/(page)/disputes/[id]/type/page.tsx
  • src/components/judgement/JudgmentTypeResult.tsx
  • src/lib/utils/kakaoShare.ts
  • src/types/kakao.d.ts
✅ Files skipped from review due to trivial changes (3)
  • src/components/judgement/JudgmentTypeResult.tsx
  • src/types/kakao.d.ts
  • .gitignore
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/app/(page)/disputes/[id]/type/page.tsx
  • src/app/(page)/disputes/[id]/page.tsx
  • src/app/(page)/disputes/[id]/DisputePage.module.scss

Comment thread src/lib/utils/kakaoShare.ts Outdated
Comment thread src/lib/utils/kakaoShare.ts
Comment thread src/lib/utils/kakaoShare.ts Outdated
Comment on lines +20 to +21
title: title ?? '갈등 판결 결과를 확인해보세요!',
description: description ?? '나의 갈등 상황, AI가 판단했어요. 당신은 어떻게 생각하나요?',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

기본 공유 문구를 허용된 4개 카테고리 기준으로 바꿔주세요.

Line 20-21 문구는 현재 카테고리 제한 규칙을 충족하지 않습니다. 허용 범위(연애/가족/친구/직장) 안에서 기본 title/description을 재작성해 주세요.
As per coding guidelines "**/*.{ts,tsx}: Use only 4 writing categories: 연애, 가족, 친구, 직장. Do not use: 관계, 금전, 공간, 시간, 가치관, 역할".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lib/utils/kakaoShare.ts` around lines 20 - 21, The default title and
description strings in the kakaoShare function do not adhere to the required 4
writing categories (연애, 가족, 친구, 직장). Replace the current default values for the
title and description properties to use content that falls strictly within one
of these allowed categories instead of the generic "갈등 판결" reference, ensuring
the default share message complies with the coding guidelines for permitted
writing categories.

Source: Coding guidelines

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/components/judgement/JudgmentTypeResult.tsx (1)

64-77: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

공유 취소 시 이미지가 새 탭으로 열리는 의도치 않은 폴백.

navigator.share({ files })는 사용자가 공유를 취소하면 AbortError를 던집니다. 현재 구조에서는 이 예외가 line 75의 catch로 전파되어 window.open(cardImageUrl, '_blank')가 실행되므로, 단순 취소가 이미지 새 탭 열림으로 이어집니다. handleShare에서는 취소를 빈 catch로 무시하는 것과 동작이 일관되지 않습니다. 취소(AbortError)는 별도로 무시하는 것을 고려하세요.

🛠 제안 수정
       if (navigator.canShare?.({ files: [file] })) {
-        await navigator.share({ files: [file] })
-        return
+        try {
+          await navigator.share({ files: [file] })
+        } catch (e) {
+          if ((e as Error)?.name === 'AbortError') return
+          throw e
+        }
+        return
       }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/judgement/JudgmentTypeResult.tsx` around lines 64 - 77, The
shared-image fallback in JudgmentTypeResult’s share handler is incorrectly
triggered when the user cancels the native share sheet, because
`navigator.share` throws `AbortError` and the current `catch` always falls back
to `window.open`. Update the share flow in `handleShare`/the related share logic
to detect and ignore `AbortError` separately, while still allowing real failures
to use the existing object-URL download or `window.open(cardImageUrl, '_blank')`
fallback.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/app/`(page)/disputes/[id]/type/ConflictTypeClient.tsx:
- Around line 33-35: The share flow in ConflictTypeClient’s handle file-sharing
logic treats user-cancelled navigator.share as an error, which causes the
fallback window.open path to run unnecessarily. Update the share handling around
navigator.share so that AbortError is recognized as a normal cancellation and
returns without opening a new tab, while preserving window.open only for real
share failures and the existing fallback cases.

In `@src/components/judgement/JudgmentTypeResult.tsx`:
- Around line 58-67: Add an explicit fetch success check in JudgmentTypeResult
before converting the response to a blob, since the current share flow can wrap
404/500 error bodies as files. In the same async handler where cardImageUrl is
fetched, mirror the guard used by ConflictTypeClient.handleDownload by verifying
res.ok and throwing an error when it is false, then only proceed to res.blob(),
File creation, and navigator.share. This keeps the sharing behavior consistent
with the download flow and prevents invalid responses from being shared.

---

Outside diff comments:
In `@src/components/judgement/JudgmentTypeResult.tsx`:
- Around line 64-77: The shared-image fallback in JudgmentTypeResult’s share
handler is incorrectly triggered when the user cancels the native share sheet,
because `navigator.share` throws `AbortError` and the current `catch` always
falls back to `window.open`. Update the share flow in `handleShare`/the related
share logic to detect and ignore `AbortError` separately, while still allowing
real failures to use the existing object-URL download or
`window.open(cardImageUrl, '_blank')` fallback.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 35687378-7c6e-4e7f-8b01-9921df259e5d

📥 Commits

Reviewing files that changed from the base of the PR and between fff8b27 and 03fb893.

📒 Files selected for processing (2)
  • src/app/(page)/disputes/[id]/type/ConflictTypeClient.tsx
  • src/components/judgement/JudgmentTypeResult.tsx

Comment thread src/app/(page)/disputes/[id]/type/ConflictTypeClient.tsx Outdated
Comment thread src/components/judgement/JudgmentTypeResult.tsx
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@evenif99
evenif99 merged commit 166dd25 into dev Jun 24, 2026
3 checks passed
@evenif99
evenif99 deleted the feature/error-pages branch June 25, 2026 04:14
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.

2 participants