Skip to content

Comments

알림 UI 수정#375

Merged
HA-SEUNG-JEONG merged 5 commits intodevelopfrom
fix/notification
Feb 4, 2026
Merged

알림 UI 수정#375
HA-SEUNG-JEONG merged 5 commits intodevelopfrom
fix/notification

Conversation

@HA-SEUNG-JEONG
Copy link
Contributor

@HA-SEUNG-JEONG HA-SEUNG-JEONG commented Feb 4, 2026

🌱 연관된 이슈

☘️ 작업 내용

  • 헤더 내 알림 리스트 클릭 가능하도록 수정
  • 헤더 내 알림 아이콘 UI 수정

🍀 참고사항

스크린샷 (선택)

2026-02-04.17.34.36.mov

Summary by CodeRabbit

새 기능

  • 개별 알림을 클릭하여 읽음으로 표시할 수 있습니다.

개선사항

  • 알림 목록의 인터랙션 개선으로 사용자 경험 향상
  • 버튼 스타일 업데이트
  • 알림 배지 표시 개선

@HA-SEUNG-JEONG HA-SEUNG-JEONG self-assigned this Feb 4, 2026
@vercel
Copy link

vercel bot commented Feb 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
study-platform-client-dev Ready Ready Preview, Comment Feb 4, 2026 8:35am

@coderabbitai
Copy link

coderabbitai bot commented Feb 4, 2026

📝 Walkthrough

개요

세 개의 컴포넌트에 걸쳐 개별 알림 클릭 처리 기능을 추가했습니다. useHasNewNotification 훅을 useReadNotifications으로 교체하고, 각 알림을 클릭할 때 읽음 상태로 표시하는 onNotificationClick 핸들러를 구현했습니다.

변경 사항

Cohort / File(s) 요약
알림 페이지 및 드롭다운
src/app/(service)/(my)/notification/page.tsx, src/components/modals/notification-dropdown.tsx
useHasNewNotification을 useReadNotifications로 교체하고 handleNotificationClick 핸들러를 추가하여 클릭한 알림을 읽음으로 표시. 배지 렌더링 로직 업데이트 및 스타일 조정.
알림 리스트 컴포넌트
src/components/lists/notification-list.tsx
onNotificationClick 콜백 prop 추가 및 리스트 아이템에 커서 포인터, 호버 배경, 클릭 이벤트 바인딩 추가.

시퀀스 다이어그램

sequenceDiagram
    actor User
    participant NotificationDropdown
    participant NotificationList
    participant API as Read API
    
    User->>NotificationDropdown: 알림 드롭다운 열기
    NotificationDropdown->>NotificationList: onNotificationClick 핸들러 전달
    
    User->>NotificationList: 읽지 않은 알림 클릭
    NotificationList->>NotificationDropdown: onNotificationClick(notification) 호출
    
    NotificationDropdown->>NotificationDropdown: handleNotificationClick 실행
    alt notification.isRead === false
        NotificationDropdown->>API: readNotifications([notification.id])
        API-->>NotificationDropdown: 읽음 상태 업데이트
        NotificationDropdown->>NotificationList: 상태 변경 반영
    end
Loading

예상 코드 검토 난이도

🎯 3 (중간) | ⏱️ ~20분

시 🐰

알림이 쌓여있으니

클릭으로 읽음 표시하고

뱃지는 사라지네요 ✨

깔끔한 마음으로 🎉

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
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.
Title check ❓ Inconclusive PR 제목 'Fix/notification'은 변경사항의 주요 내용과 부분적으로만 관련되어 있으며, 구체적인 세부사항이 부족합니다. '알림 클릭 기능 추가 및 UI 개선' 또는 '알림 리스트 클릭 가능하도록 개선' 같은 더 구체적인 제목으로 변경하는 것을 권장합니다.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ 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/notification

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

@HA-SEUNG-JEONG HA-SEUNG-JEONG changed the title Fix/notification 알림 UI 수정 Feb 4, 2026
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.

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In `@src/app/`(service)/(my)/notification/page.tsx:
- Around line 65-71: The handler handleNotificationClick currently passes
notification.id to readNotifications but MemberNotificationResponse defines id
as optional, so guard against undefined: check that notification.id is a valid
number before calling readNotifications (or build an array by filtering out
falsy/undefined ids) and only call readNotifications when you have one or more
concrete ids; update handleNotificationClick to validate notification.id (or use
a safe array like [notification.id].filter(Boolean)) so readNotifications never
receives undefined.

In `@src/components/lists/notification-list.tsx`:
- Around line 56-60: The code calls date-fns format with notification.createdAt
which is optional (MemberNotificationResponse.createdAt) and can be undefined,
causing a runtime error; update the render in the component that uses format
(the span showing format(notification.createdAt, 'yyyy.MM.dd HH:mm')) to first
check that notification.createdAt is present and a valid Date (or can be safely
parsed) and only call format when valid, otherwise render a safe fallback (e.g.,
empty string or a placeholder like '-') to prevent passing undefined into
format.

In `@src/components/modals/notification-dropdown.tsx`:
- Around line 37-43: handleNotificationClick calls readNotifications with
notification.id but MemberNotificationResponse.id is optional and may be
undefined; update handleNotificationClick to guard that id is defined before
calling readNotifications (e.g., check notification.id !== undefined or use a
local const id = notification.id and if (!notification.isRead && id)
readNotifications([id])), ensuring you reference the existing
handleNotificationClick function, the readNotifications call, and
MemberNotificationResponse.id so only defined IDs are passed.
🧹 Nitpick comments (2)
src/app/(service)/(my)/notification/page.tsx (1)

65-71: handleNotificationClick 로직이 notification-dropdown.tsx와 중복됩니다.

동일한 함수 구현이 src/components/modals/notification-dropdown.tsx (lines 37-43)에도 존재합니다. 이 로직을 커스텀 훅이나 유틸리티 함수로 추출하여 재사용성을 높이는 것을 고려해 주세요.

src/components/lists/notification-list.tsx (1)

50-54: 동적 클래스 구성에 clsx 또는 tailwind-merge 사용을 권장합니다.

코딩 가이드라인에 따르면 동적 Tailwind 클래스 관리에 clsx, tailwind-merge, 또는 class-variance-authority (CVA)를 사용해야 합니다. 현재 템플릿 리터럴을 사용하고 있습니다.

♻️ 제안된 수정
+import { clsx } from 'clsx';
...
  <span
-   className={`${notification.isRead ? 'font-designer-13r' : 'font-designer-13b'} text-text-default`}
+   className={clsx(
+     notification.isRead ? 'font-designer-13r' : 'font-designer-13b',
+     'text-text-default'
+   )}
  >

As per coding guidelines, **/*.{tsx,jsx}: Use class composition utilities clsx, tailwind-merge, and class-variance-authority (CVA) for dynamic Tailwind class management.

Comment on lines +56 to +60
<div className="flex items-center gap-100">
<span className="font-designer-11r text-text-subtlest whitespace-nowrap">
{format(notification.createdAt, 'yyyy.MM.dd HH:mm')}
</span>
</div>
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

notification.createdAtundefined일 경우 런타임 에러가 발생할 수 있습니다.

MemberNotificationResponse.createdAt은 optional 필드입니다. date-fnsformat 함수에 undefined가 전달되면 런타임 에러가 발생합니다.

🛡️ 제안된 수정
  <div className="flex items-center gap-100">
    <span className="font-designer-11r text-text-subtlest whitespace-nowrap">
-     {format(notification.createdAt, 'yyyy.MM.dd HH:mm')}
+     {notification.createdAt
+       ? format(notification.createdAt, 'yyyy.MM.dd HH:mm')
+       : '-'}
    </span>
  </div>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<div className="flex items-center gap-100">
<span className="font-designer-11r text-text-subtlest whitespace-nowrap">
{format(notification.createdAt, 'yyyy.MM.dd HH:mm')}
</span>
</div>
<div className="flex items-center gap-100">
<span className="font-designer-11r text-text-subtlest whitespace-nowrap">
{notification.createdAt
? format(notification.createdAt, 'yyyy.MM.dd HH:mm')
: '-'}
</span>
</div>
🤖 Prompt for AI Agents
In `@src/components/lists/notification-list.tsx` around lines 56 - 60, The code
calls date-fns format with notification.createdAt which is optional
(MemberNotificationResponse.createdAt) and can be undefined, causing a runtime
error; update the render in the component that uses format (the span showing
format(notification.createdAt, 'yyyy.MM.dd HH:mm')) to first check that
notification.createdAt is present and a valid Date (or can be safely parsed) and
only call format when valid, otherwise render a safe fallback (e.g., empty
string or a placeholder like '-') to prevent passing undefined into format.

@HA-SEUNG-JEONG HA-SEUNG-JEONG merged commit 90d61bf into develop Feb 4, 2026
11 checks passed
@HA-SEUNG-JEONG HA-SEUNG-JEONG deleted the fix/notification branch February 4, 2026 08:41
@HA-SEUNG-JEONG HA-SEUNG-JEONG restored the fix/notification branch February 7, 2026 09:18
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