Skip to content

[feat] 알림설정 구현#108

Merged
hyejun0228 merged 1 commit intodevelopfrom
107-feat-알림-설정-페이지-구현
Feb 17, 2026

Hidden character warning

The head ref may contain hidden characters: "107-feat-\uc54c\ub9bc-\uc124\uc815-\ud398\uc774\uc9c0-\uad6c\ud604"
Merged

[feat] 알림설정 구현#108
hyejun0228 merged 1 commit intodevelopfrom
107-feat-알림-설정-페이지-구현

Conversation

@hyejun0228
Copy link
Copy Markdown
Collaborator

@hyejun0228 hyejun0228 commented Feb 17, 2026

Summary by CodeRabbit

Release Notes

  • New Features
    • Users can now mute and unmute notifications for individual chat rooms
    • Muted state is visually indicated in the chat interface
    • New notification settings section added to the header panel for managing notification preferences

@hyejun0228 hyejun0228 self-assigned this Feb 17, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 17, 2026

📝 Walkthrough

Walkthrough

This change introduces a mute feature for chat rooms by extending the Room entity with an isMuted property, implementing a toggleMute mutation hook that calls the chat API and invalidates the room query cache, and wiring the functionality to a UI button in the ChatHeader component.

Changes

Cohort / File(s) Summary
Chat Entity
src/apis/chat/entity.ts
Added isMuted: boolean property to the Room interface to track mute state.
Mute Mutation Hook
src/pages/Chat/hooks/useChat.ts
Implemented toggleMute mutation that calls postChatMute API with error handling for missing chatRoomId/type, and invalidates room query cache on success.
Chat Header UI
src/components/layout/Header/components/ChatHeader.tsx
Extended useChat hook return type to expose toggleMute, derived isMuted state from chatRoom, wired toggle button to toggleMute() mutation, and added notification ("알림") UI section with state-dependent styling.

Sequence Diagram

sequenceDiagram
    participant User
    participant ChatHeader
    participant useChat Hook
    participant Chat API
    participant Query Cache

    User->>ChatHeader: Click mute toggle button
    ChatHeader->>useChat Hook: Call toggleMute()
    useChat Hook->>useChat Hook: Validate chatRoomId & type
    alt Validation Failed
        useChat Hook-->>ChatHeader: Throw error
    else Validation Passed
        useChat Hook->>Chat API: POST /chat/mute (chatRoomId, type)
        Chat API-->>useChat Hook: Success response
        useChat Hook->>Query Cache: Invalidate chat rooms query
        Query Cache->>Query Cache: Refresh room list
        Query Cache-->>ChatHeader: Update with new isMuted state
        ChatHeader->>ChatHeader: Re-render with muted UI
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A mute button hops into place,
Rooms can whisper now with grace,
Cache refreshes, state aligned,
Quiet chats, perfectly designed! 🔇

🚥 Pre-merge checks | ✅ 2 | ❌ 2

❌ Failed checks (2 warnings)

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.
Merge Conflict Detection ⚠️ Warning ⚠️ Unable to check for merge conflicts: Invalid branch name format
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title '알림설정 구현' (notification settings implementation) directly corresponds to the core changes: adding isMuted property to Room, implementing toggleMute functionality, and creating mute toggle UI in ChatHeader.

✏️ 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 107-feat-알림-설정-페이지-구현
⚔️ Resolve merge conflicts (beta)
  • Auto-commit resolved conflicts to branch 107-feat-알림-설정-페이지-구현
  • Create stacked PR with resolved conflicts
  • Post resolved changes as copyable diffs in a comment

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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

Copy link
Copy Markdown
Contributor

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

🧹 Nitpick comments (2)
src/pages/Chat/hooks/useChat.ts (1)

106-110: Consider adding optimistic updates or error handling for better UX.

Currently, if the mutation fails, the user has no feedback. You could optionally add an onError callback for error handling or implement optimistic updates using onMutate for a more responsive UI experience.

💡 Optional: Add optimistic update pattern
     onSuccess: () => {
       queryClient.invalidateQueries({
         queryKey: chatQueryKeys.rooms(),
       });
     },
+    onError: (error) => {
+      // Consider showing a toast or error notification
+      console.error('Failed to toggle mute:', error);
+    },
   });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/pages/Chat/hooks/useChat.ts` around lines 106 - 110, The mutation
currently only uses onSuccess to call queryClient.invalidateQueries in useChat
(the block with onSuccess -> queryClient.invalidateQueries({ queryKey:
chatQueryKeys.rooms() })); add an onError callback to surface failures (e.g.,
show toast/log and revert UI if needed) and optionally implement an optimistic
update using onMutate to update the cached rooms/room list immediately,
returning a context to rollback on onError and finalizing with onSettled or
onSuccess to re-sync via queryClient.invalidateQueries; update the mutation
definition in useChat.ts to include onMutate, onError, and onSettled handlers
referencing chatQueryKeys.rooms and the same queryClient instance.
src/components/layout/Header/components/ChatHeader.tsx (1)

48-59: Add accessibility attributes to the toggle button.

The toggle button is missing essential accessibility attributes for screen readers. Consider adding role="switch", aria-checked, and aria-label to make this control accessible.

♿ Proposed accessibility improvements
               <button
                 onClick={() => toggleMute()}
+                role="switch"
+                aria-checked={!isMuted}
+                aria-label="알림 설정"
                 className={`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${
                   isMuted ? 'bg-gray-300' : 'bg-primary'
                 }`}
               >
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/layout/Header/components/ChatHeader.tsx` around lines 48 - 59,
The toggle button lacks ARIA attributes; update the button element (the one
invoking toggleMute and reading isMuted) to include role="switch", set
aria-checked to the boolean isMuted (or its inverse if the semantics differ),
and add a descriptive aria-label (e.g., "Mute notifications" or "Unmute
notifications" based on isMuted) so screen readers convey state and purpose;
ensure these attributes are kept in sync with the isMuted prop/state used by the
toggleMute handler.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/components/layout/Header/components/ChatHeader.tsx`:
- Around line 48-59: The toggle button lacks ARIA attributes; update the button
element (the one invoking toggleMute and reading isMuted) to include
role="switch", set aria-checked to the boolean isMuted (or its inverse if the
semantics differ), and add a descriptive aria-label (e.g., "Mute notifications"
or "Unmute notifications" based on isMuted) so screen readers convey state and
purpose; ensure these attributes are kept in sync with the isMuted prop/state
used by the toggleMute handler.

In `@src/pages/Chat/hooks/useChat.ts`:
- Around line 106-110: The mutation currently only uses onSuccess to call
queryClient.invalidateQueries in useChat (the block with onSuccess ->
queryClient.invalidateQueries({ queryKey: chatQueryKeys.rooms() })); add an
onError callback to surface failures (e.g., show toast/log and revert UI if
needed) and optionally implement an optimistic update using onMutate to update
the cached rooms/room list immediately, returning a context to rollback on
onError and finalizing with onSettled or onSuccess to re-sync via
queryClient.invalidateQueries; update the mutation definition in useChat.ts to
include onMutate, onError, and onSettled handlers referencing
chatQueryKeys.rooms and the same queryClient instance.

@hyejun0228 hyejun0228 merged commit e8629b4 into develop Feb 17, 2026
2 checks passed
@ff1451 ff1451 mentioned this pull request Feb 20, 2026
ff1451 added a commit that referenced this pull request Feb 20, 2026
* feat: 알림설정 구현 (#108)

* chore: min-w 추가

* [chore] 코드래빗 설정 파일 추가 (#110)

* chore: 코드래빗 설정 파일 추가

* chore: 불필요한 tools 설정 제거

* [feat] preMember 목록 분리 및 삭제 기능 추가 (#115)

* feat: preMember 목록 분리 및 삭제 기능 추가

* chore: Pascal case

* chore: 변경된 변수명 반영

* feat: 학번 숫자 필터링 추가

* [feat] 채팅 목차 알림 상태 추가 (#113)

* chore: svg 추가

* feat: 채팅목록 알림 끄기 설정시 UI 추가

* feat: 목차 열릴시 애니메이션 추가

* [feat] 달력 카테고리 분류 추가 (#118)

* feat: 카테고리 추가

* chore: 불필요한 코드 삭제

* [refactor] 관리자 페이지 및 마이페이지 UI 수정 및 리팩토링 (#117)

* feat: 정보 카드에서 정보 페이지로 이동하도록 기능 추가

* feat: 토스트 전역상태 추가

* refactor: query 훅 분리 및 onSuccess 콜백 옵션 제거

* refactor: query 훅 사용처 수정

* refactor: 사용처 수정 2

* fix: 채팅창 스크롤 초기화 문제 수정 및 줄바꿈 기준 변경

* feat: 토글 스위치 구현

* refactor: 모집 공고 관련 목록 페이지 디자인 수정

* feat: 컴포넌트 구현 및 icon 추가

* refactor: z-index 값 수정

* refactor: API 필드 변경 사항 반영

* refactor: 모집 공고 페이지 디자인 수정 및 라우트 백 수정

* refactor: 학교 목록에 없을 시 문구 디자인 수정

* fix: lint error

* fix: 타입 변경

* feat: 모집 관련 페이지 API 추가사항 반영

* refactor: 토스트 타이머 클린업 추라

* refactor: 전역토스트 사용 변경

* refactor: 관리자 클럽 조회 훅 호출 범위 줄이기

* feat: onError handler add

* chore: add button type and remove fragment

* [feat] 문의하기 버튼 로직 추가 (#120)

* feat: API 추가 및 연결

* chore: placeholder 제거

* [fix] 채팅 스크롤 미갱신 버그 및 멤버 직위 렌더링 수정 (#122)

* fix: 채팅 스크롤 미작동 수정

* fix: 한글 출력으로 수정

* feat: 첫 글자 보여주도록 수정 (#124)

* hotfix: 동아리 소개 줄바꿈 적용 및 한 줄 소개 글자수 제한 상향

* chore: 리뷰 반영

* fix: disabled 조건 변경

* 126 fix 배포 전 qa 사항 반영 (#127)

* fix: 가입 버튼 문구 수정

* fix: 검색창 placeholder 수정

* fix: 불필요해진 UI 비활성화

* fix: 모집공고 없을 때 빈 화면 처리

* fix: 무의미한 회비페이지 수정

* feat: 토글 시 자동 페이지 이동 추가

* fix: 페이지 이동 조건 수정

---------

Co-authored-by: 김혜준 <114041848+hyejun0228@users.noreply.github.com>
Co-authored-by: hyejun <hyejunkkim228@gmail.com>
ff1451 added a commit that referenced this pull request Mar 6, 2026
* develop → main 배포 (#125)

* feat: 알림설정 구현 (#108)

* chore: min-w 추가

* [chore] 코드래빗 설정 파일 추가 (#110)

* chore: 코드래빗 설정 파일 추가

* chore: 불필요한 tools 설정 제거

* [feat] preMember 목록 분리 및 삭제 기능 추가 (#115)

* feat: preMember 목록 분리 및 삭제 기능 추가

* chore: Pascal case

* chore: 변경된 변수명 반영

* feat: 학번 숫자 필터링 추가

* [feat] 채팅 목차 알림 상태 추가 (#113)

* chore: svg 추가

* feat: 채팅목록 알림 끄기 설정시 UI 추가

* feat: 목차 열릴시 애니메이션 추가

* [feat] 달력 카테고리 분류 추가 (#118)

* feat: 카테고리 추가

* chore: 불필요한 코드 삭제

* [refactor] 관리자 페이지 및 마이페이지 UI 수정 및 리팩토링 (#117)

* feat: 정보 카드에서 정보 페이지로 이동하도록 기능 추가

* feat: 토스트 전역상태 추가

* refactor: query 훅 분리 및 onSuccess 콜백 옵션 제거

* refactor: query 훅 사용처 수정

* refactor: 사용처 수정 2

* fix: 채팅창 스크롤 초기화 문제 수정 및 줄바꿈 기준 변경

* feat: 토글 스위치 구현

* refactor: 모집 공고 관련 목록 페이지 디자인 수정

* feat: 컴포넌트 구현 및 icon 추가

* refactor: z-index 값 수정

* refactor: API 필드 변경 사항 반영

* refactor: 모집 공고 페이지 디자인 수정 및 라우트 백 수정

* refactor: 학교 목록에 없을 시 문구 디자인 수정

* fix: lint error

* fix: 타입 변경

* feat: 모집 관련 페이지 API 추가사항 반영

* refactor: 토스트 타이머 클린업 추라

* refactor: 전역토스트 사용 변경

* refactor: 관리자 클럽 조회 훅 호출 범위 줄이기

* feat: onError handler add

* chore: add button type and remove fragment

* [feat] 문의하기 버튼 로직 추가 (#120)

* feat: API 추가 및 연결

* chore: placeholder 제거

* [fix] 채팅 스크롤 미갱신 버그 및 멤버 직위 렌더링 수정 (#122)

* fix: 채팅 스크롤 미작동 수정

* fix: 한글 출력으로 수정

* feat: 첫 글자 보여주도록 수정 (#124)

* hotfix: 동아리 소개 줄바꿈 적용 및 한 줄 소개 글자수 제한 상향

* chore: 리뷰 반영

* fix: disabled 조건 변경

* 126 fix 배포 전 qa 사항 반영 (#127)

* fix: 가입 버튼 문구 수정

* fix: 검색창 placeholder 수정

* fix: 불필요해진 UI 비활성화

* fix: 모집공고 없을 때 빈 화면 처리

* fix: 무의미한 회비페이지 수정

* feat: 토글 시 자동 페이지 이동 추가

* fix: 페이지 이동 조건 수정

---------

Co-authored-by: 김혜준 <114041848+hyejun0228@users.noreply.github.com>
Co-authored-by: hyejun <hyejunkkim228@gmail.com>

* develop -> main 배포 (#132)

* chore: 타입 변경 반영

* [feat] 모집 공고에 시간 추가 및 지원서 정렬 추가 (#131)

* feat: 모집 공고에 시작, 종료 시간 추가

* feat: 지원자 목록 정렬 추가 및 시간 표시

* feat: 채팅, 모집 공고 링크 파싱 기능 추가

* feat: 인스타그램 파싱 추가

* fix: prettier error

* refactor: 유틸 분리 및 타입 변경

* chore: 타입 변경 반영

* chore: 동일 스타일 통합 및 entity 확장 사용

* chore:ios 토큰 테스트를 위한 로직 추가

* Revert "chore:ios 토큰 테스트를 위한 로직 추가"

This reverts commit 98570fc.

* hotfix: 모집 공고 textarea 길이 자동 재계산 추가

* feat: 페이지네이션 추가

* feat: 수정

* feat: 페이지네이션 수정

* feat: 디자인 수정

* feat: 로직 수정

* fix: key 수정

* develop-> main (#135)

* chore: 타입 변경 반영

* [feat] 모집 공고에 시간 추가 및 지원서 정렬 추가 (#131)

* feat: 모집 공고에 시작, 종료 시간 추가

* feat: 지원자 목록 정렬 추가 및 시간 표시

* feat: 채팅, 모집 공고 링크 파싱 기능 추가

* feat: 인스타그램 파싱 추가

* fix: prettier error

* refactor: 유틸 분리 및 타입 변경

* chore: 타입 변경 반영

* chore: 동일 스타일 통합 및 entity 확장 사용

* chore:ios 토큰 테스트를 위한 로직 추가

* Revert "chore:ios 토큰 테스트를 위한 로직 추가"

This reverts commit 98570fc.

* hotfix: 모집 공고 textarea 길이 자동 재계산 추가

* Reapply "chore:ios 토큰 테스트를 위한 로직 추가"

This reverts commit 3a56f4a.

* chore: ios토큰

* feat: 가이드 페이지 이미지 변경

* chore: 푸시알림 로직 임시 변경

* refactor: 푸시 알림 토큰 로직 브릿지 방식으로 수정 (#134)

* refactor: 푸시 알림 토큰 로직 브릿지 방식으로 수정

* fix: try catch 적용

* feat: 페이지네이션 추가

* feat: 수정

* feat: 페이지네이션 수정

* feat: 디자인 수정

* feat: 로직 수정

* fix: key 수정

* chore: 스테이지 용 임시 UI 제거

---------

Co-authored-by: hyejun <hyejunkkim228@gmail.com>

* [feat] sentry 모니터링 추가 (#141) (#142)

* chore: sentry 의존성 추가

* feat: sentry 세팅

* chore: 워크플로우 수정 및 vite 세팅

* chore: 임시 추가

* refactor: 색상 토큰 파일 분리

* refactor: 타이포그래피 스타일 파일 분리

* refactor: 피그마 타이포그래피 네이밍으로 클래스 정렬

* fix: 리뷰 코멘트 기반 접근성 및 토큰 정리

---------

Co-authored-by: 김혜준 <114041848+hyejun0228@users.noreply.github.com>
Co-authored-by: hyejun <hyejunkkim228@gmail.com>
@ff1451 ff1451 deleted the 107-feat-알림-설정-페이지-구현 branch April 7, 2026 09:33
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