Skip to content

136 refactor 채팅 UI 문의하기 라우트 경로 기본 질문 내용 수정#137

Merged
ff1451 merged 3 commits intodevelopfrom
136-refactor-채팅-ui-문의하기-라우트-경로-기본-질문-내용-수정
Feb 26, 2026

Hidden character warning

The head ref may contain hidden characters: "136-refactor-\ucc44\ud305-ui-\ubb38\uc758\ud558\uae30-\ub77c\uc6b0\ud2b8-\uacbd\ub85c-\uae30\ubcf8-\uc9c8\ubb38-\ub0b4\uc6a9-\uc218\uc815"
Merged

136 refactor 채팅 UI 문의하기 라우트 경로 기본 질문 내용 수정#137
ff1451 merged 3 commits intodevelopfrom
136-refactor-채팅-ui-문의하기-라우트-경로-기본-질문-내용-수정

Conversation

@ff1451
Copy link
Copy Markdown
Collaborator

@ff1451 ff1451 commented Feb 26, 2026

Summary by CodeRabbit

릴리스 노트

  • New Features

    • 채팅 입력 텍스트 영역이 입력 내용에 따라 자동으로 높이를 조정하도록 개선했습니다.
  • Refactor

    • 사용자 문의 기능을 관리자 채팅으로 통합하여 더 효율적인 소통 환경을 제공합니다.

@ff1451 ff1451 self-assigned this Feb 26, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 26, 2026

📝 Walkthrough

Walkthrough

ChatRoom 컴포넌트에 textarea 자동 크기 조정 기능을 추가했으며, 관리자 채팅 생성 로직을 새로운 useAdminChatMutation 훅으로 추상화했습니다. 이 훅은 MyPage와 Profile 컴포넌트에서 중복되던 mutation 및 네비게이션 로직을 통합합니다. ManagedRecruitmentForm에서는 기본 phone-question 상수를 제거하여 초기 질문 목록을 정확히 관리합니다.

Possibly related PRs

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목이 변경사항의 주요 내용을 반영하고 있습니다. 채팅 UI 리팩토링, 문의하기 라우트 경로 수정, 기본 질문 내용 수정 등 주요 변경사항을 포함하고 있습니다.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 136-refactor-채팅-ui-문의하기-라우트-경로-기본-질문-내용-수정

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

Copy link
Copy Markdown
Contributor

@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 (4)
src/pages/User/hooks/useAdminChatMutation.ts (1)

5-14: 깔끔한 추상화입니다.

중복된 mutation + navigation 로직을 잘 통합했습니다. 다만 onError 핸들링이 없어서 API 실패 시 사용자에게 피드백이 없을 수 있습니다.

🛠️ 에러 처리 추가 제안
+import { toast } from '@/utils/toast'; // 또는 프로젝트의 toast 유틸리티

 export const useAdminChatMutation = () => {
   const navigate = useNavigate();

   return useMutation({
     mutationFn: postAdminChatRoom,
     onSuccess: ({ chatRoomId }) => {
       navigate(`/chats/${chatRoomId}`);
     },
+    onError: () => {
+      // 사용자에게 에러 피드백
+    },
   });
 };
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/pages/User/hooks/useAdminChatMutation.ts` around lines 5 - 14, The hook
useAdminChatMutation currently only handles success navigation (mutationFn:
postAdminChatRoom -> onSuccess uses navigate) but lacks an onError handler to
surface API failures; add an onError callback to the useMutation options that
accepts the error (and optionally variables/context) and calls a user-visible
error reporting function (e.g., showToast, enqueueSnackbar, or processLogger) to
display a friendly message and log details, and ensure navigate is not called on
failures; locate useAdminChatMutation, postAdminChatRoom, and the existing
onSuccess block to add this onError behavior.
src/pages/User/Profile/index.tsx (2)

19-19: 로딩 상태 처리 고려

isPending을 활용해 버튼 중복 클릭 방지 및 로딩 상태 표시를 추가하면 UX가 개선됩니다.

-  const { mutate: goToAdminChat } = useAdminChatMutation();
+  const { mutate: goToAdminChat, isPending } = useAdminChatMutation();

버튼에 disabled={isPending} 추가 권장.

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

In `@src/pages/User/Profile/index.tsx` at line 19, The Admin chat mutation hook
(useAdminChatMutation) exposes an isPending state that isn't used; update the UI
to prevent duplicate clicks by reading isPending alongside mutate (const {
mutate: goToAdminChat, isPending } = useAdminChatMutation()) and: 1) add
disabled={isPending} to the button that triggers goToAdminChat, 2) guard the
click handler so it returns early if isPending to avoid double-invokes, and 3)
optionally show a loading indicator (spinner/text) based on isPending to reflect
the loading state.

44-49: 익명 함수 제거 가능

onClick={() => goToAdminChat()}onClick={goToAdminChat}으로 간소화할 수 있습니다.

♻️ 간소화 제안
       <button
-        onClick={() => goToAdminChat()}
+        onClick={goToAdminChat}
         className="bg-primary text-indigo-5 mt-auto w-full rounded-lg py-2.5 text-center text-lg leading-7 font-bold"
       >
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/pages/User/Profile/index.tsx` around lines 44 - 49, The onClick handler
currently uses an unnecessary anonymous arrow; replace onClick={() =>
goToAdminChat()} with a direct reference onClick={goToAdminChat} to simplify the
JSX and avoid creating a new function on every render—update the button element
that uses the onClick prop and ensure the goToAdminChat function is already
properly defined/accessible in the component scope.
src/pages/User/MyPage/index.tsx (1)

48-59: Profile과 동일하게 간소화 및 로딩 상태 처리 권장

  1. onClick={() => goToAdminChat()}onClick={goToAdminChat}
  2. isPending으로 버튼 비활성화 처리
♻️ 개선 제안
-  const { mutate: goToAdminChat } = useAdminChatMutation();
+  const { mutate: goToAdminChat, isPending } = useAdminChatMutation();
         <button
-          onClick={() => goToAdminChat()}
-          className="bg-indigo-0 active:bg-indigo-5 w-full rounded-sm text-left transition-colors"
+          onClick={goToAdminChat}
+          disabled={isPending}
+          className="bg-indigo-0 active:bg-indigo-5 w-full rounded-sm text-left transition-colors disabled:opacity-50"
         >
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/pages/User/MyPage/index.tsx` around lines 48 - 59, Simplify the button
click handler and add pending-state disable: change onClick={() =>
goToAdminChat()} to onClick={goToAdminChat} on the button element (the element
rendering ChatIcon/RightArrowIcon) and wire the component's isPending boolean to
the button's disabled prop (e.g., disabled={isPending}) so the button is
disabled during loading; optionally add aria-busy={isPending} or a visual
loading indicator while isPending is true to prevent duplicate navigation.
🤖 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/pages/User/hooks/useAdminChatMutation.ts`:
- Around line 5-14: The hook useAdminChatMutation currently only handles success
navigation (mutationFn: postAdminChatRoom -> onSuccess uses navigate) but lacks
an onError handler to surface API failures; add an onError callback to the
useMutation options that accepts the error (and optionally variables/context)
and calls a user-visible error reporting function (e.g., showToast,
enqueueSnackbar, or processLogger) to display a friendly message and log
details, and ensure navigate is not called on failures; locate
useAdminChatMutation, postAdminChatRoom, and the existing onSuccess block to add
this onError behavior.

In `@src/pages/User/MyPage/index.tsx`:
- Around line 48-59: Simplify the button click handler and add pending-state
disable: change onClick={() => goToAdminChat()} to onClick={goToAdminChat} on
the button element (the element rendering ChatIcon/RightArrowIcon) and wire the
component's isPending boolean to the button's disabled prop (e.g.,
disabled={isPending}) so the button is disabled during loading; optionally add
aria-busy={isPending} or a visual loading indicator while isPending is true to
prevent duplicate navigation.

In `@src/pages/User/Profile/index.tsx`:
- Line 19: The Admin chat mutation hook (useAdminChatMutation) exposes an
isPending state that isn't used; update the UI to prevent duplicate clicks by
reading isPending alongside mutate (const { mutate: goToAdminChat, isPending } =
useAdminChatMutation()) and: 1) add disabled={isPending} to the button that
triggers goToAdminChat, 2) guard the click handler so it returns early if
isPending to avoid double-invokes, and 3) optionally show a loading indicator
(spinner/text) based on isPending to reflect the loading state.
- Around line 44-49: The onClick handler currently uses an unnecessary anonymous
arrow; replace onClick={() => goToAdminChat()} with a direct reference
onClick={goToAdminChat} to simplify the JSX and avoid creating a new function on
every render—update the button element that uses the onClick prop and ensure the
goToAdminChat function is already properly defined/accessible in the component
scope.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4f0b367 and 65b9edc.

📒 Files selected for processing (5)
  • src/pages/Chat/ChatRoom.tsx
  • src/pages/Manager/ManagedRecruitmentForm/index.tsx
  • src/pages/User/MyPage/index.tsx
  • src/pages/User/Profile/index.tsx
  • src/pages/User/hooks/useAdminChatMutation.ts

@ff1451 ff1451 merged commit 1f8f825 into develop Feb 26, 2026
2 checks passed
@ff1451 ff1451 deleted the 136-refactor-채팅-ui-문의하기-라우트-경로-기본-질문-내용-수정 branch April 7, 2026 09:33
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.

[refactor] 채팅 UI, 문의하기 라우트 경로, 기본 질문 내용 수정

1 participant