[#506] 토스트를 현재 씬에 떠 있는 최상위 뷰 기반으로 뜨도록 수정한다#533
Merged
Conversation
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 연관된 이슈
🎯 의도
NavigationSplitViewdetail 영역에 종속되던 toast 표시 위치를MainView상위 host로 이동ToastPresenter.present(...)형태로 toast를 요청할 수 있도록 표시 책임 중앙화📝 작업 내용
📌 요약
ToastPresenter기반 toast 표시 구조 추가MainView에.toastHost()적용Home,TodoList,PushNotification,Account의 개별.toast(...)modifier 제거ToastPresenter.present(...)호출 방식으로 toast 요청 이전ToastPresenter기준으로 수정🔍 상세
ToastPresenter를 Presentation 내부 singleton 형태로 구성ToastPresenter.present(...)형태로 통일ToastPresenter.shared형태의 외부 접근 제거ToastItem교체 시 기존 item의onDismiss를 즉시 실행하도록 처리ToastOverlayView의 dismiss completion work item을 관리해 교체/해제 시 중복 dismiss 방지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