Skip to content

Conversation

@xeunnie
Copy link
Member

@xeunnie xeunnie commented Jun 20, 2025

💡 PR 제목

새로고침 시, 소켓 연결이 끊기는 문제, 스톰프 구독 끊기는 문제를 해결하였습니다.(그냥 에러나면 다시시도 붙임)
채팅관련 api들 연결을 붙이면서 서버 채널을 수정했습니다.
라우터로 채널 아이디 붙이기와 해당하는 서버 클릭 시 바로 기본 채널과 채팅 내역 불러오기를 추가하였습니다.
채팅 전송을 낙관적 업데이트로 넣었고, 현재는 스피너를 못찾아 모래시계가 뺑글뺑글 돌고 있는데 수정할 예정입니다.
채팅목록은 200이 뜨지만 데이터가 빈배열이 들어와 확인을 못했습니다. 아마 저장이 안되는 것 같군요,,,

따라서 수정 삭제와 스크롤에 따른 api는 연결이 아직 안된 상태이지만 금방 붙일 예정입니다.
(멘션도 다시 테스트 해야함!!)

✅ 요구사항

  • 요구사항 1
  • 요구사항 2

⭐ 시연

✅ 기능1

✅ 리뷰어가 알아야할 사항

✅ 체크리스트

  • 자신의 코드에 대한 리뷰를 진행했습니다
  • 실행 후 심각한 버그나 경고문이 없음을 확인했습니다
  • 이해하기 어려운 부분에 적절한 주석을 첨부했습니다
  • 요구사항 변경, 레이아웃 변경 등 변경사항을 문서에 반영했습니다

@xeunnie xeunnie added this to the API milestone Jun 20, 2025
@xeunnie xeunnie requested a review from Copilot June 20, 2025 08:09
@xeunnie xeunnie self-assigned this Jun 20, 2025
@xeunnie xeunnie added the API 백엔드 연결 label Jun 20, 2025
@netlify
Copy link

netlify bot commented Jun 20, 2025

Deploy Preview for chatflow-project ready!

Name Link
🔨 Latest commit 45b02bb
🔍 Latest deploy log https://app.netlify.com/projects/chatflow-project/deploys/685567780df69f00088af28a
😎 Deploy Preview https://deploy-preview-67--chatflow-project.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link

🛠 PR 검사를 시작합니다. 잠시만 기다려 주세요!

@github-actions
Copy link

CI Status Report

검사 결과

  • Lint: ❌ failure
  • Format: ❌ failure
  • Build: ✅ success

❌ 일부 검사가 실패했습니다.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds core chat functionality with optimistic updates, fixes socket reconnection issues, and refines sidebar channel navigation.

  • Introduce useMessageHistory hook in ChatPage for fetching history and manage optimistic UI for sending messages.
  • Enhance ChatMessageItem with a MessageStatus indicator for pending/error states and fallback avatar icon.
  • Update sidebar components (ServerChannelList, ChannelItem, ChannelCategory) to auto-navigate, support drag-and-drop via useSortable, and route on click.

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/view/pages/chat/components/message/ChatMessageItem.tsx Add MessageStatus component, use fallback avatar icon
src/view/pages/chat/components/layout/ChatView.tsx Refactor message list mapping, wrap each entry for date divider grouping
src/view/pages/chat/ChatPage.tsx Fetch/manage message history, handle optimistic updates with sendMessage
src/view/layout/sidebar/components/channel/ServerChannelList.tsx Auto-select first channel when none is specified
src/view/layout/sidebar/components/channel/InviteFriendModal.tsx Style invite button, assign keys to list items correctly
src/view/layout/sidebar/components/channel/ChannelItem.tsx Switch to useSortable for drag-and-drop, add click navigation
src/view/layout/sidebar/components/channel/ChannelCategory.tsx Pass chatId prop, update DragEndEvent typing
src/view/layout/sidebar/components/channel/SidebarLayout.tsx Extend sidebar layout to full height

<div ref={bottomRef} />
</div>
return (
<div key={`msg-${index}`}>
Copy link

Copilot AI Jun 20, 2025

Choose a reason for hiding this comment

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

[nitpick] Using the array index for React keys can lead to rendering issues when the list changes. Use a stable identifier (e.g., msg.messageId or msg.tempId) for the key instead.

Suggested change
<div key={`msg-${index}`}>
<div key={msg.messageId}>

Copilot uses AI. Check for mistakes.
Comment on lines +98 to 113
const msg: Omit<ChatMessage, 'messageId'> = {
sender: {
memberId: MY_ID,
username: 'tester',
avatarUrl: '',
name: "tester",
avatarUrl: "",
},
content: text,
createdAt: new Date().toISOString(),
isUpdated: false,
isDeleted: false,
attachments:
imageUrls.length > 0
? imageUrls.map((url) => ({ type: 'image', url }))
: undefined,
? imageUrls.map((url) => ({ type: "image" as const, url }))
: [],
};

sendMessage(msg.content, msg.attachments);
Copy link

Copilot AI Jun 20, 2025

Choose a reason for hiding this comment

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

This call duplicates the message send logic above in the try block, resulting in two publishes for the same input. Remove this redundant sendMessage invocation and the unused msg object definition.

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@github-actions
Copy link

🛠 PR 검사를 시작합니다. 잠시만 기다려 주세요!

xeunnie and others added 2 commits June 20, 2025 22:51
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@github-actions
Copy link

🛠 PR 검사를 시작합니다. 잠시만 기다려 주세요!

1 similar comment
@github-actions
Copy link

🛠 PR 검사를 시작합니다. 잠시만 기다려 주세요!

@github-actions
Copy link

CI Status Report

검사 결과

  • Lint: ❌ failure
  • Format: ❌ failure
  • Build: ✅ success

❌ 일부 검사가 실패했습니다.

2 similar comments
@github-actions
Copy link

CI Status Report

검사 결과

  • Lint: ❌ failure
  • Format: ❌ failure
  • Build: ✅ success

❌ 일부 검사가 실패했습니다.

@github-actions
Copy link

CI Status Report

검사 결과

  • Lint: ❌ failure
  • Format: ❌ failure
  • Build: ✅ success

❌ 일부 검사가 실패했습니다.

@xeunnie xeunnie merged commit 07edd4f into develop Jun 20, 2025
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API 백엔드 연결

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants