Skip to content

✨ :: (#448) 알림 읽음/안읽음 필터링 구현#449

Open
leejh08 wants to merge 1 commit into
mainfrom
feature/(#448)-notification_read_unread_filter
Open

✨ :: (#448) 알림 읽음/안읽음 필터링 구현#449
leejh08 wants to merge 1 commit into
mainfrom
feature/(#448)-notification_read_unread_filter

Conversation

@leejh08

@leejh08 leejh08 commented Jun 27, 2026

Copy link
Copy Markdown
Member

Summary

  • NotificationsAPI.fetchNotificationList의 의미없는 ["is_new": ""] 파라미터 제거 → .requestPlain으로 교체
  • AlarmReactorNotificationFilter enum(all/unread/read) 및 클라이언트 사이드 필터 로직 추가
  • AlarmViewController에 세그먼트 컨트롤(전체/안읽음/읽음) UI 추가 및 filteredList 바인딩

Changes

파일 변경 내용
NotificationsAPI.swift is_new 파라미터 제거, TODO 주석 제거
AlarmReactor.swift NotificationFilter enum, filterChanged Action, setFilter Mutation, filteredList computed property 추가
AlarmViewController.swift UISegmentedControl 추가, filteredList 바인딩

Test plan

  • 알림 화면 진입 시 전체 목록 표시 확인
  • "안읽음" 탭 선택 시 new == true 항목만 표시 확인
  • "읽음" 탭 선택 시 new == false 항목만 표시 확인
  • 알림 탭 후 읽음 처리 → 현재 필터 기준으로 즉시 반영 확인

Closes #448

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • 알림 목록 상단에 필터를 추가해 전체/안읽음/읽음으로 바로 전환할 수 있게 되었습니다.
    • 선택한 필터에 따라 목록이 즉시 변경되도록 개선되었습니다.
  • Bug Fixes

    • 알림 목록 조회 방식이 단순화되어 더 안정적으로 동작하도록 조정되었습니다.

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

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

알림 목록 요청은 쿼리 파라미터 없이 구성되며, 알림 화면에 전체/안읽음/읽음 필터가 추가되었습니다. AlarmReactor는 필터 상태와 계산된 목록을 관리하고, AlarmViewController는 세그먼트 선택에 따라 표시 목록을 바꿉니다.

Changes

알림 필터 요청·표시 흐름

Layer / File(s) Summary
요청 형식 변경
Projects/Data/Sources/DataSource/API/NotificationsAPI.swift
fetchNotificationListrequestPlain으로 구성되어 쿼리 파라미터를 보내지 않는다.
필터 상태와 목록 계산
Projects/Presentation/Sources/Home/Alarm/AlarmReactor.swift
NotificationFilter, filterChanged, setFilter, filter, filteredList가 추가되고, filteredListnotificationListnew 값으로 분기된다.
세그먼트와 목록 바인딩
Projects/Presentation/Sources/Home/Alarm/AlarmViewController.swift
필터 세그먼트가 테이블 상단에 배치되고, 선택 인덱스가 필터 액션으로 변환되며 테이블은 filteredList에 바인딩된다.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant AlarmViewController
  participant AlarmReactor
  User->>AlarmViewController: 필터 세그먼트 선택
  AlarmViewController->>AlarmReactor: filterChanged 액션 전달
  AlarmReactor-->>AlarmViewController: filter와 filteredList 갱신
  AlarmViewController-->>User: 필터된 알림 목록 표시
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 깡총깡총 알림판에
전체, 안읽음, 읽음이 줄을 서고
filteredList가 폴짝 바뀌면
토끼 마음도 같이 반짝

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning Data/Domain 계층의 isNew 전달과 조건부 is_new 전송이 누락되어, 링크된 요구사항을 모두 충족하지 못합니다. NotificationsAPI부터 Repository, UseCase, DataSource까지 isNew: Bool?를 전달하고, 전체 조회 시에만 파라미터를 생략하도록 수정하세요.
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 (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목이 알림 읽음/안읽음 필터링 구현이라는 주요 변경을 정확히 요약합니다.
Out of Scope Changes check ✅ Passed 요약된 변경은 알림 필터링 구현 범위에 한정되어 별도 무관한 변경은 보이지 않습니다.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Projects/Data/Sources/DataSource/API/NotificationsAPI.swift`:
- Around line 52-55: `NotificationsAPI.task`에서 `fetchNotificationList`가
`requestPlain`으로 바뀌며 서버 필터링용 입력이 사라졌습니다. `fetchNotificationList`의 case 정의를
`isNew: Bool?`를 받도록 유지하고, `task`에서 값이 있을 때만 `is_new` 파라미터를 포함해 요청하도록 복구하세요.
`NotificationsAPI`와 `task`의 연동을 원래 PR 목적에 맞게 되돌려 클라이언트 분기 대신 서버 필터링이 적용되게 하세요.

In `@Projects/Presentation/Sources/Home/Alarm/AlarmViewController.swift`:
- Around line 68-69: The filtered table selection is currently being treated as
a raw original-array index, which can update the wrong notification. Update the
AlarmViewController bindState/select flow and the readNotification reducer so
selection is resolved by notificationID (preferred) or by mapping the filtered
row back to the original notificationList index before mutation. Use the
existing filteredList rendering and the readNotification / notificationList
symbols to ensure the tapped item is the one that gets marked read.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e1e14abd-089f-4683-b947-1f191ff32b92

📥 Commits

Reviewing files that changed from the base of the PR and between 3781864 and 05e342d.

📒 Files selected for processing (3)
  • Projects/Data/Sources/DataSource/API/NotificationsAPI.swift
  • Projects/Presentation/Sources/Home/Alarm/AlarmReactor.swift
  • Projects/Presentation/Sources/Home/Alarm/AlarmViewController.swift

Comment on lines 52 to +55
public var task: Task {
switch self {
case .fetchNotificationList:
return .requestParameters(
parameters:
// // TODO: 추후 읽음와 안읽음 분기처리 필요
["is_new": ""],
encoding: URLEncoding.queryString)
return .requestPlain

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

서버 필터링 경로가 사라졌습니다.

requestPlain으로 바뀌면서 fetchNotificationListisNew를 전달할 입력 자체를 잃었습니다. 지금 상태에서는 화면에서 이미 받아온 목록만 클라이언트에서 나누게 되므로, 응답이 페이징되거나 일부만 내려오면 읽음/안읽음 탭 결과가 불완전해집니다. PR 목표대로 fetchNotificationList(isNew: Bool?)를 유지하고, 값이 있을 때만 is_new를 붙이는 형태로 복구해야 합니다.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Projects/Data/Sources/DataSource/API/NotificationsAPI.swift` around lines 52
- 55, `NotificationsAPI.task`에서 `fetchNotificationList`가 `requestPlain`으로 바뀌며 서버
필터링용 입력이 사라졌습니다. `fetchNotificationList`의 case 정의를 `isNew: Bool?`를 받도록 유지하고,
`task`에서 값이 있을 때만 `is_new` 파라미터를 포함해 요청하도록 복구하세요. `NotificationsAPI`와 `task`의
연동을 원래 PR 목적에 맞게 되돌려 클라이언트 분기 대신 서버 필터링이 적용되게 하세요.

Comment on lines 68 to +69
public override func bindState() {
reactor.state.map { $0.notificationList }
reactor.state.map { $0.filteredList }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

필터된 row index를 원본 배열 index로 재사용하면 잘못된 항목이 갱신됩니다.

이제 테이블이 filteredList를 렌더링하므로 선택된 row는 필터된 배열 기준입니다. 그런데 현재 흐름은 그 값을 그대로 readNotification에 넘기고, 리듀서는 notificationList[index]를 수정하므로 .unread/.read 탭에서는 탭한 알림이 아닌 다른 원본 항목이 덮어써질 수 있습니다. index 대신 notificationID로 원본 배열을 찾아 갱신하거나, 선택 시 원본 배열 기준 index를 전달해야 합니다.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Projects/Presentation/Sources/Home/Alarm/AlarmViewController.swift` around
lines 68 - 69, The filtered table selection is currently being treated as a raw
original-array index, which can update the wrong notification. Update the
AlarmViewController bindState/select flow and the readNotification reducer so
selection is resolved by notificationID (preferred) or by mapping the filtered
row back to the original notificationList index before mutation. Use the
existing filteredList rendering and the readNotification / notificationList
symbols to ensure the tapped item is the one that gets marked read.

@leejh08 leejh08 self-assigned this Jul 2, 2026
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.

알림 읽음/안읽음 분기처리 구현

2 participants