feat(main-home): 추천 홈 공용 컴포넌트를 추가한다

This commit is contained in:
Yu Sung
2026-06-12 15:08:22 +09:00
parent 016a8bcca3
commit ed5e92e1d6
15 changed files with 748 additions and 4 deletions

View File

@@ -162,7 +162,7 @@
### Phase 2: ViewModel 상태와 공용 UI 컴포넌트 작성
- [ ] **Task 2.1: MainHomeViewModel 작성**
- [x] **Task 2.1: MainHomeViewModel 작성**
- 대상 파일:
- 생성: `SodaLive/Sources/V2/Main/Home/MainHomeViewModel.swift`
- 확인: `SodaLive/Sources/V2/Main/Home/Repository/MainHomeRepository.swift`
@@ -186,7 +186,7 @@
- 기대 결과: ViewModel 상태와 API 처리 메서드가 검색된다.
- 수동 확인: 실패 처리에서 빈 `catch`를 사용하지 않아야 한다.
- [ ] **Task 2.2: 공용 `ExpandableTextView` 작성**
- [x] **Task 2.2: 공용 `ExpandableTextView` 작성**
- 대상 파일:
- 생성: `SodaLive/Sources/V2/Component/Text/ExpandableTextView.swift`
- 작업 내용:
@@ -201,7 +201,7 @@
- 기대 결과: 확장/접기 상태와 3줄 제한 구현 키워드가 검색된다.
- 수동 확인: 외부 라이브러리 import 없이 `SwiftUI` 기반으로 구현되어야 한다.
- [ ] **Task 2.3: 공용 Creator 컴포넌트 작성**
- [x] **Task 2.3: 공용 Creator 컴포넌트 작성**
- 대상 파일:
- 생성: `SodaLive/Sources/V2/Component/Creator/CreatorProfileItem.swift`
- 생성: `SodaLive/Sources/V2/Component/Creator/CreatorProfileGrid.swift`
@@ -215,7 +215,7 @@
- 기대 결과: `CreatorProfileItem`, `CreatorProfileGrid`는 검색되고 API 응답 타입 의존은 없어야 한다.
- 수동 확인: 공용 컴포넌트 타입명에 `MainHome` 또는 `HomeRecommendation` 접두사를 붙이지 않아야 한다.
- [ ] **Task 2.4: 공용 Button/Banner/Card 컴포넌트 작성**
- [x] **Task 2.4: 공용 Button/Banner/Card 컴포넌트 작성**
- 대상 파일:
- 생성: `SodaLive/Sources/V2/Component/Button/FollowAllButton.swift`
- 생성: `SodaLive/Sources/V2/Component/Banner/BannerCarousel.swift`
@@ -412,3 +412,49 @@
- 아직 수행하지 않은 작업:
- Phase 2 이후 ViewModel, UI 컴포넌트, 홈 탭 연결
- 테스트 타깃이 없어 Phase 1 전용 RED/GREEN 단위 테스트는 추가하지 않음
### 2026-06-02 Phase 2 구현 완료
- 목적: Phase 2 범위인 `MainHomeViewModel`과 공용 UI 컴포넌트 작성
- 수행 내용:
- `SodaLive/Sources/V2/Main/Home/MainHomeViewModel.swift`에 추천 API 로딩/오류/응답 상태와 모두 팔로우 완료/호출 중 상태 추가
- `SodaLive/Sources/V2/Component/Text/ExpandableTextView.swift` 추가
- `SodaLive/Sources/V2/Component/Creator``CreatorProfileItem`, `CreatorProfileGrid` 추가
- `SodaLive/Sources/V2/Component/Button`, `Banner`, `Card``FollowAllButton`, `BannerCarousel`, `AiCharacterCard`, `CommunityPostCard` 추가
- `SodaLive/Resources/Assets.xcassets/v2`에 Phase 2 버튼/카드용 `ic_new_following`, `ic_new_follow`, `ic_new_community_lock` 이미지셋 포함
- 신규 Swift 파일 8개를 `SodaLive.xcodeproj/project.pbxproj``SodaLive`, `SodaLive-dev` Sources에 포함
- 실제 파일이 없던 기존 `CustomView/ExpandableTextView.swift` stale 프로젝트 참조를 제거해 중복 빌드 산출물 오류 해결
- 검증:
- `rg "final class MainHomeViewModel|fetchRecommendations|followAll|ApiResponse<HomeRecommendationResponse>|ApiResponseWithoutData" SodaLive/Sources/V2/Main/Home/MainHomeViewModel.swift` 실행, ViewModel 상태/API 처리 메서드 검색 확인
- `rg "struct ExpandableTextView|lineLimit|moreTitle|collapseTitle|isExpanded" SodaLive/Sources/V2/Component/Text/ExpandableTextView.swift` 실행, 확장/접기 상태와 3줄 제한 구현 키워드 검색 확인
- `rg "struct CreatorProfileItem|struct CreatorProfileGrid|creatorNickname|HomeCreatorItem|HomeRecommendationResponse|MainHome" SodaLive/Sources/V2/Component/Creator` 실행, 공용 Creator 컴포넌트 검색 및 API 응답 타입 의존 없음 확인
- `rg "struct FollowAllButton|ic_new_following|struct BannerCarousel|struct AiCharacterCard|struct CommunityPostCard|구매완료|HomeBannerItem|HomeAiCharacterItem|HomePopularCommunityPostItem|HomeRecommendationResponse" SodaLive/Sources/V2/Component` 실행, 공용 컴포넌트 검색 및 금지 문구/응답 타입 의존 없음 확인
- `plutil -lint SodaLive.xcodeproj/project.pbxproj` 실행, `OK` 확인
- `git diff --check` 실행, 출력 없이 성공 확인
- `xcodebuild -workspace "SodaLive.xcworkspace" -scheme "SodaLive-dev" -configuration Debug build` 실행, `BUILD SUCCEEDED` 확인
- 아직 수행하지 않은 작업:
- Phase 3 이후 MainHome 전용 섹션, 페이지 조립, 홈 탭 연결
- 테스트 타깃이 없어 Phase 2 전용 RED/GREEN 단위 테스트는 추가하지 않음
### 2026-06-12 Phase 2 코드 리뷰 보완
- 목적: Phase 2 코드 리뷰에서 확인된 ViewModel Combine 캡처 안정성과 커뮤니티 카드 잠금 아이콘 asset 불일치 보완
- 수행 내용:
- `SodaLive/Sources/V2/Main/Home/MainHomeViewModel.swift`의 추천 API/모두 팔로우 API Combine callback 캡처를 `[unowned self]`에서 `[weak self]`와 early return으로 변경
- `SodaLive/Sources/V2/Component/Card/CommunityPostCard.swift`의 잠금 아이콘을 기존 `ic_lock_bb`에서 Phase 2 신규 asset인 `ic_new_community_lock`으로 변경
- 검증:
- `rg "unowned self" SodaLive/Sources/V2/Main/Home/MainHomeViewModel.swift SodaLive/Sources/V2/Component/Card/CommunityPostCard.swift` 실행, 검색 결과 없음 확인
- `rg "weak self|ic_new_community_lock|ic_lock_bb" SodaLive/Sources/V2/Main/Home/MainHomeViewModel.swift SodaLive/Sources/V2/Component/Card/CommunityPostCard.swift` 실행, `weak self` 캡처 4곳과 `ic_new_community_lock` 사용 확인
- `git diff --check` 실행, 출력 없이 성공 확인
### 2026-06-12 Phase 1/2 리뷰 추가 보완
- 목적: Phase 1/2 리뷰에서 확인된 커뮤니티 카드 PRD 표시 누락과 사업자 정보 더보기 판정 안정성 보완
- 수행 내용:
- `SodaLive/Sources/V2/Component/Card/CommunityPostCard.swift`에 생성 시간 표시용 `createdAt` 입력과 footer 렌더링 추가
- 잠금 이미지의 가격 표시를 단순 텍스트에서 pay capsule 형태로 변경
- `SodaLive/Sources/V2/Component/Text/ExpandableTextView.swift`의 측정 높이 변화 감지를 추가해 부모 폭/레이아웃 변경 시 더보기 표시 판정이 갱신되도록 보완
- 검증:
- `rg "createdAt|Capsule\(\)|onChange\(of: proxy.size.height\)" SodaLive/Sources/V2/Component/Card/CommunityPostCard.swift SodaLive/Sources/V2/Component/Text/ExpandableTextView.swift` 실행, 생성 시간 입력/표시, pay capsule, 높이 변화 감지 검색 확인
- `git diff --check` 실행, 출력 없이 성공 확인
- `xcodebuild -workspace "SodaLive.xcworkspace" -scheme "SodaLive-dev" -configuration Debug build` 실행, `BUILD SUCCEEDED` 확인