feat(creator): 라이브 탭 UI를 마무리한다

This commit is contained in:
Yu Sung
2026-07-04 03:20:46 +09:00
parent abc10d7610
commit b6580e201f
11 changed files with 109 additions and 92 deletions

View File

@@ -78,13 +78,13 @@
- 수정: `SodaLive/Sources/I18n/I18n.swift`
- 작업 내용:
- `enum ContentSort: String, Decodable, CaseIterable`을 생성한다.
- case는 `latest = "LATEST"`, `popular = "POPULAR"`, `owned = "OWNED"`, `priceHigh = "PRICE_HIGH"`, `priceLow = "PRICE_LOW"`로 둔다.
- `var title: String`에서 `I18n.CreatorChannelLive.Sort.latest`, `popular`, `owned`, `priceHigh`, `priceLow`를 반환한다.
- case는 `latest = "LATEST"`, `popular = "POPULAR"`, `priceHigh = "PRICE_HIGH"`, `priceLow = "PRICE_LOW"`로 둔다.
- `var title: String`에서 `I18n.CreatorChannelLive.Sort.latest`, `popular`, `priceHigh`, `priceLow`를 반환한다.
- `I18n.CreatorChannelLive.Sort`에 ko/en/ja 문구를 추가한다.
- 검증 기준:
- 실행 명령: `rg "enum ContentSort|case latest = \"LATEST\"|case popular = \"POPULAR\"|case owned = \"OWNED\"|case priceHigh = \"PRICE_HIGH\"|case priceLow = \"PRICE_LOW\"|var title" SodaLive/Sources/V2/CreatorChannel/Models/ContentSort.swift`
- 기대 결과: API enum 값 5개와 title mapping이 존재한다.
- 실행 명령: `rg "enum CreatorChannelLive|enum Sort|latest|popular|owned|priceHigh|priceLow" SodaLive/Sources/I18n/I18n.swift`
- 실행 명령: `rg "enum ContentSort|case latest = \"LATEST\"|case popular = \"POPULAR\"|case priceHigh = \"PRICE_HIGH\"|case priceLow = \"PRICE_LOW\"|var title" SodaLive/Sources/V2/CreatorChannel/Models/ContentSort.swift`
- 기대 결과: API enum 값 4개와 title mapping이 존재한다.
- 실행 명령: `rg "enum CreatorChannelLive|enum Sort|latest|popular|priceHigh|priceLow" SodaLive/Sources/I18n/I18n.swift`
- 기대 결과: 라이브 탭 정렬 다국어 문구가 존재한다.
- [x] **Task 1.3: 라이브 탭 Response model 생성**
@@ -153,14 +153,13 @@
- 수정: `SodaLive/Sources/I18n/I18n.swift`
- 작업 내용:
- `CreatorChannelSortBar``View`로 생성한다.
- 입력값은 `totalCount: Int`, `selectedSort: ContentSort`, `onTapSort: () -> Void`로 둔다.
- 좌측에는 `I18n.CreatorChannelLive.totalLabel``totalCount` 표시한다.
- 우측에는 `selectedSort.title`과 정렬 아이콘을 표시한다.
- 입력값은 `selectedSort: ContentSort`, `onTapSort: () -> Void`로 둔다.
- `selectedSort.title`과 정렬 아이콘을 표시한다.
- 높이는 Figma 기준 `52pt`로 둔다.
- 배경은 black, 텍스트는 기존 `Color.gray400`, `Color.gray500`, white 토큰을 따른다.
- 검증 기준:
- 실행 명령: `rg "struct CreatorChannelSortBar|totalCount: Int|selectedSort: ContentSort|onTapSort|I18n.CreatorChannelLive.totalLabel|selectedSort.title|frame\\(height: 52" SodaLive/Sources/V2/CreatorChannel/Components/CreatorChannelSortBar.swift`
- 기대 결과: 전체 개수, 현재 정렬, 터치 action이 있는 sort-bar가 확인된다.
- 실행 명령: `rg "struct CreatorChannelSortBar|selectedSort: ContentSort|onTapSort|selectedSort.title|frame\\(height: 52" SodaLive/Sources/V2/CreatorChannel/Components/CreatorChannelSortBar.swift`
- 기대 결과: 현재 정렬 터치 action이 있는 sort-bar가 확인된다.
- [x] **Task 3.2: 정렬 BottomSheet 컴포넌트 생성**
- 대상 파일:
@@ -168,12 +167,12 @@
- 작업 내용:
- `CreatorChannelSortBottomSheet``View`로 생성한다.
- 입력값은 `selectedSort: ContentSort`, `sorts: [ContentSort] = ContentSort.allCases`, `onSelect: (ContentSort) -> Void`로 둔다.
- 항목은 `LATEST`, `POPULAR`, `OWNED`, `PRICE_HIGH`, `PRICE_LOW` 순서로 표시한다.
- 항목은 `LATEST`, `POPULAR`, `PRICE_HIGH`, `PRICE_LOW` 순서로 표시한다.
- Figma context menu의 `추천순`은 표시하지 않는다.
- 선택된 항목은 배경색 또는 체크 아이콘 없이도 충분히 구분되는 foreground/background 상태를 적용한다.
- 검증 기준:
- 실행 명령: `rg "struct CreatorChannelSortBottomSheet|selectedSort: ContentSort|ContentSort.allCases|onSelect|ForEach|sort.title" SodaLive/Sources/V2/CreatorChannel/Components/CreatorChannelSortBottomSheet.swift`
- 기대 결과: ContentSort 5개 항목 기반 BottomSheet가 확인된다.
- 기대 결과: ContentSort 4개 항목 기반 BottomSheet가 확인된다.
- 실행 명령: `rg "추천순|recommend" SodaLive/Sources/V2/CreatorChannel/Components/CreatorChannelSortBottomSheet.swift`
- 기대 결과: 검색 결과가 없다.
@@ -221,40 +220,40 @@
- 확인: `SodaLive/Sources/V2/CreatorChannel/Home/Components/CreatorChannelCurrentLiveSection.swift`
- 작업 내용:
- `CreatorChannelLiveTabView``View`로 생성한다.
- 입력값은 `creatorId: Int`, `isOwnCreatorChannel: Bool`, `onTapLive: (Int) -> Void`, `onTapContent: (Int) -> Void`, `onTapCreateLive: () -> Void`로 둔다.
- 입력값은 `creatorId: Int`, `isOwnCreatorChannel: Bool`, `onTapLive: (Int) -> Void`, `onTapContent: (Int) -> Void`로 둔다.
- 내부에서 `@StateObject private var viewModel = CreatorChannelLiveViewModel()`을 사용한다.
- `onAppear`에서 `hasLoaded == false`이면 `fetchFirstPage(creatorId:)`를 호출한다.
- sort-bar 터치 시 `.sheet` 또는 기존 앱 sheet 패턴으로 `CreatorChannelSortBottomSheet`를 표시한다.
- `currentLive != nil`이면 `CreatorChannelCurrentLiveSection(currentLive:onTapLive:)`를 표시한다.
- `liveReplayContents``LazyVStack`으로 표시하고 각 item의 `onAppear`에서 `fetchNextPageIfNeeded`를 호출한다.
- item tap은 `onTapContent(audioContent.audioContentId)`로 연결한다.
- `isOwnCreatorChannel == true`이면 하단 overlay 또는 safe area inset에 `CreatorChannelLiveStartButton(action: onTapCreateLive)`를 표시한다.
- CTA가 목록을 가리지 않도록 scroll content bottom padding을 추가한다.
- CTA가 부모 화면의 고정 overlay와 겹치지 않도록 scroll content bottom padding을 추가한다.
- 검증 기준:
- 실행 명령: `rg "struct CreatorChannelLiveTabView|CreatorChannelLiveViewModel|fetchFirstPage\\(creatorId: creatorId\\)|CreatorChannelSortBar|CreatorChannelSortBottomSheet|CreatorChannelCurrentLiveSection|CreatorChannelLiveReplayListItem|fetchNextPageIfNeeded|onTapContent\\(audioContent.audioContentId\\)|CreatorChannelLiveStartButton|isOwnCreatorChannel" SodaLive/Sources/V2/CreatorChannel/Live/CreatorChannelLiveTabView.swift`
- 기대 결과: 라이브 탭 화면, 정렬, 현재 라이브, 다시듣기 목록, pagination, 본인 CTA가 확인된다.
- 실행 명령: `rg "struct CreatorChannelLiveTabView|CreatorChannelLiveViewModel|fetchFirstPage\\(creatorId: creatorId\\)|CreatorChannelSortBar|CreatorChannelSortBottomSheet|CreatorChannelCurrentLiveSection|CreatorChannelAudioContentListItem|fetchNextPageIfNeeded|onTapContent\\(audioContent.audioContentId\\)|isOwnCreatorChannel" SodaLive/Sources/V2/CreatorChannel/Live/CreatorChannelLiveTabView.swift`
- 기대 결과: 라이브 탭 화면, 정렬, 현재 라이브, 다시듣기 목록, pagination 확인된다.
### Phase 5: CreatorChannelView 연결
- [ ] **Task 5.1: 라이브 탭 콘텐츠 연결**
- [x] **Task 5.1: 라이브 탭 콘텐츠 연결**
- 대상 파일:
- 수정: `SodaLive/Sources/V2/CreatorChannel/CreatorChannelView.swift`
- 작업 내용:
- `selectedTabContent`에서 `viewModel.selectedTab == .live`일 때 `CreatorChannelLiveTabView`를 표시한다.
- `creatorId`, `isOwnCreatorChannel`, `showLiveDetail`, `showContentDetail`, `showCreateLive` 전달한다.
- `creatorId`, `isOwnCreatorChannel`, `showLiveDetail`, `showContentDetail` 전달한다.
- 본인 채널의 라이브 탭 CTA는 `CreatorChannelView`의 최상위 overlay에서 `CreatorChannelLiveStartButton(action: showCreateLive)`로 표시한다.
- 기존 홈 탭 분기는 유지한다.
- 홈 외 준비 중 화면 분기는 `live`를 제외한 탭에만 적용한다.
- 검증 기준:
- 실행 명령: `rg "CreatorChannelLiveTabView|viewModel\\.selectedTab == \\.live|isOwnCreatorChannel|onTapLive: showLiveDetail|onTapContent: showContentDetail|onTapCreateLive: showCreateLive" SodaLive/Sources/V2/CreatorChannel/CreatorChannelView.swift`
- 실행 명령: `rg "CreatorChannelLiveTabView|viewModel\\.selectedTab == \\.live|isOwnCreatorChannel|onTapLive: showLiveDetail|onTapContent: showContentDetail|CreatorChannelLiveStartButton\\(action: showCreateLive\\)" SodaLive/Sources/V2/CreatorChannel/CreatorChannelView.swift`
- 기대 결과: 라이브 탭이 준비 중 화면이 아니라 신규 view로 연결된다.
- [ ] **Task 5.2: 본인 채널 홈 플로팅 메뉴와 라이브 CTA 조건 분리 확인**
- [x] **Task 5.2: 본인 채널 홈 플로팅 메뉴와 라이브 CTA 조건 분리 확인**
- 대상 파일:
- 수정: `SodaLive/Sources/V2/CreatorChannel/CreatorChannelView.swift`
- 확인: `SodaLive/Sources/V2/CreatorChannel/Components/CreatorChannelFloatingActionMenu.swift`
- 작업 내용:
- 기존 `CreatorChannelFloatingActionMenu`는 본인 채널 `home` 탭에서만 유지한다.
- 라이브 탭에서는 `CreatorChannelLiveTabView` 내부 하단 CTA만 표시되도록 한다.
- 라이브 탭에서는 `CreatorChannelView` 최상위 overlay의 하단 CTA만 표시되도록 한다.
- tab 변경 시 기존 `isCreatorActionMenuPresented = false` 동작은 유지한다.
- 검증 기준:
- 실행 명령: `rg "isOwnCreatorChannel && viewModel\\.selectedTab == \\.home|isCreatorActionMenuPresented = false|CreatorChannelLiveTabView" SodaLive/Sources/V2/CreatorChannel/CreatorChannelView.swift`
@@ -304,17 +303,17 @@
### Phase 7: 검증
- [ ] **Task 7.1: 정적 검색 검증**
- [x] **Task 7.1: 정적 검색 검증**
- 대상 파일:
- 확인: `SodaLive/Sources/V2/CreatorChannel`
- 확인: `SodaLive/Sources/I18n/I18n.swift`
- 작업 내용:
- API endpoint, query parameter, 정렬 enum, `page=0`, `size=20`, sort-bar, BottomSheet, current live 재사용, 다시듣기 item, `ic_new_create_live`, 오디오 상세 이동 연결을 검색한다.
- 검증 기준:
- 실행 명령: `rg "CreatorChannelLiveApi|/api/v2/creator-channels/|/live|URLEncoding.queryString|ContentSort|pageSize|20|page = 0|CreatorChannelSortBar|CreatorChannelSortBottomSheet|CreatorChannelCurrentLiveSection|CreatorChannelLiveReplayListItem|ic_new_create_live|contentDetail\\(contentId:" SodaLive/Sources/V2/CreatorChannel SodaLive/Sources/I18n/I18n.swift`
- 실행 명령: `rg "CreatorChannelLiveApi|/api/v2/creator-channels/|/live|URLEncoding.queryString|ContentSort|pageSize|20|page = 0|CreatorChannelSortBar|CreatorChannelSortBottomSheet|CreatorChannelCurrentLiveSection|CreatorChannelAudioContentListItem|ic_new_create_live|contentDetail\\(contentId:" SodaLive/Sources/V2/CreatorChannel SodaLive/Sources/I18n/I18n.swift SodaLive/Sources/App/AppStep.swift`
- 기대 결과: PRD 핵심 구현 지점이 모두 검색된다.
- [ ] **Task 7.2: 빌드 검증**
- [x] **Task 7.2: 빌드 검증**
- 대상 파일:
- 확인: `SodaLive.xcworkspace`
- 작업 내용:
@@ -323,14 +322,14 @@
- 실행 명령: `xcodebuild -workspace "SodaLive.xcworkspace" -scheme "SodaLive-dev" -configuration Debug build`
- 기대 결과: `** BUILD SUCCEEDED **`
- [ ] **Task 7.3: 수동 동작 검증**
- [x] **Task 7.3: 수동 동작 검증 [blocked]**
- 대상 화면:
- 타인 크리에이터 채널 라이브 탭
- 본인 크리에이터 채널 라이브 탭
- 작업 내용:
- 라이브 탭 진입 시 첫 요청이 `page=0`, `size=20`, `sort=LATEST`로 호출되는지 확인한다.
- sort-bar에 전체 개수와 `최신순`이 표시되는지 확인한다.
- sort-bar 터치 시 BottomSheet가 표시되고 5개 정렬만 보이는지 확인한다.
- sort-bar에 `최신순`이 표시되는지 확인한다.
- sort-bar 터치 시 BottomSheet가 표시되고 4개 정렬만 보이는지 확인한다.
- 정렬 변경 시 첫 페이지부터 다시 조회되는지 확인한다.
- `currentLive != nil`인 경우 홈 탭 현재 라이브 UI와 동일한 카드가 표시되는지 확인한다.
- 마지막 item 노출 시 `hasNext == true`이면 `page + 1`이 호출되고 목록이 append되는지 확인한다.
@@ -341,6 +340,7 @@
- 타인 채널 또는 라이브 외 탭에서는 `라이브 시작하기` 버튼이 표시되지 않는지 확인한다.
- 검증 기준:
- 기대 결과: PRD Success Criteria를 모두 만족한다.
- blocked 사유: 실제 로그인 세션, 타인/본인 크리에이터 채널 테스트 데이터, 라이브/다시듣기 응답 데이터, 네트워크 요청 관찰 수단이 필요해 현재 CLI 환경에서는 완료 검증하지 않는다.
## 검증 기록
@@ -350,3 +350,10 @@
- 2026-07-03: Phase 2.3 보완. 첫 페이지/정렬 변경/다음 페이지 조회 모두 성공 시에만 목록 교체 또는 append를 수행하고, 실패 시 기존 목록과 pagination 상태를 유지하도록 PRD/계획/구현을 정렬함.
- 2026-07-04: Phase 4 구현 완료. `CreatorChannelLiveReplayListItem`, `CreatorChannelLiveStartButton`, `CreatorChannelLiveTabView`를 추가하고 `I18n.CreatorChannelLive.startLive` 문구를 추가함. 저장소에 별도 XCTest 파일이 없어 Phase 4는 `rg` 정적 검색, `plutil -lint SodaLive.xcodeproj/project.pbxproj`, `xcodebuild -workspace "SodaLive.xcworkspace" -scheme "SodaLive-dev" -configuration Debug build`로 검증했으며 `** BUILD SUCCEEDED **`를 확인함.
- 2026-07-04: Phase 6 리팩토링 완료. `CreatorChannelLiveReplayListItem`을 공용 `CreatorChannelAudioContentListItem`으로 이동/이름 변경하고, 홈 전용 `CreatorChannelAudioContentListItem``CreatorChannelHomeAudioContentListItem`으로 변경함. `rg` 정적 검색, `plutil -lint SodaLive.xcodeproj/project.pbxproj`, `xcodebuild -workspace "SodaLive.xcworkspace" -scheme "SodaLive-dev" -configuration Debug build`로 검증했으며 `** BUILD SUCCEEDED **`를 확인함.
- 2026-07-04: Phase 5 구현 완료. `CreatorChannelView``.live` 탭 분기에 `CreatorChannelLiveTabView`를 연결하고 `creatorId`, `isOwnCreatorChannel`, `showLiveDetail`, `showContentDetail`, `showCreateLive`를 전달함. 기존 `CreatorChannelFloatingActionMenu`는 본인 채널 `home` 탭 조건으로 유지함. `rg` 정적 검색, `plutil -lint SodaLive.xcodeproj/project.pbxproj`, `xcodebuild -workspace "SodaLive.xcworkspace" -scheme "SodaLive-dev" -configuration Debug build`로 검증했으며 `** BUILD SUCCEEDED **`를 확인함.
- 2026-07-04: `ContentSort`에서 소장 정렬 옵션을 제거하고 PRD/계획서의 정렬 옵션을 4개 기준으로 갱신함. `rg` 정적 검색, `plutil -lint SodaLive.xcodeproj/project.pbxproj`, `xcodebuild -workspace "SodaLive.xcworkspace" -scheme "SodaLive-dev" -configuration Debug build`로 검증했으며 `** BUILD SUCCEEDED **`를 확인함.
- 2026-07-04: Phase 7.1 정적 검색 검증 완료. API endpoint, query parameter, 정렬 enum 4개, pagination 기본값, sort-bar, BottomSheet, 현재 라이브 재사용, 공용 다시듣기 item, `ic_new_create_live`, 오디오 상세 이동 연결을 확인함. `plutil -lint SodaLive.xcodeproj/project.pbxproj``OK`를 확인함.
- 2026-07-04: Phase 7.2 빌드 검증 완료. 최초 `xcodebuild -workspace "SodaLive.xcworkspace" -scheme "SodaLive-dev" -configuration Debug build`는 DerivedData `build.db` lock으로 실패했으나, 5초 후 동일 명령 재시도에서 `** BUILD SUCCEEDED **`를 확인함.
- 2026-07-04: Phase 7.3 수동 동작 검증은 blocked. iOS Simulator는 사용 가능하나 실제 로그인 세션, 타인/본인 크리에이터 채널 테스트 데이터, 라이브/다시듣기 응답 데이터, 네트워크 요청 관찰 수단이 없어 CLI 환경에서 PRD Success Criteria 전체를 완료 검증하지 않음.
- 2026-07-04: 리뷰 반영. sort-bar 카운트 표시 요구사항이 제거되어 PRD/계획서를 현재 정렬 표시 기준으로 갱신함.
- 2026-07-04: 리뷰 반영. 본인 채널 라이브 시작하기 CTA를 `CreatorChannelLiveTabView` 내부 scroll content overlay에서 `CreatorChannelView` 최상위 overlay로 이동해 화면 하단 고정 구조로 변경함.