Skip to content

[#570] TodoDetailView에 TCA를 적용한다#588

Merged
opficdev merged 8 commits into
developfrom
refactor/#570-TodoDetailView
Jun 11, 2026
Merged

[#570] TodoDetailView에 TCA를 적용한다#588
opficdev merged 8 commits into
developfrom
refactor/#570-TodoDetailView

Conversation

@opficdev

Copy link
Copy Markdown
Owner

🔗 연관된 이슈

🎯 의도

  • TodoDetailView를 ViewModel 기반 상태 관리에서 TCA Store 기반 상태 관리로 전환
  • 상세 조회, Markdown reference 해석, alert, sheet, fullScreenCover 상태 변화를 reducer action으로 표현하고 기존 동작을 유지하면서 Store 전환 이후에도 검증 가능한 테스트 기반을 마련

📝 작업 내용

📌 요약

  • TodoDetailViewModel 제거 및 TodoDetailFeature 추가
  • TodoDetailViewStoreOf<TodoDetailFeature> 기반으로 전환
  • alert, sheet, fullScreenCover presentation 상태를 TCA state/action으로 관리
  • sheet 내부 Todo 상세 화면을 child Store scope 기반으로 연결
  • 기존 ViewModel 상태 변화 테스트를 Store adapter 기반 테스트로 전환

🔍 상세

  • TodoDetailFeature에서 Todo 조회, 로딩 상태, 조회 실패 alert, reference item 해석 상태 처리
  • LoadingState를 reducer 내부에서 직접 생성해 기존 delayed loading 동작 유지
  • FetchTodoByIdUseCase, FetchReferenceItemsUseCase를 TCA dependency로 주입
  • TodoDetailView 생성자를 Store 기반으로 정리하고, 기존 ViewModel 생성 경로 제거
  • SheetState를 enum으로 정리하고 TodoDetailSheetFeature에서 child TodoDetailFeatureifCaseLet으로 연결
  • sheet 내부 Todo 상세 화면에서 별도 Store 생성 없이 parent Store에서 scoped Store 사용
  • coordinator와 상위 view의 TodoDetailView 생성부를 Store 조립 방식으로 변경
  • TodoDetailFeatureTests 추가로 조회 성공, reference item 해석, 로딩, 실패 alert, sheet/fullScreenCover 상태 변화 검증
  • sheet child Todo 상세의 reference item 상태가 parent가 아닌 child state에 반영되는지 검증

📸 영상 / 이미지 (Optional)

@opficdev opficdev self-assigned this Jun 11, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

이번 풀리퀘스트는 기존 TodoDetailViewModel 기반의 구조를 Composable Architecture(TCA)의 TodoDetailFeature 리듀서 구조로 마이그레이션하고 관련 뷰와 테스트 코드를 업데이트합니다. 리뷰 피드백으로는 1) TodoDetailView에서 Store@State로 감싸지 않고 직접 선언하도록 수정하여 상태 업데이트 버그를 방지할 것, 2) 리듀서 내부에서 참조 타입인 LoadingState를 직접 소유하지 않도록 의존성 주입 등으로 개선할 것, 3) @CasePathable이 자동 생성하는 프로퍼티를 활용하여 중복 코드(todoDetail)를 제거하고 스코프 지정을 단순화할 것, 4) fetchTodoEffect에 취소 ID를 부여하여 레이스 컨디션을 방지할 것, 5) 테스트 코드에서 waitUntil 대신 TCA 표준인 TestStore를 사용하여 결정론적인 테스트를 작성할 것을 제안합니다.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread Application/DevLogPresentation/Sources/Home/Detail/TodoDetailView.swift Outdated
Comment thread Application/DevLogPresentation/Sources/Home/Detail/TodoDetailFeature.swift Outdated
@opficdev opficdev changed the title Refactor/#570 todo detail view [#570] TodoDetailView에 TCA를 적용한다 Jun 11, 2026
@opficdev opficdev merged commit f4521ee into develop Jun 11, 2026
5 checks passed
@opficdev opficdev deleted the refactor/#570-TodoDetailView branch June 11, 2026 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TodoDetailView에 TCA를 적용한다

1 participant