-
Notifications
You must be signed in to change notification settings - Fork 0
feat: 로딩 인디케이터에 딜레이 적용 #209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Walkthrough로딩 인디케이터가 지연 표시되도록 show(delay:) API가 추가되어 DispatchWorkItem으로 표시를 예약하고 중복 예약을 방지합니다. hide()는 예약 취소 후 인디케이터를 제거합니다. 또한 NoteCompletionViewController의 오류 알림이 UIAlertController에서 BKDialog 기반 presentErrorDialog()로 대체되었습니다. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant VC as UIViewController
participant LI as BKLoadingIndicator
participant Win as Key Window
User->>VC: showLoading()
VC->>LI: show(delay=0.5)
note right of LI #E6F7FF: delayedWorkItem 생성 및 예약\n중복 예약 있으면 반환
LI-->>LI: (0.5s 후) 예약된 작업 실행
LI->>Win: 로딩 뷰 생성/태그/추가
LI->>LI: 애니메이션 시작
User->>VC: hideLoading()
VC->>LI: hide()
LI->>LI: delayedWorkItem?.cancel() 및 해제
LI->>Win: 로딩 뷰 제거
sequenceDiagram
autonumber
participant VC as NoteCompletionViewController
participant VM as ViewModel
participant Dialog as BKDialog
VM-->>VC: error 이벤트
VC->>VC: presentErrorDialog()
VC->>Dialog: 생성(title:"오류", leftBtn:"기록을 불러올 수 없습니다.")
Dialog->>VC: 버튼액션
VC->>VM: .errorHandled
VC->>VC: 다이얼로그 닫기
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Assessment against linked issues
Pre-merge checks (3 passed, 2 warnings)❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Flag potential breaking changes that are not documented:
1. Identify changes to public APIs/exports, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints (including removed/renamed items and changes to types, required params, return values, defaults, or behavior).
2. Ignore purely internal/private changes (e.g., code not exported from package entry points or marked internal).
3. Verify documentation exists: a "Breaking Change" section in the PR description and updates to CHANGELOG.md.Please share your feedback with us on this Discord post. ✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (2)
src/Projects/BKDesign/Sources/Components/BKLoading/BKLoadingIndicator.swift (2)
3-4: 불필요한 import(SnapKit) 제거 제안이 파일에서 SnapKit을 사용하지 않습니다. 불필요한 의존성 노출을 줄이기 위해 import를 제거하는 편이 깔끔합니다.
-import SnapKit import UIKit
29-30: 지연 값 방어 코드(클램프) 추가 제안음수 지연이 들어오면 즉시 실행되지만, 의도 명확화를 위해 0으로 클램프하는 편이 안전합니다.
- DispatchQueue.main.asyncAfter(deadline: .now() + delay, execute: workItem) + DispatchQueue.main.asyncAfter(deadline: .now() + max(0, delay), execute: workItem)추가로, 새
show(delay:)가 더 짧은 지연으로 호출되면 기존 예약을 취소하고 재예약하는 정책(옵션)을 고려해 보세요.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
src/Projects/BKDesign/Sources/Components/BKLoading/BKLoadingIndicator.swift(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
🔇 Additional comments (3)
src/Projects/BKDesign/Sources/Components/BKLoading/BKLoadingIndicator.swift (3)
9-9: 지연 작업 핸들 보관 방식 OK메인 큐에서만 읽고/쓰도록 보장되어 데이터 레이스 우려가 낮습니다. 네이밍과 접근 제어도 적절합니다.
16-16: 중복 예약 방지 로직 적절지연 표시가 이미 예약된 경우 재예약을 막아 플리커/중복 표시를 예방합니다.
12-14: LoadingIndicator.show에 delay 기본값 추가로 인한 영향 없음 확인됨
- 리포지토리 내
LoadingIndicator.show()직접 호출은showLoading()내부 사용(파일: BKLoadingIndicator.swift)뿐이며, 외부 모듈에서는showLoading()API만 사용 중이므로 바이너리 의존 모듈 재컴파일 불필요- 기본값 0.5초는 PR 의도에 부합
- 선택: UIViewController 확장에서 delay 커스터마이징 가능한 오버로드 추가 고려
src/Projects/BKDesign/Sources/Components/BKLoading/BKLoadingIndicator.swift
Show resolved
Hide resolved
src/Projects/BKDesign/Sources/Components/BKLoading/BKLoadingIndicator.swift
Show resolved
Hide resolved
doyeonk429
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
성과공유회 보고 iOS에도 도입하면 좋겠다고 생각했는데, 좋네요. combine에서 처리하면 더 간단한 로직으로 처리 가능할 것 같은데, 인디케이터 객체에 또 다는게 좋아보이기도 하네요.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/Projects/BKPresentation/Sources/MainFlow/NoteCompletion/View/NoteCompletionViewController.swift (1)
63-74: 로딩 딜레이 미적용—showLoading()이 즉시 표시 호출
BKLoadingIndicator.showLoading()내부에서LoadingIndicator.show()만 호출해 0.5초 기본 지연이 적용되지 않습니다. 지연 표시(BKLoadingIndicator.show(delay:))가 사용되도록 수정 필요합니다.
🧹 Nitpick comments (2)
src/Projects/BKPresentation/Sources/MainFlow/NoteCompletion/View/NoteCompletionViewController.swift (2)
79-81: 연속 에러 이벤트 시 중복 present 방지 가드 제안빠르게 연속 에러가 발행되면 이미 모달이 떠 있는 상태에서 또 present 시도할 수 있습니다. 간단한 가드로 방지하는 편이 안전합니다.
다음과 같이 변경 제안:
- .sink { [weak self] _ in - self?.presentErrorDialog() - } + .sink { [weak self] _ in + guard let self = self, self.presentedViewController == nil else { return } + self.presentErrorDialog() + }
167-181: BKDialog 카피/버튼 라벨 UX 보정현재 버튼 라벨이 본문 메시지 역할을 하고 있어 UX가 어색합니다. 타이틀은 메시지, 버튼은 “확인”으로 정리하는 편이 자연스럽습니다. 중첩 [weak self]도 한 번으로 단순화 가능합니다.
- let dialog = BKDialog( - title: "오류", + let dialog = BKDialog( + title: "기록을 불러올 수 없습니다.", config: .init( - leftButtonTitle: "기록을 불러올 수 없습니다.", - leftButtonAction: { [weak self] in - self?.dismiss(animated: true) { [weak self] in - self?.viewModel.send(.errorHandled) - } - } + leftButtonTitle: "확인", + leftButtonAction: { [weak self] in + guard let self else { return } + self.dismiss(animated: true) { + self.viewModel.send(.errorHandled) + } + } ) )참고: 과거 러닝에 따라 에러 상세 카피는 추후로 미루셔도 OK입니다.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/Projects/BKDesign/Sources/Components/BKLoading/BKLoadingIndicator.swift(1 hunks)src/Projects/BKPresentation/Sources/MainFlow/NoteCompletion/View/NoteCompletionViewController.swift(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- src/Projects/BKDesign/Sources/Components/BKLoading/BKLoadingIndicator.swift
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-08-01T20:35:39.806Z
Learnt from: clxxrlove
PR: YAPP-Github/Reed-iOS#134
File: src/Projects/BKPresentation/Sources/MainFlow/Note/ViewModel/NoteViewModel.swift:66-74
Timestamp: 2025-08-01T20:35:39.806Z
Learning: clxxrlove는 NoteViewModel에서 UI 에러 처리를 추후 작업으로 계획하며, 현재 단계에서는 기본 기능 구현에 집중하는 것을 선호한다고 명시했다.
Applied to files:
src/Projects/BKPresentation/Sources/MainFlow/NoteCompletion/View/NoteCompletionViewController.swift
📚 Learning: 2025-07-30T11:32:20.533Z
Learnt from: clxxrlove
PR: YAPP-Github/Reed-iOS#120
File: src/Projects/BKPresentation/Sources/AppCoordinator.swift:31-41
Timestamp: 2025-07-30T11:32:20.533Z
Learning: Reed-iOS 프로젝트의 OnboardingCheckUseCase.execute() 메서드는 AnyPublisher<Bool, Never>를 반환하므로 실패할 수 없도록 설계되었다. Never 타입은 에러가 발생하지 않음을 보장하므로 에러 처리 로직이 불필요하다.
Applied to files:
src/Projects/BKPresentation/Sources/MainFlow/NoteCompletion/View/NoteCompletionViewController.swift
🧬 Code graph analysis (1)
src/Projects/BKPresentation/Sources/MainFlow/NoteCompletion/View/NoteCompletionViewController.swift (1)
src/Projects/BKPresentation/Sources/MainFlow/NoteCompletion/ViewModel/NoteCompletionViewModel.swift (1)
send(51-55)
🔗 관련 이슈
📘 작업 유형
📙 작업 내역
🧪 테스트 내역
🎨 스크린샷 또는 시연 영상 (선택)
Simulator.Screen.Recording.-.iPhone.SE.3rd.generation.-.2025-09-04.at.09.13.57.mp4
서버 로딩이 너무 빨라서 인디케이터가 보기 쉽지 않네요.로딩 시간이 500ms를 넘어가야만 로딩 인디케이터가 나옵니다.
Summary by CodeRabbit