Files
sodalive-ios/docs/20260313_토스트비차단표시통일.md

66 lines
3.5 KiB
Markdown

# 20260313 토스트 비차단 표시 통일
- [x] 토스트 공통 구현/사용 지점 탐색
- [x] 비차단 토스트 표시 정책(동적 아일랜드형 또는 하단 슬라이드형) 선택 및 공통 적용
- [x] 기존 `.popup(... type: .toast ...)` 사용처가 공통 정책을 따르도록 정리
- [x] 정적 진단/빌드/테스트 검증 수행 및 결과 기록
## 검증 기록
### 1차
- 무엇/왜/어떻게: 기존 `PopupView` 기반 토스트 호출을 전역에서 제거하고, 비차단 Dynamic Island 형태의 공통 토스트 modifier(`sodaToast`)로 통일했다. 토스트 표시 중 스크롤/입력을 막지 않도록 오버레이에 `allowsHitTesting(false)`를 적용했다.
- 실행 명령:
- 전역 호출 치환/검증
- `grep(pattern="\\.popup\\(", path="SodaLive/Sources", include="*.swift")` → 결과 없음
- `grep(pattern="\\.sodaToast\\(", path="SodaLive/Sources", include="*.swift")` → 99개 호출 확인
- 빌드
- `xcodebuild -workspace "SodaLive.xcworkspace" -scheme "SodaLive" -configuration Debug build`
- `xcodebuild -workspace "SodaLive.xcworkspace" -scheme "SodaLive-dev" -configuration Debug build`
- 테스트
- `xcodebuild -workspace "SodaLive.xcworkspace" -scheme "SodaLive" test`
- `xcodebuild -workspace "SodaLive.xcworkspace" -scheme "SodaLive-dev" test`
- 정적 진단
- `lsp_diagnostics`: `SodaLive/Sources/Common/BaseView.swift`, `SodaLive/Sources/Search/SearchView.swift`, `SodaLive/Sources/Content/Main/V2/Replay/ContentMainTabReplayView.swift`
- 결과:
- `.popup(... type: .toast ...)`: 전역 0건 확인
- `.sodaToast(...)`: 전역 99건 적용 확인
- `SodaLive` Debug 빌드: 성공(`** BUILD SUCCEEDED **`)
- `SodaLive-dev` Debug 빌드: 성공(`** BUILD SUCCEEDED **`)
- `SodaLive` 테스트: 실패 - `Scheme SodaLive is not currently configured for the test action.`
- `SodaLive-dev` 테스트: 실패 - `Scheme SodaLive-dev is not currently configured for the test action.`
- `lsp_diagnostics`: SourceKit 로컬 해석 한계로 모듈/심볼 미해결 오류가 출력되었으나, 실제 Xcode 빌드는 양 스킴 모두 성공
### 2차
- 무엇/왜/어떻게: 사용자 추가 요청에 따라 토스트 배경색을 `#3BB9F1`로 변경하고, 기존 투명도(`0.92`)를 동일하게 유지했다.
- 실행 명령:
- 정적 진단
- `lsp_diagnostics`: `SodaLive/Sources/Common/BaseView.swift`
- 빌드
- `xcodebuild -workspace "SodaLive.xcworkspace" -scheme "SodaLive" -configuration Debug build`
- 테스트
- `xcodebuild -workspace "SodaLive.xcworkspace" -scheme "SodaLive" test`
- 결과:
- `SodaLive/Sources/Common/BaseView.swift` 진단: 오류 없음
- `SodaLive` Debug 빌드: 성공(`** BUILD SUCCEEDED **`)
- `SodaLive` 테스트: 실패 - `Scheme SodaLive is not currently configured for the test action.`
## 다른 UI에서 사용 방법
- 토스트가 필요한 View에 아래 형태로 동일하게 적용한다.
```swift
.sodaToast(
isPresented: $viewModel.isShowPopup,
message: viewModel.errorMessage,
autohideIn: 2
)
```
- 파라미터 규칙
- `isPresented`: 표시 상태 바인딩 (`Binding<Bool>`)
- `message`: 사용자에게 노출할 문자열
- `autohideIn`: 자동 숨김 초(기본값 `2`)
- UI 정책
- 위치/스타일은 공통 Dynamic Island 형태로 고정되어 별도 커스터마이즈 없이 동일 UX를 유지한다.
- 터치 차단이 없도록 구현되어 토스트 표시 중에도 스크롤/텍스트 입력이 가능하다.