Skip to content

[#506] 토스트를 현재 씬에 떠 있는 최상위 뷰 기반으로 뜨도록 수정한다#533

Merged
opficdev merged 7 commits into
developfrom
refactor/#506-toast
Jun 4, 2026
Merged

[#506] 토스트를 현재 씬에 떠 있는 최상위 뷰 기반으로 뜨도록 수정한다#533
opficdev merged 7 commits into
developfrom
refactor/#506-toast

Conversation

@opficdev

@opficdev opficdev commented Jun 4, 2026

Copy link
Copy Markdown
Owner

🔗 연관된 이슈

🎯 의도

  • NavigationSplitView detail 영역에 종속되던 toast 표시 위치를 MainView 상위 host로 이동
  • 여러 화면에서 ToastPresenter.present(...) 형태로 toast를 요청할 수 있도록 표시 책임 중앙화
  • 새 toast 요청 시 기존 toast를 즉시 종료하고 새 toast를 표시하는 상태 관리 적용

📝 작업 내용

📌 요약

  • ToastPresenter 기반 toast 표시 구조 추가
  • MainView.toastHost() 적용
  • Home, TodoList, PushNotification, Account의 개별 .toast(...) modifier 제거
  • 각 ViewModel에서 ToastPresenter.present(...) 호출 방식으로 toast 요청 이전
  • legacy toast modifier 제거
  • delete undo 관련 테스트를 ToastPresenter 기준으로 수정

🔍 상세

  • ToastPresenter를 Presentation 내부 singleton 형태로 구성
  • 외부 호출부는 ToastPresenter.present(...) 형태로 통일
  • ToastPresenter.shared 형태의 외부 접근 제거
  • ToastItem 교체 시 기존 item의 onDismiss를 즉시 실행하도록 처리
  • ToastOverlayView의 dismiss completion work item을 관리해 교체/해제 시 중복 dismiss 방지
  • delete undo toast의 dismiss 처리를 item id 기준으로 분리해 이전 toast 종료가 새 toast 상태를 지우지 않도록 조정
  • HomeView, TodoListView, PushNotificationListView, AccountView에 있던 화면별 toast state 및 modifier 제거
  • DeleteWebPageTests, DeletePushNotificationTests에서 ToastPresenter.reset()으로 singleton 상태 초기화

📸 영상 / 이미지 (Optional)

2026-06-04.11.44.25.mov
2026-06-04.11.41.56.mov
개선 전 개선 후

@opficdev opficdev self-assigned this Jun 4, 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

이번 풀 리퀘스트에서는 기존의 개별 뷰 모디파이어 기반 토스트 시스템을 @observable 기반의 전역 ToastPresenter 싱글톤 패턴으로 리팩토링하였습니다. 이에 따라 각 ViewModel에서 관리하던 토스트 상태를 제거하고 ToastPresenter.present를 호출하도록 변경하였으며, MainView에 .toastHost()를 추가하여 토스트가 전역적으로 표시되도록 개선했습니다. 리뷰 피드백으로는 ToastPresenter가 SwiftUI 뷰 상태를 직접 변경하므로 메인 스레드 안전성을 확보해야 하며, 의존성 주입(DI) 편의성을 위해 클래스 전체 대신 UI를 업데이트하는 특정 메서드에만 @mainactor를 적용하거나 내부에서 메인 스레드로 디스패치할 것을 권장하는 의견이 제시되었습니다.

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/Common/Component/Toast.swift
@opficdev opficdev added the qa TestFlight에 배포 label Jun 4, 2026
@opficdev opficdev merged commit 8759395 into develop Jun 4, 2026
5 checks passed
@opficdev opficdev deleted the refactor/#506-toast branch June 4, 2026 03:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

qa TestFlight에 배포

Projects

None yet

Development

Successfully merging this pull request may close these issues.

토스트를 현재 씬에 떠 있는 최상위 뷰 기반으로 뜨도록 수정한다

1 participant