Skip to content

feat: 기사·견적 상세 카카오톡 공유 및 OG 메타 추가 - #34

Merged
yooseohyeon merged 14 commits into
devfrom
feature/sns-share
Jul 31, 2026
Merged

feat: 기사·견적 상세 카카오톡 공유 및 OG 메타 추가#34
yooseohyeon merged 14 commits into
devfrom
feature/sns-share

Conversation

@yooseohyeon

@yooseohyeon yooseohyeon commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

📋 작업 내용

기사/견적 상세 페이지에서 카카오톡 공유 기능을 구현하고, OG 메타를 추가합니다.


🔥 변경 사항

카카오 공유

  • 카카오 JS SDK 로드·초기화를 hooks/kakao/sdk.ts로 분리
  • sendCustom 기반 공유: hooks/kakao/share.ts
  • 템플릿 ID·JS 키·이미지 URL 순수 유틸: lib/kakao/shareTemplate.ts

OG 메타

  • lib/share/openGraph.ts, metadata.ts, shareText.ts 추가
  • 기사/견적 상세 generateMetadata 연동
  • picsum.photos OG 이미지 호스트 경계 검증 보강 (리뷰 반영)

공유 UI (EstimateDetailShare)

  • 링크 복사: usePageShare + copyLink.ts
  • 카카오: 커스텀 템플릿 직접 호출
  • 페이스북: facebookShare.ts 연동 유지, 버튼은 배포 URL·OG 준비 전까지 비활성화 (FACEBOOK_SHARE_UI_ENABLED = false)
  • 견적 상세(linkAccess="owner"): 권한 안내 인라인 표시
  • 카카오톡 공유 실패 시에만 토스트 출력

적용 페이지

  • movers/[moverId] — 기사 상세 (generateMetadata + 상세 prefetch(HydrationBoundary))
  • estimates/[estimateId] — 받은 견적 상세
  • estimates/pending/[estimateId] — 대기 견적 상세
  • estimates/requests/[estimateRequestId]— 보낸 견적 요청 상세

✅ 체크리스트

  • 로컬에서 정상 동작을 확인했습니다.
  • 기존 기능에 영향을 주지 않는지 확인했습니다.
  • 불필요한 console.log를 제거했습니다.
  • lint를 통과했습니다.
  • README 또는 문서를 수정했습니다. (노션 문서에 환경변수 추가)
  • API 명세와 일치하는지 확인했습니다.

📷 스크린샷 (선택)

견적 상세 페이지: 인라인 문구 표시

스크린샷 2026-07-30 오후 6 38 16

기사 상세 페이지 공유

kakao2

견적 상세 페이지 공유 (일반 고객이 보낸 견적 / 기사가 보낸 견적)

kakao1

기사 상세 페이지 Sharing Debugger로 테스트

스크린샷 2026-07-30 오후 4 07 56 - 테스트를 위해 잠시 ngrok을 사용했어서 주소가 실제와 다릅니다!

💬 To Reviewer

  • 카카오톡 공유는 커스텀 메시지 템플릿(sendCustom)만 사용합니다. sendDefault 경로는 제거했습니다.
  • 견적 공유는 URL은 공유되지만 당사자 본인 계정 로그인 시에만 상세 열람 가능합니다. 그리고 이를 인라인 안내 문구로 사용자에게 알립니다. 이는 임시 조치로 정책이 확정된 후 수정할 예정입니다.
  • 페이스북 공유 기능은 실제 배포 링크가 있어야 작동을 해서 이번 PR에서 제외했습니다. 연동 코드만 남기고 버튼은 비활성입니다. 공개 HTTPS URL + OG 준비 후 FACEBOOK_SHARE_UI_ENABLED만 true로 바꾸면 됩니다.
  • NEXT_PUBLIC_APP_URL, NEXT_PUBLIC_KAKAO_JS_KEY, NEXT_PUBLIC_KAKAO_*_SHARE_TEMPLATE_ID 환경 변수 추가가 필요합니다. 실제 값은 노션 문서에 추가해놓았습니다!
  • 기사 상세 페이지 수정
    • generateMetadata용으로 서버에서 이미 가져온 데이터를 클라이언트 React Query에도 prefetch해서 같은 요청을 두 번 하지 않도록 했습니다. (getMoverDetailCached + prefetch).
    • 다만 이 동작이 실제로 최적화로 이어지는지 확신이 들지 않아서, 추후 삭제할 수 있습니다. 견적 상세 페이지들은 기존처럼 유지했습니다. (메타데이터용 fetch와 화면용 useQuery 둘 다 존재함)

Summary by CodeRabbit

  • 새 기능
    • 견적 및 기사님 상세 페이지의 제목·설명·대표 이미지가 페이지 정보에 맞게 동적으로 표시됩니다.
    • 카카오톡 공유 시 기사님·견적 정보와 프로필 이미지가 포함된 맞춤형 공유를 지원합니다.
    • 공유 링크의 소셜 미리보기가 개선되었습니다.
  • 개선
    • 잘못된 상세 페이지 주소는 일관되게 찾을 수 없음 화면으로 처리됩니다.
    • 기사님 상세 정보 로딩이 개선되어 화면 표시가 더 안정적입니다.
    • 페이스북 공유 버튼은 준비가 완료될 때까지 비활성화됩니다.
    • 소유자 전용 공유 안내가 화면에 명확히 표시됩니다.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

견적·기사 상세 라우트가 동적 메타데이터와 ID 검증을 사용하도록 변경되었습니다. 카카오 SDK 커스텀 공유, 템플릿 데이터 생성, 공유 UI 연결이 추가되었고, 기사 상세에는 서버 프리패치와 hydration이 적용되었습니다.

Changes

공유 및 메타데이터

Layer / File(s) Summary
공유 메타데이터 기반
src/lib/utils/*, src/lib/share/*
앱 절대 URL, 공유 문구, OG 이미지 URL, 견적·기사 상세 메타데이터 생성 및 오류별 fallback을 추가했습니다.
상세 라우트 메타데이터 및 렌더링
src/app/estimates/..., src/app/movers/..., src/lib/api/movers.ts
정적 metadata를 동적 generateMetadata로 전환하고, 양의 정수 ID 파싱 및 notFound() 처리를 적용했습니다. 기사 상세 데이터는 프리패치·hydration하며 React cache 래퍼를 사용합니다.
카카오 SDK 및 공유 전송
src/types/kakao.d.ts, src/hooks/kakao/*, src/lib/kakao/shareTemplate.ts, src/hooks/usePageShare.ts
Kakao SDK 타입·동적 로더·템플릿 ID 파싱·커스텀 공유 성공 콜백을 추가하고 기본 카카오 공유 경로를 제거했습니다.
상세 화면 카카오 공유 연결
src/components/estimate/detail/*, src/components/estimate/{pending,requests}/*, src/components/mover/detail/*, src/components/estimate/RejectedRequestsPage.tsx
상세 데이터로 카카오 템플릿 인자를 구성해 공유 컴포넌트에 전달하고, Facebook 버튼 비활성화 및 owner 안내 UI를 적용했습니다. 다음 페이지 오류 상태 컴포넌트도 변경했습니다.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant DetailPage
  participant EstimateDetailShare
  participant KakaoShareHook
  participant KakaoSDK
  DetailPage->>EstimateDetailShare: 카카오 템플릿 데이터 전달
  EstimateDetailShare->>KakaoShareHook: 커스텀 공유 호출
  KakaoShareHook->>KakaoSDK: SDK 로드·초기화 및 sendCustom
  KakaoSDK-->>EstimateDetailShare: 성공 또는 오류 콜백
Loading

Possibly related PRs

Suggested labels: ♻️ refactor

Suggested reviewers: 9g-g9, youngmis

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 63.04% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 기사·견적 상세에 카카오톡 공유와 OG 메타데이터를 추가한 변경을 정확히 요약합니다.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/sns-share

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

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/lib/kakao/sdk.ts (1)

4-57: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoff

브라우저 SDK 부수효과를 src/lib 밖으로 분리하세요.

SDK script 삽입·초기화·공유 전송은 모두 브라우저 부수효과입니다. 클라이언트 훅 또는 UI 어댑터로 옮기고, src/lib에는 순수한 템플릿 인자·설정 변환만 남기세요.

  • src/lib/kakao/sdk.ts#L4-L57: window/document 기반 SDK 로딩과 초기화를 클라이언트 전용 훅 또는 어댑터로 이동하세요.
  • src/lib/kakao/shareCustom.ts#L49-L77: ensureKakaoSdk()sendCustom() 호출을 해당 클라이언트 계층으로 이동하세요.

As per path instructions, src/lib/**/*.ts: “순수 함수로 작성하고 부수효과를 두지 않습니다.”

🤖 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/kakao/sdk.ts` around lines 4 - 57, Move the browser-dependent SDK
loading and initialization from ensureKakaoSdk in src/lib/kakao/sdk.ts (lines
4-57) into a client-only hook or UI adapter, leaving src/lib with only pure
configuration or template transformations. Also move the ensureKakaoSdk and
sendCustom calls from src/lib/kakao/shareCustom.ts (lines 49-77) into that
client layer; both sites must be updated so src/lib/**/*.ts contains no
window/document access or browser side effects.

Source: Path instructions

🤖 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/kakao/sdk.ts`:
- Around line 13-25: Update the existing-script handling in the Kakao SDK loader
so a load failure removes that script element from the document before
rejecting. Ensure the error listener in the existing-script branch removes the
failed element, allowing subsequent calls to insert and await a fresh script
while preserving the current rejection behavior.

In `@src/lib/share/openGraph.ts`:
- Around line 28-35: Update the hostname check in the URL handling block to
match picsum.photos only when the hostname is exactly picsum.photos or is a
valid subdomain ending with .picsum.photos, preventing unrelated domains such as
notpicsum.photos from matching.

---

Nitpick comments:
In `@src/lib/kakao/sdk.ts`:
- Around line 4-57: Move the browser-dependent SDK loading and initialization
from ensureKakaoSdk in src/lib/kakao/sdk.ts (lines 4-57) into a client-only hook
or UI adapter, leaving src/lib with only pure configuration or template
transformations. Also move the ensureKakaoSdk and sendCustom calls from
src/lib/kakao/shareCustom.ts (lines 49-77) into that client layer; both sites
must be updated so src/lib/**/*.ts contains no window/document access or browser
side effects.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 270782fe-54bb-4c42-9df8-225fc0418b7c

📥 Commits

Reviewing files that changed from the base of the PR and between ba2d8aa and fe1b635.

📒 Files selected for processing (18)
  • src/app/estimates/[estimateId]/page.tsx
  • src/app/estimates/pending/[estimateId]/page.tsx
  • src/app/estimates/requests/[estimateRequestId]/page.tsx
  • src/app/movers/[moverId]/page.tsx
  • src/components/estimate/detail/EstimateDetailShare.tsx
  • src/components/estimate/detail/EstimateDetailView.tsx
  • src/components/estimate/pending/PendingEstimateDetailView.tsx
  • src/components/estimate/requests/EstimateRequestDetailView.tsx
  • src/components/mover/detail/MoverDetailView.tsx
  • src/lib/api/movers.ts
  • src/lib/kakao/sdk.ts
  • src/lib/kakao/shareCustom.ts
  • src/lib/share/copy.ts
  • src/lib/share/metadata.ts
  • src/lib/share/openGraph.ts
  • src/lib/utils/appUrl.ts
  • src/lib/utils/parsePositiveIntId.ts
  • src/types/kakao.d.ts

Comment thread src/hooks/kakao/sdk.ts
Comment thread src/lib/share/openGraph.ts

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/hooks/kakao/share.ts (1)

18-44: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Hook이 아닌 공유 유틸을 src/hooks 밖으로 이동하세요.

이 파일은 React Hook이 아니라 이벤트 핸들러에서 호출되는 SDK 공유 유틸입니다. src/lib/kakao/share.ts로 옮기고 현재 import 경로를 갱신해 Hook 규칙과 모듈 역할을 일치시키세요.

As per path instructions, src/hooks/**/*.{ts,tsx} files and functions must start with 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/hooks/kakao/share.ts` around lines 18 - 44, Move the non-hook
sendKakaoCustomShare utility from the hooks module to src/lib/kakao/share.ts,
then update every import and caller to use the new module path. Preserve its
existing configuration checks, SDK sharing behavior, and error callbacks.

Source: Path instructions

🤖 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/kakao/shareTemplate.ts`:
- Around line 24-25: Update the template ID validation in the parsing logic
around trimmed environment values to accept only positive safe integers. Replace
the finite-number check with Number.isSafeInteger(templateId) and a templateId >
0 condition, returning null for negative, zero, fractional, unsafe, or
non-numeric values before they reach sendCustom.

---

Nitpick comments:
In `@src/hooks/kakao/share.ts`:
- Around line 18-44: Move the non-hook sendKakaoCustomShare utility from the
hooks module to src/lib/kakao/share.ts, then update every import and caller to
use the new module path. Preserve its existing configuration checks, SDK sharing
behavior, and error callbacks.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: d48d5294-1af8-4268-937f-cd88d4ae198a

📥 Commits

Reviewing files that changed from the base of the PR and between fe1b635 and f0a99a3.

📒 Files selected for processing (8)
  • src/components/estimate/detail/EstimateDetailShare.tsx
  • src/components/estimate/detail/EstimateDetailView.tsx
  • src/components/estimate/pending/PendingEstimateDetailView.tsx
  • src/components/estimate/requests/EstimateRequestDetailView.tsx
  • src/components/mover/detail/MoverDetailView.tsx
  • src/hooks/kakao/sdk.ts
  • src/hooks/kakao/share.ts
  • src/lib/kakao/shareTemplate.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/mover/detail/MoverDetailView.tsx

Comment thread src/lib/kakao/shareTemplate.ts Outdated

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

📋 PR 리뷰

👍 좋았던 점

  • 카카오 공유 템플릿 데이터 생성과 SDK 로드·전송 로직을 분리해 역할이 명확했습니다.
  • Kakao SDK가 이미 존재하는지와 초기화 여부를 확인해 중복 로드 및 중복 초기화를 방지했습니다.
  • SDK 로드 실패 시 script를 제거해 이후 재시도가 가능하도록 처리한 점이 좋았습니다.
    환경변수가 누락된 경우와 SDK 실행 중 오류가 발생한 경우를 구분해 사용자에게 Toast로 전달했습니다.
  • 기사 상세와 견적 상세에서 사용하는 공유 문구와 OG 메타 생성 규칙을 공통 모듈로 정리해 이후 문구 수정 범위를 줄였습니다.
  • 기사 상세는 getMoverDetailCached와 React Query prefetch, HydrationBoundary를 함께 사용해 서버에서 조회한 데이터를 클라이언트 초기 캐시에도 전달하도록 구성했습니다.
  • OG 이미지 URL을 절대 경로로 변환하고, 스크랩이 불안정할 수 있는 이미지에는 기본 이미지를 적용하는 방어 로직도 확인했습니다.

🔍 확인 및 제안

인라인 코멘트로 아래 내용을 남겼습니다!

  • 기사 상세의 prefetch는 서버 요청 재사용뿐 아니라 React Query 초기 캐시를 제공하는 목적도 있으므로 현재 구조를 유지해도 괜찮아 보입니다.
  • 카카오 템플릿 ID는 양의 정수 여부까지 검증하면 환경변수 오설정을 조금 더 명확하게 방어할 수 있습니다.

전체적으로 카카오 공유 기능 자체는 공유 UI, 템플릿 데이터, SDK 부수효과, OG 생성 로직을 역할별로 잘 분리했습니다. 다만 견적 상세 페이지는 인증이 필요한 개인 데이터이기 때문에, 외부 크롤러가 해당 데이터를 조회할 수 있는지에 따라 동적 OG의 실제 동작 여부가 달라질 것 같습니다. 이 부분만 먼저 확인한 뒤 승인하는 것이 안전해 보여요. 수고하셨습니다! 😊

Comment thread src/lib/kakao/shareTemplate.ts

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

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 (3)
src/components/estimate/detail/EstimateDetailShare.tsx (2)

155-160: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

페이스북 버튼을 유휴 상태에서도 비활성화하세요.

현재는 isBusy일 때만 비활성화되어 평소에는 shareFacebook이 실행됩니다. PR 목표대로 비활성 상태를 유지하려면 항상 disabled 처리하고 클릭 핸들러를 제거하세요.

🤖 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/estimate/detail/EstimateDetailShare.tsx` around lines 155 -
160, Update the Facebook share button in EstimateDetailShare so it is always
disabled, regardless of isBusy, and remove its shareFacebook onClick handler.
Keep the existing aria-label and aria-busy attributes unchanged.

140-145: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

커스텀 공유도 단일 실행 상태에 포함하세요.

커스텀 분기는 usePageSharebusyAction을 설정하지 않아 SDK 로딩 중에도 버튼이 활성 상태로 남습니다. 연속 클릭하면 sendCustom()이 여러 번 실행될 수 있으니, 커스텀 전송도 공통 exclusive 실행 경로로 감싸세요.

🤖 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/estimate/detail/EstimateDetailShare.tsx` around lines 140 -
145, Update the custom share branch in EstimateDetailShare, using the existing
usePageShare busyAction/exclusive execution path, so custom sending is marked
busy during SDK loading and sendCustom cannot run concurrently. Keep the current
Kakao share behavior unchanged and ensure the custom button remains disabled
while the shared action is in progress.
src/lib/kakao/share.ts (1)

3-103: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

카카오 SDK 로더를 하나로 통합하고 실패한 script는 제거하세요.
src/lib/kakao/share.tssrc/hooks/kakao/sdk.ts가 각각 kakao.min.js를 다른 URL(2.7.4 / 2.7.5)로 넣고, src/lib/kakao/share.ts는 에러 난 script를 DOM에 남깁니다. 같은 화면에서 usePageShareEstimateDetailShare가 둘 다 이 경로를 타면 중복 로드/경합으로 공유가 멈출 수 있으니, 단일 로더 + 단일 버전으로 합치고 실패 시 script를 정리하세요.

🤖 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/kakao/share.ts` around lines 3 - 103, Unify the Kakao SDK loading and
sharing paths across src/lib/kakao/share.ts (lines 3-103),
src/hooks/kakao/sdk.ts (lines 3-64), and src/hooks/kakao/share.ts (lines 18-78)
behind one shared loader using a single SDK version and shared in-flight
promise. Update all affected callers to reuse that loader, and ensure failed
script loads remove the script element and reset loader state before rejecting;
preserve the existing initialization and sharing behavior.

Source: Path instructions

🤖 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/kakao/shareTemplate.ts`:
- Around line 24-25: Update the templateId validation to require
Number.isSafeInteger(templateId) and templateId > 0 instead of Number.isInteger,
ensuring values beyond JavaScript’s safe integer range are rejected before
transmission.

In `@src/lib/share/metadata.ts`:
- Around line 59-80: Refactor generateReceivedEstimateMetadata so it no longer
calls fetchReceivedEstimateDetail or handles ApiError responses. Move the fetch
and 404/fallback policy to the route or src/lib/api layer, and make the share
utility accept received-estimate detail data and only build Metadata through
buildEstimateDetailMetadata while preserving the existing mover and image
fields.

---

Outside diff comments:
In `@src/components/estimate/detail/EstimateDetailShare.tsx`:
- Around line 155-160: Update the Facebook share button in EstimateDetailShare
so it is always disabled, regardless of isBusy, and remove its shareFacebook
onClick handler. Keep the existing aria-label and aria-busy attributes
unchanged.
- Around line 140-145: Update the custom share branch in EstimateDetailShare,
using the existing usePageShare busyAction/exclusive execution path, so custom
sending is marked busy during SDK loading and sendCustom cannot run
concurrently. Keep the current Kakao share behavior unchanged and ensure the
custom button remains disabled while the shared action is in progress.

In `@src/lib/kakao/share.ts`:
- Around line 3-103: Unify the Kakao SDK loading and sharing paths across
src/lib/kakao/share.ts (lines 3-103), src/hooks/kakao/sdk.ts (lines 3-64), and
src/hooks/kakao/share.ts (lines 18-78) behind one shared loader using a single
SDK version and shared in-flight promise. Update all affected callers to reuse
that loader, and ensure failed script loads remove the script element and reset
loader state before rejecting; preserve the existing initialization and sharing
behavior.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 4251d848-d7bf-46f3-a313-fb92a68444be

📥 Commits

Reviewing files that changed from the base of the PR and between 2772fbf and 09b9f36.

📒 Files selected for processing (21)
  • src/app/estimates/[estimateId]/page.tsx
  • src/app/estimates/pending/[estimateId]/page.tsx
  • src/app/estimates/requests/[estimateRequestId]/page.tsx
  • src/app/movers/[moverId]/page.tsx
  • src/components/estimate/RejectedRequestsPage.tsx
  • src/components/estimate/detail/EstimateDetailShare.tsx
  • src/components/estimate/detail/EstimateDetailView.tsx
  • src/components/estimate/pending/PendingEstimateDetailView.tsx
  • src/components/estimate/requests/EstimateRequestDetailView.tsx
  • src/components/mover/detail/MoverDetailView.tsx
  • src/hooks/kakao/sdk.ts
  • src/hooks/kakao/share.ts
  • src/lib/api/movers.ts
  • src/lib/kakao/share.ts
  • src/lib/kakao/shareTemplate.ts
  • src/lib/share/copy.ts
  • src/lib/share/metadata.ts
  • src/lib/share/openGraph.ts
  • src/lib/utils/appUrl.ts
  • src/lib/utils/parsePositiveIntId.ts
  • src/types/kakao.d.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/lib/utils/parsePositiveIntId.ts
  • src/types/kakao.d.ts

Comment thread src/lib/kakao/shareTemplate.ts Outdated
Comment thread src/lib/share/metadata.ts

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

Caution

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

⚠️ Outside diff range comments (1)
src/components/estimate/detail/EstimateDetailShare.tsx (1)

81-173: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

카카오 공유 요청도 버튼 잠금 상태에 포함하세요.

isBusy는 링크 복사·Facebook만 추적합니다. ensureKakaoSdk()를 기다리는 동안 반복 클릭하면 sendCustom이 여러 번 호출될 수 있습니다. 카카오 공유도 ref 기반 가드와 pending state로 감싸고, 세 버튼의 disabled/aria-busy에 반영하세요.

🤖 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/estimate/detail/EstimateDetailShare.tsx` around lines 81 -
173, Update handleKakaoShare to use a ref-based re-entry guard and pending state
while awaiting ensureKakaoSdk/sendCustom, preventing repeated Kakao share calls.
Include the Kakao pending state in the shared busy/disabled logic, and expose it
through the Kakao button’s aria-busy and disabled attributes alongside the
existing copy and Facebook states.
🤖 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.

Outside diff comments:
In `@src/components/estimate/detail/EstimateDetailShare.tsx`:
- Around line 81-173: Update handleKakaoShare to use a ref-based re-entry guard
and pending state while awaiting ensureKakaoSdk/sendCustom, preventing repeated
Kakao share calls. Include the Kakao pending state in the shared busy/disabled
logic, and expose it through the Kakao button’s aria-busy and disabled
attributes alongside the existing copy and Facebook states.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: ad12f46c-f74a-4114-a2c5-048449b3c122

📥 Commits

Reviewing files that changed from the base of the PR and between 09b9f36 and d16d74a.

📒 Files selected for processing (10)
  • src/components/estimate/detail/EstimateDetailShare.tsx
  • src/components/estimate/detail/EstimateDetailView.tsx
  • src/components/estimate/pending/PendingEstimateDetailView.tsx
  • src/components/estimate/requests/EstimateRequestDetailView.tsx
  • src/hooks/kakao/share.ts
  • src/hooks/usePageShare.ts
  • src/lib/kakao/share.ts
  • src/lib/share/metadata.ts
  • src/lib/share/shareText.ts
  • src/lib/share/shareUrl.ts
💤 Files with no reviewable changes (1)
  • src/lib/kakao/share.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/lib/share/metadata.ts

@yooseohyeon
yooseohyeon merged commit d5e2fe8 into dev Jul 31, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants