Skip to content

[Fix-T3-208] 루틴 리스트에서 루틴 수정 내역 반영#82

Merged
choijungp merged 1 commit intodevelopfrom
fix/update-toast
Feb 10, 2026
Merged

[Fix-T3-208] 루틴 리스트에서 루틴 수정 내역 반영#82
choijungp merged 1 commit intodevelopfrom
fix/update-toast

Conversation

@choijungp
Copy link
Contributor

@choijungp choijungp commented Feb 10, 2026

🌁 Background

루틴 수정 후 루틴 리스트에 반영이 안되는 버그를 수정했어요 ~
추가적으로 토스트 메시지도 띄웠어요 ~~

📱 Screenshot

1. 당일루틴 수정 (반복 X)

iPhone SE3
Simulator Screen Recording - iPhone 16 Pro - 2026-02-10 at 17 35 22

2. 반복 루틴 수정, 당일부터 적용

iPhone SE3
Simulator Screen Recording - iPhone 16 Pro - 2026-02-10 at 17 37 26

3. 수정된 루틴 다음 날부터 적용

수정된 루틴 다음 날부터 적용
Simulator Screen Recording - iPhone 16 Pro - 2026-02-10 at 17 38 05
  • 다음 날부터 수정하기를 선택했다면, 루틴 수정 내용은 다음 날 (11일)부터 적용된다.

👩‍💻 Contents

  • 루틴 수정 후 루틴 리스트에 수정된 내용 반영하기
  • 루틴 수정 후 토스트 메시지 띄우기

📣 Related Issue

  • close #T3-208

Summary by CodeRabbit

릴리스 노트

  • 새 기능
    • 루틴 업데이트 완료 시 사용자에게 피드백을 제공하는 토스트 알림 추가
    • 루틴 업데이트 후 루틴 목록 자동 새로고침 기능 추가

@choijungp choijungp self-assigned this Feb 10, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 10, 2026

워크스루

루틴 업데이트 시 알림 토스트를 표시하는 기능이 추가되었습니다. 새로운 알림 상수를 정의하고, 루틴 생성 후 알림을 발행하며, 루틴 목록 화면에서 이를 구독하여 데이터를 새로고침하고 토스트 메시지를 표시합니다.

변경 사항

코호트 / 파일(s) 요약
알림 확장
Projects/Presentation/Sources/Common/Extension/Notification+.swift
새로운 공개 알림 상수 showUpdatedRoutineToast 추가. 기존 루틴 추천/삭제 토스트와 함께 관리됨.
루틴 생성 플로우
Projects/Presentation/Sources/RoutineCreation/ViewModel/RoutineCreationViewModel.swift, Projects/Presentation/Sources/RoutineCreation/View/RoutineCreationViewController.swift
Input 열거형에 showUpdateRoutineToastMessageView 케이스 추가, 0.6초 지연 후 알림 발행 메서드 구현, 뷰 컨트롤러에서 팝 전 토스트 메시지 표시 로직 추가.
루틴 목록 화면
Projects/Presentation/Sources/RoutineList/View/RoutineListViewController.swift
.showUpdatedRoutineToast 알림 감시자 추가. 수신 시 루틴 목록과 일일 루틴을 새로고침하고 업데이트 토스트 메시지 표시.

시퀀스 다이어그램

sequenceDiagram
    participant RCV as RoutineCreationViewController
    participant RCVM as RoutineCreationViewModel
    participant NC as NotificationCenter
    participant RLVC as RoutineListViewController

    RCV->>RCVM: showUpdateRoutineToastMessageView
    RCVM->>RCVM: showUpdatedRoutineToastMessageView()
    Note over RCVM: 0.6초 지연 후
    RCVM->>NC: post(.showUpdatedRoutineToast)
    NC->>RLVC: 알림 전달
    RLVC->>RLVC: 루틴 목록 새로고침
    RLVC->>RLVC: updateToastMessage 표시
    RLVC->>RCV: pop view controller
Loading

예상 코드 리뷰 노력

🎯 2 (Simple) | ⏱️ ~12분

🐰 새 알림이 솨악 날아와,
루틴 업데이트를 알리네.
토스트 메시지 띄우고,
목록을 새로고침하며,
사용자 경험 한층 더 매끈해지는구나! 🥕✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Pull request title accurately describes the main change: adding routine update reflection and toast messages to the routine list, which aligns with the PR objective of fixing routine edit changes not appearing in the list.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/update-toast

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
Projects/Presentation/Sources/RoutineCreation/View/RoutineCreationViewController.swift (1)

144-162: ⚠️ Potential issue | 🟠 Major

버그: 새 루틴 등록 시에도 "수정 완료" 토스트가 표시됩니다.

else 분기는 isFromMypage == false인 모든 경우에 실행됩니다. 첫 번째 init은 새 루틴 등록(updateInfo == nil)과 루틴 수정(updateInfo 존재) 모두에서 isFromMypage = false로 설정하므로, 새 루틴 등록 시에도 showUpdateRoutineToastMessageView가 호출되어 "루틴 수정이 완료되었습니다" 토스트가 표시됩니다.

예: RoutineListViewControlleremptyView에서 새 루틴을 등록하면 이 경로를 탑니다.

제안: 수정 모드일 때만 업데이트 토스트를 표시
             } else {
-                viewModel.action(input: .showUpdateRoutineToastMessageView)
+                if navigationTitle == "루틴 수정" {
+                    viewModel.action(input: .showUpdateRoutineToastMessageView)
+                }
                 self.navigationController?.popViewController(animated: true)
             }

또는 updateInfo의 존재 여부를 별도 프로퍼티(isEditMode 등)로 저장해두고 판별하는 것이 더 명확합니다.

🧹 Nitpick comments (2)
Projects/Presentation/Sources/RoutineList/View/RoutineListViewController.swift (1)

154-162: fetchDailyRoutine이 중복 호출될 수 있습니다.

Line 158의 fetchRoutineList 완료 시, fetchRoutinesResultPublisher 구독(Line 123-130)에 의해 fetchDailyRoutine이 이미 트리거됩니다. Line 159에서 fetchDailyRoutine을 추가로 직접 호출하면 불필요한 이중 네트워크 요청이 발생할 수 있습니다.

제안: 직접 호출 제거
         NotificationCenter.default.publisher(for: .showUpdatedRoutineToast)
             .receive(on: DispatchQueue.main)
             .sink { [weak self] _ in
                 guard let self else { return }
                 self.viewModel.action(input: .fetchRoutineList)
-                self.viewModel.action(input: .fetchDailyRoutine)
                 self.toastMessageView.showToastMessageView(message: updateToastMessage)
             }
             .store(in: &cancellables)
Projects/Presentation/Sources/RoutineCreation/ViewModel/RoutineCreationViewModel.swift (1)

298-305: 타이밍 기반 지연(0.6초)은 registerRoutine의 완료를 보장하지 않습니다.

registerRoutine()Task 내에서 비동기로 실행되지만 완료 시그널이 없습니다. 네트워크 상태에 따라 0.6초 내에 저장이 완료되지 않으면, 알림을 받은 RoutineListViewController가 아직 반영되지 않은 데이터를 fetch하게 됩니다.

기존 showRecommendedRoutineToastMessageView(0.1초)도 동일한 문제가 있으므로 기존 패턴의 한계이긴 하나, 이상적으로는 registerRoutine 완료 후 콜백/퍼블리셔를 통해 토스트를 트리거하는 것이 안전합니다.

@choijungp choijungp merged commit 3965182 into develop Feb 10, 2026
2 checks passed
@choijungp choijungp deleted the fix/update-toast branch February 10, 2026 08:54
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