[REFACTOR] 알림 타입 정의 및 리펙토링 - #261
Conversation
서버 알림 타입을 매직 스트링 대신 NotificationType enum으로 관리. NotificationModel.type, NotificationEntity.type을 String에서 NotificationType으로 변경하고, fromJson/toJson에서 enum value로 매핑. 기존 presentation 레이어의 NotificationState enum은 제거하고 core/constants의 NotificationType으로 대체.
NotificationRepository.loadMyNotificationModel, LoadMyNotificationListUseCase의 반환 타입을 List<NotificationEntity>에서 ListableWrapper<NotificationEntity>로 변경. post/chat에서 사용 중인 페이지네이션 패턴과 동일하게 totalElements, totalPages, last 등 서버 페이징 정보를 함께 전달.
- ListableWrapper의 totalPages로 PageView/인디케이터 페이지 수를 결정하고, loadedPages로 로드된 페이지만 렌더링하며 미로드 페이지는 loadMore로 지연 로딩 - 알림 카드 탭 시 read 호출로 읽음 처리, 이미 읽은 알림은 재요청 생략 - 알림 개수 표시를 totalElements 기준으로 변경, 읽은 알림 삭제 시 totalElements 감소 처리 - readAll에서 RxList.assignAll에 lazy map을 직접 전달해 목록이 전부 사라지던 버그 수정 (toList()로 즉시 평가) - 알림 화면 진입을 Get.to 대신 context.push로 변경하고, 재진입 시 컨트롤러를 refresh하도록 라우팅 정리
height: double.minPositive로 선언된 PopupMenuItem의 히트 테스트 오동작으로 전체 읽기 탭 시 읽은 알림 삭제 핸들러가 실행되는 버그 수정 알림 버튼 비활성화 조건 제거 (읽지 않은 알림 없어도 화면 진입 가능) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request refactors the notification system to support pagination, introducing a new NotificationType enum and updating the repository, controller, and screen to handle paginated data via ListableWrapper. The review feedback highlights several critical stability and state management issues: a potential RangeError when slicing the notification list after deletions, a potential StateError crash when parsing undefined notification types, and duplicate page requests in loadMore(). Additionally, the reviewer recommends adding an unknown type to the enum for forward compatibility, updating pagination states when deleting notifications, and wrapping the loadMore() call in WidgetsBinding.instance.addPostFrameCallback to avoid state changes during the build phase.
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.
await 이후 context.pop() 호출 시 context.mounted 체크 추가 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
loadMore 페이지 기준을 currentPageIndex에서 loadedPages로 수정 삭제 후 totalPages/loadedPages/currentPageIndex 재계산 추가 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
sublist start 범위 초과 방지를 위해 min() 처리 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
unknown 타입 추가 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
알 수 없는 타입 수신 시 unknown으로 fallback 처리 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
HomePostRankItem의 GestureDetector에 HitTestBehavior.opaque 추가하여 투명 영역에서 탭 이벤트가 발화되지 않던 문제 수정 Resolve: #260
Flutter migrator 자동 추가 builtInKotlin, newDsl 플래그 반영 meta 1.17.0→1.18.0, test_api 0.7.10→0.7.11 버전 업데이트 Resolve: #260
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
📌 개요
알림 조회 API에서 보내는 알림 타입을 enum으로 정의하여,
구분하는 것을 목적으로 합니다.
🧩 작업 내용
📎 참고 사항