Skip to content

[FEAT] chat room UI - #80

Merged
Obebe-creator merged 2 commits into
devfrom
feature/chat-room-ui
Aug 7, 2026
Merged

[FEAT] chat room UI#80
Obebe-creator merged 2 commits into
devfrom
feature/chat-room-ui

Conversation

@Obebe-creator

@Obebe-creator Obebe-creator commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

📋 작업 내용

  • 견적 상세에서 채팅방으로 진입할 수 있는 공통 CTA 컴포넌트를 추가했습니다.

    • EstimateChatAction
    • POST /chats/rooms 호출 후 생성되거나 조회된 roomId로 채팅방 페이지 이동
    • 요청 실패 시 공통 Toast로 에러 메시지 표시
  • 대기 견적 상세에 채팅하기 버튼을 추가했습니다.

    • 조율 가능한 SENT 상태에서만 노출
    • 기존 확정/취소 액션 영역 아래에 배치
  • 보낸 견적 상세에 채팅하기 버튼을 추가했습니다.

    • 조율 가능한 SENT 상태에서만 노출
    • 우측 action column에 200px outline CTA 형태로 배치
  • 채팅방 페이지 이동 경로를 추가했습니다.

    • APP_ROUTES.CHATS.ROOM(roomId)
    • /chats/:roomId
  • 견적 상세 aside 폭을 명시적으로 320px로 조정했습니다.


🔥 변경 사항

  • src/components/estimate/detail/EstimateChatAction.tsx
  • src/components/estimate/pending/PendingEstimateDetailView.tsx
  • src/components/estimate/sent/SentEstimateChatAction.tsx
  • src/components/estimate/sent/SentEstimateDetailPage.tsx
  • src/components/estimate/detail/EstimateDetailLayout.tsx
  • src/lib/constants/appRoutes.ts

✅ 체크리스트

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

📷 스크린샷 (선택)

image

🔗 관련 이슈

Closes #


💬 To Reviewer

Summary by CodeRabbit

  • 새로운 기능

    • 견적 상세 화면에서 관련 채팅방으로 바로 이동할 수 있는 버튼을 추가했습니다.
    • 버튼을 누르면 채팅방을 생성하거나 기존 채팅방을 조회한 뒤 이동합니다.
    • 처리 중에는 버튼이 비활성화되며, 오류 발생 시 안내 메시지가 표시됩니다.
    • 전송된 견적 상태에서만 채팅방 진입 버튼이 노출됩니다.
  • 개선

    • 견적 상세 화면의 사이드 영역 너비와 레이아웃을 조정했습니다.
    • 채팅방 상세 페이지로 이동하는 경로를 지원합니다.

@vercel

vercel Bot commented Aug 7, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
moving-frontend Ready Ready Preview Aug 7, 2026 2:00am
moving-frontend-p2ol Ready Ready Preview Aug 7, 2026 2:00am

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

견적 상세 화면에 채팅방 진입 CTA가 추가되었습니다. CTA는 채팅방을 생성하거나 조회한 뒤 상세 화면으로 이동합니다. SENT 상태의 대기·보낸 견적에 CTA를 표시하며, 채팅 라우트와 사이드 영역 너비를 업데이트했습니다.

Changes

견적 채팅방 진입

Layer / File(s) Summary
채팅 라우트와 진입 처리
src/lib/constants/appRoutes.ts, src/components/estimate/detail/EstimateChatAction.tsx
APP_ROUTES.CHATS.ROOM/chats/{roomId} 경로를 생성합니다. EstimateChatAction은 채팅방을 준비한 뒤 이동하며, 처리 중 버튼을 비활성화하고 오류를 토스트로 표시합니다.
대기 견적 상세 통합
src/components/estimate/pending/PendingEstimateDetailView.tsx
견적 상태가 SENT일 때 기존 액션 아래에 전체 너비의 EstimateChatAction을 표시합니다.
보낸 견적 상세 통합
src/components/estimate/sent/SentEstimateChatAction.tsx, src/components/estimate/sent/SentEstimateDetailPage.tsx, src/components/estimate/detail/EstimateDetailLayout.tsx
SentEstimateChatAction이 공통 CTA를 감쌉니다. SENT 상태에서 CTA를 사이드 영역에 표시하고, 레이아웃의 xl 사이드 너비를 320px로 지정합니다.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: yooseohyeon

Sequence Diagram(s)

sequenceDiagram
  participant 견적 상세 화면
  participant EstimateChatAction
  participant 채팅방 API
  participant 라우터
  견적 상세 화면->>EstimateChatAction: estimateId 전달
  EstimateChatAction->>채팅방 API: 채팅방 생성 또는 조회 요청
  채팅방 API-->>EstimateChatAction: roomId 반환
  EstimateChatAction->>라우터: /chats/{roomId}로 이동
  라우터-->>견적 상세 화면: 채팅방 상세 화면 표시
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 견적 상세 화면에 채팅방 진입 UI와 라우트를 추가한 변경을 직접 설명하며, 주요 변경 사항과 관련성이 높습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/chat-room-ui

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.

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

🧹 Nitpick comments (3)
src/components/estimate/sent/SentEstimateChatAction.tsx (1)

11-12: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

불필요한 래퍼 컴포넌트를 제거하세요.

SentEstimateChatActionEstimateChatAction에 같은 estimateId를 전달할 뿐입니다. SentEstimateDetailPage에서 EstimateChatAction을 직접 렌더링하세요. 별도 래퍼를 유지하면 공통 CTA의 API가 변경될 때 수정 지점이 늘어납니다.

As per coding guidelines, “기존 공통 컴포넌트를 우선 재사용하고, 중복 컴포넌트를 만들지 않는다” 규칙을 적용했습니다.

🤖 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/sent/SentEstimateChatAction.tsx` around lines 11 -
12, Remove the redundant SentEstimateChatAction wrapper and update
SentEstimateDetailPage to render EstimateChatAction directly with the existing
estimateId prop. Update imports and references accordingly, without changing
EstimateChatAction’s API or behavior.

Sources: Coding guidelines, Path instructions

src/components/estimate/pending/PendingEstimateDetailView.tsx (1)

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

채팅 CTA 상태 조건의 단일 기준을 사용하세요.

"SENT" 상태 리터럴이 두 상세 화면에 반복됩니다. 기존 견적 상태 상수 또는 상태 타입이 있으면 두 위치에서 재사용하세요. 없다면 도메인 상수를 정의하고 두 CTA 조건이 같은 값을 참조하게 하세요.

  • src/components/estimate/pending/PendingEstimateDetailView.tsx#L46-L46: 공통 상태 상수 또는 타입 기반 값으로 조건을 변경하세요.
  • src/components/estimate/sent/SentEstimateDetailPage.tsx#L130-L130: 같은 공통 상태 값으로 조건을 변경하세요.

As per path instructions, “매직 넘버·매직 스트링을 지양”해야 합니다.

#!/bin/bash
set -euo pipefail

# 기존 견적 상태 상수와 상태 타입을 찾습니다.
rg -n -C 2 --glob '*.{ts,tsx}' '\bESTIMATE_STATUS\b|\bEstimateStatus\b|\bstatus\s*===\s*"SENT"' src
🤖 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/pending/PendingEstimateDetailView.tsx` at line 46, 채팅
CTA 조건의 매직 문자열을 공통 견적 상태 상수 또는 타입 기반 값으로 대체하세요.
src/components/estimate/pending/PendingEstimateDetailView.tsx 46-46의
showChatAction과 src/components/estimate/sent/SentEstimateDetailPage.tsx 130-130의
동일한 조건이 하나의 공통 상태 값을 참조하도록 기존 ESTIMATE_STATUS 또는 EstimateStatus를 재사용하고, 없다면 도메인
상태 상수를 정의해 두 위치에 적용하세요.
src/components/estimate/detail/EstimateChatAction.tsx (1)

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

w-[200px] 대신 spacing 유틸을 사용하세요.

w-[200px]는 공유 CTA에 임의 폭 값을 추가합니다. 구성에서 기본 spacing scale을 변경하지 않았다면 w-50으로 교체하세요.

수정 예시
- className={cn("w-[200px] whitespace-nowrap", buttonClassName)}
+ className={cn("w-50 whitespace-nowrap", buttonClassName)}

As per coding guidelines, “arbitrary value를 최소화”하고 “기존 design tokens”를 사용해야 합니다.

#!/bin/bash
set -euo pipefail

# Tailwind spacing 유틸과 기존 CTA 폭 사용 방식을 확인합니다.
rg -n -C 2 --glob '*.{ts,tsx}' 'w-\[200px\]|\bw-50\b' src
fd -a 'tailwind.config.*' . -x sed -n '1,240p' {}
🤖 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/EstimateChatAction.tsx` at line 48,
EstimateChatAction의 CTA className에서 임의 폭 유틸리티 w-[200px]를 기본 spacing scale 토큰인
w-50으로 교체하고, 기존 cn 조합과 buttonClassName 동작은 유지하세요.
🤖 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.

Nitpick comments:
In `@src/components/estimate/detail/EstimateChatAction.tsx`:
- Line 48: EstimateChatAction의 CTA className에서 임의 폭 유틸리티 w-[200px]를 기본 spacing
scale 토큰인 w-50으로 교체하고, 기존 cn 조합과 buttonClassName 동작은 유지하세요.

In `@src/components/estimate/pending/PendingEstimateDetailView.tsx`:
- Line 46: 채팅 CTA 조건의 매직 문자열을 공통 견적 상태 상수 또는 타입 기반 값으로 대체하세요.
src/components/estimate/pending/PendingEstimateDetailView.tsx 46-46의
showChatAction과 src/components/estimate/sent/SentEstimateDetailPage.tsx 130-130의
동일한 조건이 하나의 공통 상태 값을 참조하도록 기존 ESTIMATE_STATUS 또는 EstimateStatus를 재사용하고, 없다면 도메인
상태 상수를 정의해 두 위치에 적용하세요.

In `@src/components/estimate/sent/SentEstimateChatAction.tsx`:
- Around line 11-12: Remove the redundant SentEstimateChatAction wrapper and
update SentEstimateDetailPage to render EstimateChatAction directly with the
existing estimateId prop. Update imports and references accordingly, without
changing EstimateChatAction’s API or behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 480ee134-a108-4eb8-8e97-5d9b66bfc044

📥 Commits

Reviewing files that changed from the base of the PR and between d54cfd4 and 62bbb0f.

📒 Files selected for processing (6)
  • src/components/estimate/detail/EstimateChatAction.tsx
  • src/components/estimate/detail/EstimateDetailLayout.tsx
  • src/components/estimate/pending/PendingEstimateDetailView.tsx
  • src/components/estimate/sent/SentEstimateChatAction.tsx
  • src/components/estimate/sent/SentEstimateDetailPage.tsx
  • src/lib/constants/appRoutes.ts

@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 리뷰

👍 좋았던 점

  • 견적 상세에서 채팅방으로 진입하는 공통 CTA를 별도 컴포넌트로 분리했습니다.
  • 고객 대기 견적과 기사 보낸 견적이 동일한 채팅방 생성·조회 API 흐름을 재사용합니다.
  • POST /chats/rooms 응답에서 반환된 실제 roomId를 사용해 채팅 상세 페이지로 이동합니다.
  • 채팅방이 기존에 존재하는 경우와 새로 생성되는 경우를 화면에서 별도로 분기하지 않고 동일하게 처리했습니다.
  • 요청 중 버튼을 비활성화해 중복 실행을 방지하고 aria-busy도 함께 제공했습니다.
  • API 실패 시 공통 오류 메시지 변환과 Toast를 사용해 현재 상세 화면을 유지하면서 재시도할 수 있도록 했습니다.
  • 고객 대기 견적과 기사 보낸 견적 모두 조율 가능한 SENT 상태에서만 채팅 CTA를 노출했습니다.
  • 고객 상세에서는 기존 확정·취소 액션 아래에 채팅 버튼을 배치해 기존 액션 우선순위를 유지했습니다.
  • 기사 상세에서는 우측 action column에 별도 CTA를 배치해 본문 정보와 행동 영역을 구분했습니다.
  • 채팅방 경로를 APP_ROUTES.CHATS.ROOM()으로 상수화했습니다.
  • 상세 Layout의 aside 폭을 320px로 명시해 Desktop 레이아웃 의도를 더 분명하게 했습니다.
  • 보낸 견적 상세 일부 레이아웃 값을 공통 상수로 재사용하도록 정리했습니다.
  • 현재 PR은 열려 있고 병합 가능한 상태이며, 변경 파일 6개로 범위가 명확합니다.

🔍 확인 및 제안

채팅방 요청 실패 후 재시도할 때 이전 Toast가 요청 중에도 유지될 수 있으므로,
재시도 시작 시 기존 오류 메시지를 초기화하면 상태 표현이 조금 더 깔끔해질 수 있습니다.

또한 이번 변경에서 공통 aside 폭을 xl:w-[320px]로 명시했지만,
보낸 견적 상세에서는 별도로 xl:w-80을 전달하고 있습니다.

현재 Tailwind 기준으로 동일한 320px라면 화면 문제는 없지만,
명시적인 320px 통일이 목적이라면 공통 asideClassName을 재사용하거나
같은 표현으로 맞추는 편이 유지보수에는 더 명확해 보입니다.

SentEstimateChatAction은 현재 단순 Wrapper이므로
향후 기사 전용 정책이나 스타일을 추가할 계획이 없다면
공통 EstimateChatAction을 직접 사용하는 방식도 고려할 수 있습니다.

전체적으로 기존 견적 기능을 변경하지 않고
채팅방 진입만 공통 CTA로 안전하게 추가한 구조로 보입니다.

수고하셨습니다! 😊

Comment thread src/components/estimate/detail/EstimateChatAction.tsx
Comment thread src/components/estimate/detail/EstimateDetailLayout.tsx
@Obebe-creator
Obebe-creator merged commit b0630f7 into dev Aug 7, 2026
4 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Aug 15, 2026
6 tasks
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