fix(donation): 빈 상태와 캔 표시를 수정한다

This commit is contained in:
Yu Sung
2026-08-26 15:12:24 +09:00
parent 05b86bf314
commit ac29fd7114
5 changed files with 138 additions and 12 deletions

View File

@@ -20,12 +20,13 @@
- 후원 mutation은 기존 `LiveRoomDonationDialogView``ChannelDonationViewModel.postChannelDonation` 흐름을 재사용한다.
- 후원 성공 후 홈 데이터와 후원 탭 첫 페이지를 모두 다시 조회한다.
- 후원 랭킹은 최대 8명, 한 줄에 4명씩 표시하고 `전체보기`는 기존 `AppStep.userProfileDonationAll(userId:)`로 이동한다.
- sort-bar 정렬 없이 `전체 {donationCount}` 표시한다.
- `rankings.isEmpty && donationCount == 0`인 empty 상태에서는 count bar를 숨기고, 그 외에는 sort-bar 정렬 없이 `전체 {donationCount}` 표시한다.
- `rankings.isEmpty && donationCount == 0`이면 empty view 내부 후원하기 버튼만 표시하고 하단 고정 후원하기 버튼은 숨긴다.
- 단, 내 채널인 경우 empty view 내부 후원하기 버튼과 우측하단 후원하기 버튼을 모두 표시하지 않는다.
- `donationCount != 0 || !rankings.isEmpty`이면 홈 탭 plus button 위치에 `ic_new_donation` icon-only 후원하기 버튼을 표시한다.
- `CreatorChannelDonationResponse`는 홈 탭 모델의 기존 타입을 재사용한다.
- 후원 item UI는 홈 탭과 후원 탭에서 같은 표시 규칙을 갖도록 공용화한다.
- 공용 후원 item의 can badge는 홈·후원 탭 모두 기존 can icon과 숫자만 표시하고 단위 문자열은 제거한다.
- 서버 응답에 없는 secret 여부는 클라이언트에서 추론하지 않는다.
## 주요 대상 파일
@@ -314,3 +315,57 @@ xcodebuild -workspace "SodaLive.xcworkspace" -scheme "SodaLive-dev" -configurati
- 2026-08-26: `CreatorChannelDonationRankingSection`, `CreatorChannelDonationCard`와 직접 호출 경로를 점검해 `REV-P3-001`, `REV-P3-002`를 확정하고 `P7-R1`을 추가했다. 사용자 요청에 따라 이번 작업에서는 문서만 작성했으며 Swift·I18n 구현과 Gate 실행은 남겨 두었다.
- 2026-08-26: Phase 7 구현을 완료했다. 랭킹 title·전체보기·can pill은 기존 I18n을 재사용하고, 공용 카드의 빈 메시지 fallback만 ko/en/ja로 추가했다. 변경 전 정적 계약은 두 항목 모두 exit 1, 변경 후 Gate와 `git diff --check`는 exit 0, `SodaLive-dev` Debug 빌드는 `BUILD SUCCEEDED`, 독립 리뷰는 `APPROVED`였다. 사용자 요청에 따라 visual QA는 실행하지 않았으므로 실제 화면 ko/en/ja 수동 검증 두 항목은 미완료로 유지한다.
- 2026-08-26: 사용자 수동 테스트 완료 확인에 따라 Phase 7의 ko/en/ja 실제 화면 검증 두 항목을 완료 처리했다.
### Phase 8: 후원 empty count와 공용 can badge 회귀 수정
**Phase 결과:** 후원 empty 상태에서는 `전체 0`이 표시되지 않고, 홈·후원 탭의 공용 후원 카드에는 can icon과 숫자만 표시된다.
**선행조건:** PRD `DEC-DONATION-BUG-001` 확정.
**Phase 완료 조건:** `P8-T1`, `P8-GATE` 완료와 검증 기록 누적.
#### Task 8.1 empty count bar와 공용 can badge 수정
**Goal 실행 `P8-T1`:** 기존 후원 탭과 공용 카드의 표시 코드만 최소 수정한다.
- **시작 조건:** Phase 8 선행조건 충족.
- **완료 증거:** 정적 계약 검사, empty/non-empty 및 홈·후원 카드 수동 확인, Debug 빌드 결과가 기록된다.
- **범위 밖:** empty view·랭킹·메시지 fallback·후원 action 변경, 신규 I18n·formatter·dependency, 관련 없는 리팩터링.
- **TDD 예외 사유:** 현재 프로젝트에 test bundle target이 없고 변경 대상은 단순 표시 조건과 문자열 보간이다.
- **대체 검증 방법:** `rg` 정적 계약 검사, Debug 빌드와 Simulator 수동 확인을 사용한다.
**Files:**
- Modify: `SodaLive/Sources/V2/CreatorChannel/Donation/CreatorChannelDonationTabView.swift`
- Modify: `SodaLive/Sources/V2/CreatorChannel/Donation/Components/CreatorChannelDonationCard.swift`
- Verify: `SodaLive/Sources/V2/CreatorChannel/Home/Components/CreatorChannelDonationSection.swift`
- Verify: `SodaLive/Sources/I18n/I18n.swift`
- [x] `viewModel.donationCount > 0 || viewModel.rankings.isEmpty == false`일 때만 `CreatorChannelDonationCountBar`를 표시한다.
- [x] 공용 `CreatorChannelDonationCard`의 can badge를 `Text("\(donation.can)")`으로 표시한다.
- [x] `I18n.CreatorChannelDonation.defaultMessage(_:)`의 메시지 단위 표기는 유지한다.
- [x] 홈·후원 탭 모두 기존 공용 카드, tier 색상, 상대 시간과 메시지 표시 규칙을 유지한다.
- [x] 아래 Gate 결과를 검증 기록에 누적한다.
#### Phase 8 Gate
```bash
rg -n 'donationCount > 0|rankings\.isEmpty|CreatorChannelDonationCountBar' SodaLive/Sources/V2/CreatorChannel/Donation/CreatorChannelDonationTabView.swift
rg -n 'Text\("\\\(donation\.can\)"\)|I18n\.LiveChat\.canWithUnit|defaultMessage' SodaLive/Sources/V2/CreatorChannel/Donation/Components/CreatorChannelDonationCard.swift
rg -n 'CreatorChannelDonationCard' SodaLive/Sources/V2/CreatorChannel/Donation/CreatorChannelDonationTabView.swift SodaLive/Sources/V2/CreatorChannel/Home/Components/CreatorChannelDonationSection.swift
git diff --check -- SodaLive/Sources/V2/CreatorChannel/Donation/CreatorChannelDonationTabView.swift SodaLive/Sources/V2/CreatorChannel/Donation/Components/CreatorChannelDonationCard.swift docs/20260704_크리에이터_채널_후원_탭/prd.md docs/20260704_크리에이터_채널_후원_탭/plan-task.md
xcodebuild -workspace "SodaLive.xcworkspace" -scheme "SodaLive-dev" -configuration Debug build
```
**Expected:** empty 상태에서는 count bar가 숨겨지고, 공용 카드의 can badge에는 `I18n.LiveChat.canWithUnit(_:)` 없이 숫자만 표시되며 Debug 빌드가 성공한다.
수동 검증:
- [ ] 후원 empty 상태에서 empty view만 표시되고 `전체 0`은 표시되지 않는다.
- [ ] 후원 non-empty 상태에서 `전체 {donationCount}`가 표시된다.
- [ ] 홈·후원 탭 공용 카드의 can badge가 ko/en/ja 모두 can icon과 숫자만 표시한다.
- 2026-08-26: 사용자 인터뷰에서 A안을 선택해 공용 can badge 단위 제거를 홈·후원 탭에 함께 적용하기로 확정하고 Phase 8을 추가했다. 이번 작업은 문서만 작성했으며 Swift 구현과 Gate 실행은 수행하지 않았다.
- 2026-08-26: Phase 8을 구현해 empty 상태의 count bar를 숨기고 공용 `CreatorChannelDonationCard`의 can badge를 숫자만 표시하도록 수정했다. 홈·후원 탭의 공용 카드 사용과 `I18n.CreatorChannelDonation.defaultMessage(_:)`, tier 색상, 상대 시간, 메시지 규칙은 유지했다.
- 2026-08-26: Phase 8의 `rg` 정적 계약, `git diff --check`, `xcodebuild -workspace "SodaLive.xcworkspace" -scheme "SodaLive-dev" -configuration Debug build`를 실행했고 `** BUILD SUCCEEDED **`를 확인했다. 사양·코드 품질 리뷰는 모두 승인됐으며 `reviews/phase8-donation-empty-can-badge-regression.md`에 기록했다.
- 2026-08-26: 사용자 요청에 따라 visual QA와 Simulator 수동 검증은 수행하지 않았다. empty/non-empty 및 홈·후원 ko/en/ja 실제 화면 체크박스 3개는 사용자 확인 전까지 미완료로 유지한다.