fix(chat): Direct 대화방 진입을 분기한다

This commit is contained in:
Yu Sung
2026-07-12 23:40:39 +09:00
parent c9570fc735
commit dbf696978f
7 changed files with 23 additions and 17 deletions

View File

@@ -263,7 +263,7 @@
- 각 item은 `targetImageUrl`, `targetName`, `lastMessage`, `lastMessageAt`을 표시한다.
- `chatType == "DM"`이면 `Direct` 태그를 표시한다.
- `lastMessageAt`은 UTC 기준 문자열로 받아 상대 시간 또는 기존 Talk item과 맞는 시간 label로 표시한다.
- item 탭 시 `onTapChatRoom(roomId)`를 호출한다.
- item 탭 시 `onTapChatRoom(roomId, chatType)`를 호출한다.
- 검증 기준:
- 실행 명령: `rg "struct MainHomeFollowingChatSection|recentChatTitle|ChatRoomListItemResponse|targetImageUrl|targetName|lastMessage|lastMessageAt|chatType == \"DM\"|Direct|onTapChatRoom" SodaLive/Sources/V2/Main/Home/Following/Components/MainHomeFollowingChatSection.swift`
- 기대 결과: 최근 대화 item 필드, `Direct` 태그 조건, 채팅방 tap callback이 확인된다.
@@ -275,12 +275,13 @@
- 확인: `SodaLive/Sources/App/AppStep.swift`
- 확인: `SodaLive/Sources/ContentView.swift`
- 작업 내용:
- `MainHomeView``onTapChatRoom: (Int) -> Void` callback을 추가한다.
- `MainHomeView``onTapChatRoom: (Int, String) -> Void` callback을 추가한다.
- `MainHomeFollowingView`까지 callback을 전달한다.
- `MainView`에서 `onTapChatRoom` `AppState.shared.setAppStep(step: .chatRoom(id: roomId))`로 구현한다.
- `MainView`에서 `chatType == "DM"`이면 `AppState.shared.setAppStep(step: .userCreatorChatRoom(roomId: roomId))`로 구현한다.
- `MainView`에서 Direct가 아니면 기존처럼 `AppState.shared.setAppStep(step: .chatRoom(id: roomId))`로 구현한다.
- 검증 기준:
- 실행 명령: `rg "onTapChatRoom|chatRoom\\(id:|ChatRoomView" SodaLive/Sources/V2/Main/Home/MainHomeView.swift SodaLive/Sources/V2/Main/MainView.swift SodaLive/Sources/App/AppStep.swift SodaLive/Sources/ContentView.swift`
- 기대 결과: 최근 대화 item tap 기존 채팅방 화면으로 연결된다.
- 기대 결과: 최근 대화 Direct item tap`UserCreatorChatRoomView`, Direct가 아닌 item tap은 기존 채팅방 화면으로 연결된다.
### Phase 7: 이달의 스케줄 섹션

View File

@@ -375,12 +375,12 @@ Figma 참조:
- `recentChats`가 비어 있으면 섹션을 숨긴다.
- 섹션 타이틀은 `최근 대화`를 사용한다.
- `ChatRoomListItemResponse.roomId`를 item id와 채팅방 진입 id로 사용한다.
- `chatType == "DM"`이면 `Direct` 태그를 표시한다.
- `chatType == "DM"`이면 `Direct` 태그를 표시하고, item 탭 시 `UserCreatorChatRoomView(roomId:)` 진입 흐름을 사용한다.
- `targetName`은 채팅방 제목으로 표시한다.
- `targetImageUrl`은 채팅방 이미지로 표시한다.
- `lastMessage`는 최근 메시지 preview로 표시한다.
- `lastMessageAt`은 UTC 기준 문자열로 받아 디바이스 timezone 기준 상대 시간 또는 시간 label로 표시한다.
- item 탭 `roomId`로 기존 채팅방 진입 흐름을 사용한다.
- Direct 태그가 없는 item 탭 `roomId`로 기존 채팅방 진입 흐름을 사용한다.
- 채팅방 진입에 로그인 guard가 필요하면 기존 메인/채팅 탭의 guard 패턴을 재사용한다.
### 7.6 이달의 스케줄 섹션