Skip to content

[FEAT/#94] 채팅방 UI 구현#99

Open
eunhyekimyeah wants to merge 23 commits into
developfrom
feat/#94-chat-room-ui
Open

[FEAT/#94] 채팅방 UI 구현#99
eunhyekimyeah wants to merge 23 commits into
developfrom
feat/#94-chat-room-ui

Conversation

@eunhyekimyeah
Copy link
Copy Markdown
Contributor

@eunhyekimyeah eunhyekimyeah commented Apr 27, 2026

📝 요약

  • 채팅방 UI 구현
  • 완전히 구현한 것이 아니며, PR을 나눠야할 거 같아 올립니다.

⚙️ 작업 내용

1. entities/chat

  • 메시지 표시에 필요한 컴포넌트
  • 프로필 이미지 URI를 처리하는 getProfileImageUri 유틸과 채팅방 목 데이터 추가

2. features

  • 채팅방 내 기능 구현
    • chat-block-user — 사용자 차단 Dialog + useBlockDialog hook
    • chat-leave-room — 채팅방 퇴장 Dialog + useLeaveChatRoom hook
    • send-message — 메시지 입력바 ChatMessageComposer
      • 참고 : UI만 구성하였고, 실제 차단 퇴장 기능은 없음.

3. widgets/chat/chat-room

  • 채팅방 화면을 구성하는 복합 UI 블록
    • ChatHeader(채팅방 헤더)
    • ChatHeaderActions(차단·퇴장 등 헤더 액션)
    • ChatMessageList(FlatList 래퍼 - 챗 버블들 부분)
    • ChatMessages(전체 채팅방 부분)

4. pages / 라우트

  • 파트너와 관리자 각각 채팅방 상세 화면(AdminChatRoomPage.tsx PartnerChatRoomPage.tsx)을 구현
  • Expo Router 동적 라우트 chat-room/[id]로 연결했습니다.
    • 참고 : 파트너와 관리자의 페이지 코드가 유사하지만 일단 분리해놓고 나중에 구현을 더 진행한 후에 공통된 부분을 빼도록 하겠습니다.

🔗 관련 이슈

✅ 체크리스트

  • 코딩 컨벤션(Biome/Lint)을 준수하였습니다.
  • 모든 타입 에러를 해결하였습니다. (Typecheck)
  • 변경 사항에 대한 테스트를 마쳤습니다.
  • 불필요한 로그(console.log)를 제거하였습니다.

💬 리뷰어에게

  • 추후에 react-native-keyboard-controller를 사용할 예정 - KeyboardAvoidingView는 버그와 불안정한 부분이 많음
Screen_Recording_20260427_162705_Expo.Go.mp4

@eunhyekimyeah eunhyekimyeah self-assigned this Apr 27, 2026
@eunhyekimyeah eunhyekimyeah linked an issue Apr 27, 2026 that may be closed by this pull request
@github-actions github-actions Bot added the feature 새로운 기능 구현 label Apr 27, 2026
@github-actions
Copy link
Copy Markdown

Thanks for the contribution!
I have applied any labels matching special text in your title and description.

Please review the labels and make any necessary changes.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request implements a comprehensive chat system for admin and partner roles, including room lists, messaging interfaces, and features for blocking users and leaving rooms. The implementation introduces several new components, widgets, and utilities, such as ChatRoomList, ChatMessageComposer, and formatChatTime. Review feedback suggests improving code consistency by using the getProfileImageUri utility, optimizing list performance with useCallback, leveraging the date-fns library for time formatting, and utilizing safe area insets for UI positioning. Additionally, defensive logic is recommended to handle cases where room data is not found.

Comment thread src/entities/chat/ui/ChatRoomItem.tsx Outdated
index,
})}
renderItem={({ item }) => (
<ChatRoomItem {...item} onPress={() => onPressRoom?.(item.id)} />
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.

medium

renderItem 내부에서 인라인 화살표 함수를 사용하면 리스트가 리렌더링될 때마다 새로운 함수 인스턴스가 생성되어 하위 컴포넌트(ChatRoomItem)의 불필요한 리렌더링을 유발할 수 있습니다. useCallback을 사용하여 함수를 메모이제이션하거나, ChatRoomItem 내부에서 ID를 처리하도록 구조를 개선하는 것이 성능 최적화에 도움이 됩니다.

Comment thread src/shared/lib/formatTime.ts
>
<Pressable className="flex-1" onPress={() => setMenuVisible(false)}>
<View
className="absolute top-[30px] right-6 rounded-[8px] bg-canvas px-4 py-3"

This comment was marked as off-topic.

Comment thread src/pages/admin/chat-room/ui/AdminChatRoomPage.tsx
eunhyekimyeah and others added 5 commits April 27, 2026 20:26
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@ahcgnoej ahcgnoej left a comment

Choose a reason for hiding this comment

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

고생많으셨습니다!👏👏 개선 위주 코멘트라서 반영해도 되고 안 해도 될 것 같아요!

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.

FSD의 취지를 살린다면, 이 위젯은 메뉴를 열고 닫는 UI 정도의 역할만 수행하고, 실제로 차단이나 나가기 버튼을 눌렀을 때의 비즈니스 상태는 상위 레이어인 page에서 props로 내려주는 방식도 좋았을 것 같네요!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

좋은 의견인 거 같네요! 확인해보고 수정할게요

import { ChatHeader } from "./ChatHeader";
import { ChatMessageList } from "./ChatMessageList";

interface ChatMessagesProps {
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.

widgets/chat/chat-room/model/types.ts 요기 파일에 ChatRoomWidgetProps가 만들어져있는거 같은데 아래 내용 ChatRoomWidgetProps 요기에 보완하고 해당 타입 써두 될거같네요

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.

PartnerChatRoomPage.tsx 랑 내용이 거의 비슷한 거 같은데 공통 model 훅 만들고 role별 의존성 주입해주어도 좋을 것 같아요!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

맞습니다. 그 부분은 나중에 UI랑 로직 완벽히 완성하고 난 뒤에 뽑을려고 했습니다!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature 새로운 기능 구현

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT/#94] 채팅방 UI 구현

2 participants