Skip to content

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

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

opficdev merged 1 commit into
developfrom
refactor/#882

Conversation

@opficdev

@opficdev opficdev commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

🔗 연관된 이슈

🎯 의도

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

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

📝 작업 내용

📌 요약

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

🔍 상세

  • PushNotificationListView
    • 상태를 읽는 영역을 store를 전달받는 private View로 분리
      • PushNotificationListContent: notifications, query.sortOrder, nextCursor, isLoading
      • PushNotificationFilterBar: appliedFilterCount, query
    • PushNotificationListContent에서만 쓰던 iconSize, presentDeleteNotificationToast, timeAgoText는 해당 View의 멤버로 이동
    • PushNotificationFilterBar에서만 쓰던 filterBadge는 해당 View의 멤버로 이동
    • 시트 Store를 전달받아 화면을 만드는 sheetContent와 시트 바인딩 sheetStore는 부모 상태를 읽지 않아 분리하지 않고 유지
    • 분리 후 부모 body가 읽는 상태는 alert, sheet, selectedTodoId, isLoading으로 한정
  • UI 계층, modifier 순서, 탐색 경로와 Store 소유권, 동작은 기존과 동일
  • State, Action, SideEffect, 모듈 의존성, 공개 API 변경 없음

📸 영상 / 이미지 (Optional)

Instruments 측정 (View Body)

  • 조건: Release 최적화(Staging 구성) 빌드, iPhone 18 Pro 시뮬레이터(iOS 27.0), View Body (Legacy), 변경 전후 각 5회 교차 측정 후 중앙값 비교, 괄호는 5회 측정 범위
  • 시나리오: 알림 탭에서 읽지 않음과 정렬 칩을 1초 간격으로 30회 번갈아 탭
  • 알림 로딩과 리스너를 임시로 고정 더미 데이터(알림 60건)로 대체한 로컬 빌드이며 커밋에는 포함하지 않음
대상 변경 전 횟수 변경 전 시간 변경 후 횟수 변경 후 시간
PushNotificationListView 64회 32.33ms (30.92 ~ 35.18) 3회 0.65ms (0.54 ~ 0.83)
PushNotificationListContent - - 60회 12.88ms (12.11 ~ 13.35)
PushNotificationFilterBar - - 30회 6.65ms (5.74 ~ 7.03)
합계 64회 32.33ms (30.92 ~ 35.18) 93회 20.28ms (18.96 ~ 20.84)
  • 칩 탭 시 부모 body 재평가가 사라진 것이 감소의 주된 원인
  • 분리한 View가 추가로 평가되어 평가 횟수 합은 늘었으나, 한 번의 평가 비용이 작아 시간 합계는 감소
  • PushNotificationListContent가 칩 탭마다 거의 매번 재평가되어 시간 합계 감소 폭은 부모 평가 횟수 감소 폭보다 작음
  • 실제 Firestore 데이터와 스크롤, 페이지네이션 시나리오는 측정 대상에서 제외

@opficdev opficdev self-assigned this Oct 28, 2026
@opficdev
opficdev merged commit 25c5de8 into develop Oct 28, 2026
9 checks passed
@opficdev
opficdev deleted the refactor/#882 branch October 28, 2026 10:16
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.

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

1 participant