fix(notification): 알림 리스트 라이브 이동 분기를 보정한다
This commit is contained in:
@@ -9,8 +9,13 @@ enum AppDeepLinkAction {
|
||||
case audition
|
||||
}
|
||||
|
||||
enum AppDeepLinkSource {
|
||||
case external
|
||||
case notificationList
|
||||
}
|
||||
|
||||
enum AppDeepLinkHandler {
|
||||
static func handle(url: URL) -> Bool {
|
||||
static func handle(url: URL, source: AppDeepLinkSource = .external) -> Bool {
|
||||
guard isSupportedScheme(url) else {
|
||||
return false
|
||||
}
|
||||
@@ -25,26 +30,30 @@ enum AppDeepLinkHandler {
|
||||
return
|
||||
}
|
||||
|
||||
apply(action: action)
|
||||
apply(action: action, source: source)
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
static func handle(urlString: String) -> Bool {
|
||||
static func handle(urlString: String, source: AppDeepLinkSource = .external) -> Bool {
|
||||
let trimmed = urlString.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
guard let url = URL(string: trimmed) else {
|
||||
return false
|
||||
}
|
||||
|
||||
return handle(url: url)
|
||||
return handle(url: url, source: source)
|
||||
}
|
||||
|
||||
static func apply(action: AppDeepLinkAction) {
|
||||
apply(action: action, source: .external)
|
||||
}
|
||||
|
||||
private static func apply(action: AppDeepLinkAction, source: AppDeepLinkSource) {
|
||||
switch action {
|
||||
case .live(let roomId):
|
||||
guard roomId > 0 else { return }
|
||||
AppState.shared.isPushRoomFromDeepLink = true
|
||||
AppState.shared.isPushRoomFromDeepLink = source == .external
|
||||
AppState.shared.pushRoomId = 0
|
||||
AppState.shared.pushRoomId = roomId
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ final class PushNotificationListViewModel: ObservableObject {
|
||||
return
|
||||
}
|
||||
|
||||
_ = AppDeepLinkHandler.handle(urlString: deepLink)
|
||||
_ = AppDeepLinkHandler.handle(urlString: deepLink, source: .notificationList)
|
||||
}
|
||||
|
||||
private var requestCategory: String? {
|
||||
|
||||
32
docs/20260313_알림리스트라이브이동분기수정.md
Normal file
32
docs/20260313_알림리스트라이브이동분기수정.md
Normal file
@@ -0,0 +1,32 @@
|
||||
# 20260313 알림 리스트 라이브 이동 분기 수정
|
||||
|
||||
## 작업 목표
|
||||
- 알림 리스트에서 라이브 알림을 탭했을 때 화면이 `HomeView` 뒤에서 동작해 확인 불가한 문제를 해소한다.
|
||||
- 라이브 알림 탭 시 알림 리스트를 벗어난 뒤 이동되도록 보정한다.
|
||||
- 라이브 상태(예약/진행)는 기존 `HomeView -> LiveViewModel.enterLiveRoom(roomId:)` 흐름의 상태 판별을 사용해 분기한다.
|
||||
|
||||
## 구현 체크리스트
|
||||
- [x] 알림 리스트 라이브 딥링크 탭 전용 처리 소스를 추가한다.
|
||||
- [x] 라이브 알림 탭 시 `.main` 복귀가 보장되도록 라우팅 플래그를 조정한다.
|
||||
- [x] 비라이브 딥링크/기존 외부 딥링크 동작을 유지한다.
|
||||
- [x] 진단/빌드/테스트 검증 및 결과를 문서에 기록한다.
|
||||
|
||||
## 수용 기준
|
||||
- [x] 알림 리스트에서 라이브 알림 탭 시 알림 리스트 화면을 빠져나온 뒤 라이브 이동 흐름이 보인다.
|
||||
- [x] 예약 라이브는 기존 `enterLiveRoom`의 예약 상세 분기(`channelName == nil`)를 탄다.
|
||||
- [x] 진행 라이브는 기존 `enterLiveRoom`의 입장 분기를 탄다.
|
||||
|
||||
## 검증 기록
|
||||
- 무엇/왜/어떻게: `AppDeepLinkHandler`에 `AppDeepLinkSource`(`external`, `notificationList`)를 추가하고, `.live` 액션에서만 `isPushRoomFromDeepLink` 값을 소스 기반으로 설정하도록 변경했다. 알림 리스트 진입(`notificationList`)에서는 `false`가 설정되어 `HomeView`의 `pushRoomId` 처리에서 `.main` 복귀 후 `enterLiveRoom(roomId:)`가 실행된다. 외부/일반 딥링크는 기본값 `external`로 기존 동작을 유지한다.
|
||||
- 무엇/왜/어떻게: `PushNotificationListViewModel.onTapItem(_:)`에서 `AppDeepLinkHandler.handle(urlString:source:)`를 `source: .notificationList`로 호출하도록 변경해 알림 리스트 라이브 탭에만 화면 복귀 보정을 적용했다.
|
||||
- 실행 명령: `lsp_diagnostics` (`SodaLive/Sources/App/AppDeepLinkHandler.swift`, `SodaLive/Sources/Notification/List/PushNotificationListViewModel.swift`)
|
||||
- 결과: SourceKit 단독 컨텍스트에서 모듈/심볼(`AppState`, `I18n`, `PushNotificationRepository` 등) 미해결 오류가 출력됐다. 동일 파일은 아래 Xcode 빌드로 컴파일 성공을 확인했다.
|
||||
- 실행 명령: `xcodebuild -workspace "SodaLive.xcworkspace" -scheme "SodaLive" -configuration Debug build`
|
||||
- 결과: `** BUILD SUCCEEDED **`
|
||||
- 실행 명령: `xcodebuild -workspace "SodaLive.xcworkspace" -scheme "SodaLive-dev" -configuration Debug build`
|
||||
- 결과: `** BUILD SUCCEEDED **`
|
||||
- 실행 명령: `xcodebuild -workspace "SodaLive.xcworkspace" -scheme "SodaLive" test`
|
||||
- 결과: `Scheme SodaLive is not currently configured for the test action.`
|
||||
- 실행 명령: `xcodebuild -workspace "SodaLive.xcworkspace" -scheme "SodaLive-dev" test`
|
||||
- 결과: `Scheme SodaLive-dev is not currently configured for the test action.`
|
||||
- 수동 QA: 코드 경로 점검으로 `PushNotificationListViewModel.onTapItem` → `AppDeepLinkHandler(.notificationList)` → `HomeView.valueChanged(pushRoomId)` → `.main` 복귀 후 `LiveViewModel.enterLiveRoom` 호출 흐름을 확인했다. 이 흐름에서 예약/진행 분기는 기존 `enterLiveRoom`의 `channelName` 기반 로직을 그대로 사용한다.
|
||||
Reference in New Issue
Block a user