Skip to content

refactor: registerAllCustomFonts 제거 + .shared 제거 + Recovery Router 클로저 전환 - #102

Merged
gomminjae merged 2 commits into
developfrom
refactor/cleanup-shared-router
May 31, 2026
Merged

gomminjae merged 2 commits into
developfrom
refactor/cleanup-shared-router

Conversation

@gomminjae

Copy link
Copy Markdown
Collaborator

Summary

  • NewdokApp: registerAllCustomFonts() 제거 — Tuist auto-registration으로 충분
  • BrandDetailViewModel: SubscribePopupPreference.shared 기본값 제거, DetailDIContainer에서 주입
  • Recovery 부분 뷰 4개(FindIdPhoneInputView, FindIdResultView, PasswordRecoveryNewPasswordView, PasswordRecoveryResultView)에서 @Environment(AppRouter.self) 제거 → 클로저로 전환
  • 부모 RecoveryView에서 클로저를 통해 네비게이션 위임

Test plan

  • 메인 앱에서 커스텀 폰트 정상 렌더링 확인
  • 브랜드 상세 페이지 정상 동작 확인
  • 아이디 찾기 → 회원가입/로그인/문의 네비게이션 정상 동작
  • 비밀번호 찾기 → 재설정 완료 후 로그인 화면 이동 + 토스트 표시

🤖 Generated with Claude Code

…outer 클로저 전환

- NewdokApp: registerAllCustomFonts() 제거 (Tuist auto-registration 사용)
- BrandDetailViewModel: SubscribePopupPreference.shared 기본값 제거, DIContainer에서 주입
- FindIdPhoneInputView, FindIdResultView: Router 제거 → onSignUp/onLogin/onContact 클로저
- PasswordRecoveryNewPasswordView, PasswordRecoveryResultView: Router 제거 → onPasswordResetComplete/onLogin 클로저
- RecoveryView(부모)에서 클로저로 네비게이션 위임

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@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

This pull request refactors the recovery flows (FindIdPagerView and PasswordRecoveryPagerView) to delegate navigation actions via closures instead of directly accessing the router environment, and updates BrandDetailViewModel initialization. The review feedback suggests improving Swift 6 concurrency safety by marking these navigation closures with @MainActor, and recommends adopting the modern Task.sleep(for:) API instead of Task.sleep(nanoseconds:) for better consistency and readability.

Comment on lines +41 to +44
Task { @MainActor in
try? await Task.sleep(nanoseconds: 500_000_000)
ToastCenter.shared.show("비밀번호가 재설정되었습니다.")
}

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.

medium

iOS 16 이상부터는 Task.sleep(nanoseconds:) 대신 Task.sleep(for:) API를 사용하는 것이 권장됩니다. 또한 프로젝트 내 다른 파일(예: PasswordRecoveryPagerView.swift의 244라인)에서도 Task.sleep(for: .seconds(...)) 형식을 사용하고 있으므로, 코드의 일관성과 현대적인 Swift API 준수를 위해 변경하는 것이 좋습니다.

Suggested change
Task { @MainActor in
try? await Task.sleep(nanoseconds: 500_000_000)
ToastCenter.shared.show("비밀번호가 재설정되었습니다.")
}
Task { @MainActor in
try? await Task.sleep(for: .seconds(0.5))
ToastCenter.shared.show("비밀번호가 재설정되었습니다.")
}

Comment on lines +18 to +19
let onPasswordResetComplete: () -> Void
let onLogin: () -> Void

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.

medium

이 클로저들은 UI 내비게이션 및 화면 전환을 트리거하는 역할을 합니다. Swift 6의 엄격한 동시성(Strict Concurrency) 검사를 준수하고 메인 스레드에서 안전하게 실행되도록 보장하기 위해, 클로저 타입을 @MainActor로 명시하는 것이 좋습니다.

Suggested change
let onPasswordResetComplete: () -> Void
let onLogin: () -> Void
let onPasswordResetComplete: @MainActor () -> Void
let onLogin: @MainActor () -> Void

struct PasswordRecoveryNewPasswordView: View {
@Bindable var viewModel: RecoveryViewModel
@Environment(AppRouter.self) private var router
let onPasswordResetComplete: () -> Void

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.

medium

UI 내비게이션을 유발하는 클로저이므로, Swift 6 동시성 안전성을 위해 @MainActor 속성을 추가하는 것이 좋습니다.

Suggested change
let onPasswordResetComplete: () -> Void
let onPasswordResetComplete: @MainActor () -> Void

@Bindable var viewModel: RecoveryViewModel
@Environment(AppRouter.self) private var router
let onLogin: () -> Void

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.

medium

UI 내비게이션을 유발하는 클로저이므로, Swift 6 동시성 안전성을 위해 @MainActor 속성을 추가하는 것이 좋습니다.

Suggested change
let onLogin: () -> Void
let onLogin: @MainActor () -> Void

Comment on lines +16 to +18
let onSignUp: () -> Void
let onLogin: () -> Void
let onContact: () -> Void

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.

medium

이 클로저들은 화면 전환 및 내비게이션 동작을 수행하므로, 메인 스레드 안전성과 Swift 6 동시성 호환성을 위해 @MainActor 속성을 지정하는 것이 좋습니다.

Suggested change
let onSignUp: () -> Void
let onLogin: () -> Void
let onContact: () -> Void
let onSignUp: @MainActor () -> Void
let onLogin: @MainActor () -> Void
let onContact: @MainActor () -> Void

}
struct FindIdPhoneInputView: View {
@Bindable var viewModel: RecoveryViewModel
let onSignUp: () -> Void

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.

medium

화면 전환을 유발하는 클로저이므로 메인 스레드 안전성을 위해 @MainActor 속성을 추가하는 것이 좋습니다.

Suggested change
let onSignUp: () -> Void
let onSignUp: @MainActor () -> Void

Comment on lines +137 to +138
let onLogin: () -> Void
let onContact: () -> Void

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.

medium

화면 전환을 유발하는 클로저이므로 메인 스레드 안전성을 위해 @MainActor 속성을 추가하는 것이 좋습니다.

Suggested change
let onLogin: () -> Void
let onContact: () -> Void
let onLogin: @MainActor () -> Void
let onContact: @MainActor () -> Void

SwiftLint만 유지, 빌드 검증은 로컬에서 수행.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gomminjae
gomminjae merged commit b2bff32 into develop May 31, 2026
1 check failed
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.

1 participant