Skip to content

ProfileTab의 View 구성 요소와 렌더링 입력을 분리한다 - #945

Merged
opficdev merged 1 commit into
developfrom
refactor/#883
Oct 28, 2026
Merged

opficdev merged 1 commit into
developfrom
refactor/#883

Conversation

@opficdev

@opficdev opficdev commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

🔗 연관된 이슈

🎯 의도

계산 프로퍼티로 구성한 내부 View는 그 안에서 읽은 상태가 바뀌면 부모 View의 body 전체가 다시 평가되는 구조

상태 변화로 재평가가 필요한 영역만 별도 View로 분리하고, 해당 상태를 부모가 아닌 분리한 View의 body에서 읽도록 구성하여 부모 body의 재평가 범위를 줄이는 것

📝 작업 내용

📌 요약

  • ProfileView, AccountView에서 상태를 읽는 영역을 같은 파일의 private View로 분리

🔍 상세

  • ProfileView
    • GoalSummaryCard에 넘기던 목표 상태 입력(developmentGoals, isDevelopmentGoalsLoading, hasDevelopmentGoalsLoaded, hasDevelopmentGoalsLoadFailure)을 store를 전달받는 private View로 분리
      • ProfileGoalSummary: 목표 상태를 읽어 GoalSummaryCard에 값으로 전달하고 재시도 send를 연결
    • UserInfoCard, ActivityCard, RecentActivityCard, QuarterPickerSheet는 이미 store를 받아 자체 body에서 상태를 읽고 있어 변경 없음
    • 상태를 읽지 않는 titleBar와 destinationView, 시트·알림·오버레이 등 프레젠테이션 modifier는 부모에 유지
    • GoalSummaryCard는 반복 항목이 아닌 값 입력 카드로 기존 시그니처 유지
  • AccountView
    • 상태를 읽는 영역을 store를 전달받는 private View로 분리
      • AccountCurrentSection: currentProvider
      • AccountSocialSection: currentProvider, connectedProviders, isLoading, activeLoadingProvider, presentationContext
    • ProviderRow, ProviderIdentity는 반복 항목이므로 기존대로 값만 전달
    • 분리 후 부모 body가 읽는 상태는 alert로 한정
    • 상태를 읽지 않는 topBar, onAppear, WindowSceneIdentifierReader는 부모에 유지
  • UI 계층, modifier 순서, 탐색 경로와 Store 소유권, 동작은 기존과 동일
  • State, Action, SideEffect, 모듈 의존성, 공개 API 변경 없음

📸 영상 / 이미지 (Optional)

Instruments 측정 (View Body)

  • 조건: Release 최적화(Staging 구성) 빌드, iPhone 18 Pro 시뮬레이터(iOS 27.0), View Body (Legacy), 변경 전후 각 5회 교차 측정 후 중앙값 비교, 괄호는 5회 측정 범위
  • 시나리오: 프로필 탭 시나리오와 계정 화면 시나리오를 이어서 실행
    • 프로필 탭: 프로필 ↔ 오늘 탭 전환 10회(1초 간격)
    • 계정 화면: 설정 → 계정 연동 진입 후 복귀 10회
  • 로그인된 계정의 실제 데이터 기준이며 소셜 계정 연결·해제 동작과 스크롤 시나리오는 측정 대상에서 제외

계정 화면 (설정 → 계정 연동 진입·복귀 10회)

대상 변경 전 횟수 변경 전 시간 변경 후 횟수 변경 후 시간
AccountView 30회 2.77ms (2.37 ~ 3.13) 20회 1.05ms (0.97 ~ 1.15)
AccountCurrentSection - - 20회 0.50ms (0.44 ~ 0.57)
AccountSocialSection - - 20회 0.44ms (0.41 ~ 0.46)
합계 30회 2.77ms (2.37 ~ 3.13) 60회 1.99ms (1.85 ~ 2.12)
ProviderRow 100회 2.41ms (2.22 ~ 2.48) 70회 2.11ms (1.98 ~ 2.20)
  • 변경 후 AccountView는 진입·복귀 1회당 body 평가가 3회에서 2회로 감소
  • 분리한 View가 추가로 평가되어 평가 횟수 합은 늘었으나, 한 번의 평가 비용이 작아 시간 합계는 감소

프로필 탭 (프로필 ↔ 오늘 탭 전환 10회)

대상 변경 전 횟수 변경 전 시간 변경 후 횟수 변경 후 시간
ProfileView 83회 12.59ms (12.52 ~ 13.30) 83회 11.49ms (11.21 ~ 12.49)
GoalSummaryCard 66회 3.05ms (2.97 ~ 3.10) 24회 1.48ms (1.43 ~ 1.53)
ProfileGoalSummary - - 40회 0.79ms (0.74 ~ 0.84)
합계 (GoalSummaryCard + ProfileGoalSummary) 66회 3.05ms (2.97 ~ 3.10) 64회 2.27ms (2.18 ~ 2.34)
  • ProfileView body 평가 횟수는 동일하며 시간 차이는 측정 범위가 거의 맞닿아 개선으로 보지 않음
    • 부모 body가 오버레이용 로딩 상태와 isSelected, 시트 상태를 계속 읽는 구조
  • GoalSummaryCard 재평가 횟수가 66회에서 24회로 감소

@opficdev
opficdev merged commit c7758ee into develop Oct 28, 2026
17 of 18 checks passed
@opficdev
opficdev deleted the refactor/#883 branch October 28, 2026 13:39
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.

ProfileTab의 View 구성 요소와 렌더링 입력을 분리한다

1 participant