Skip to content

[REFACTOR] 알림 타입 정의 및 리펙토링 - #261

Merged
eum018 merged 13 commits into
developfrom
refactor/#260-define-notification-type
Jun 22, 2026
Merged

[REFACTOR] 알림 타입 정의 및 리펙토링#261
eum018 merged 13 commits into
developfrom
refactor/#260-define-notification-type

Conversation

@eum018

@eum018 eum018 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

📌 개요

알림 조회 API에서 보내는 알림 타입을 enum으로 정의하여,
구분하는 것을 목적으로 합니다.


🧩 작업 내용

  • 알림 타입 NotificationType으로 정의
  • 타입에 따른 구분
  • 알림 기능 정상적으로 작동되는 지 검증

📎 참고 사항

eum018 and others added 4 commits June 15, 2026 20:43
서버 알림 타입을 매직 스트링 대신 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>
@eum018
eum018 requested review from heoeunseo08 and ryusuye0n June 16, 2026 02:49
@eum018 eum018 self-assigned this Jun 16, 2026
@eum018 eum018 added the refactor 구조 개선 (기능 변화 X) label Jun 16, 2026
@eum018 eum018 linked an issue Jun 16, 2026 that may be closed by this pull request
3 tasks

@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 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.

Comment thread lib/presentation/notification/screens/notification_screen.dart Outdated
Comment thread lib/data/models/notification/response/notification_model.dart Outdated
Comment thread lib/core/constants/notification_type.dart
Comment thread lib/presentation/notification/controllers/notification_controller.dart Outdated
Comment thread lib/presentation/notification/screens/notification_screen.dart Outdated
eum018 and others added 8 commits June 16, 2026 11:59
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

@ryusuye0n ryusuye0n 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.

수고하셨습니다

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

@heoeunseo08 heoeunseo08 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.

수고하셨습니다.

@eum018
eum018 merged commit 206a6cb into develop Jun 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor 구조 개선 (기능 변화 X)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[REFACTOR] 알림 유형 타입 정의

3 participants