Skip to content

Fix(client): 리마인드 시간 24시간 내에서만 카드 뜨도록 수정#171

Merged
constantly-dev merged 5 commits intodevelopfrom
fix/#169/remind-time-logic-fix
Oct 1, 2025
Merged

Fix(client): 리마인드 시간 24시간 내에서만 카드 뜨도록 수정#171
constantly-dev merged 5 commits intodevelopfrom
fix/#169/remind-time-logic-fix

Conversation

@constantly-dev
Copy link
Member

@constantly-dev constantly-dev commented Oct 1, 2025

📌 Related Issues

관련된 Issue를 태그해주세요. (e.g. - close #25)

📄 Tasks

리마인드 시간 24시간 내에서만 remind card ui가 뜨도록 로직 수정했습니다.

⭐ PR Point (To Reviewer)

const articlesToDisplay =
  data?.pages
    .flatMap((page) => page.articles)
    .filter((article) => {
      const now = new Date().getTime();
      const remindTime = new Date(article.remindAt).getTime();
      const displayTimeLimit = 24 * 60 * 60 * 1000;

      return remindTime > now && remindTime <= now + displayTimeLimit;
    }) ?? [];

기존에 card 내부에 있던 로직을 map 메서드 사용하는 remind 페이지로 올렸습니다.

📷 Screenshot

Summary by CodeRabbit

  • 버그 수정
    • 리마인드 목록이 이제 향후 24시간 이내 일정만 표시하여 지난 항목과 장기 일정은 제외됩니다.
    • 카드의 남은 시간 계산에서 불필요한 +24시간 보정을 제거해 실제 남은 시간을 기준으로 카운트다운됩니다.
  • New Features
    • 배지에 왼쪽 아이콘 지원이 추가되어 상태별 아이콘(예: 시계 활성/비활성)이 표시됩니다.
    • 배지의 숫자는 0일 경우 숨겨지도록 변경되었습니다.

@vercel
Copy link

vercel bot commented Oct 1, 2025

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

Project Deployment Preview Comments Updated (UTC)
pinback-client-client Ready Ready Preview Comment Oct 1, 2025 5:21pm
pinback-client-landing Ready Ready Preview Comment Oct 1, 2025 5:21pm

@coderabbitai
Copy link

coderabbitai bot commented Oct 1, 2025

Walkthrough

리마인드 목록을 다음 24시간 내 remindAt만 표시하도록 필터링하고, RemindCard의 남은 시간 계산에서 기존 +24시간 오프셋을 제거했으며, Badge에 왼쪽 아이콘(leftIcon) 옵션과 countNum 조건부 렌더링을 추가했습니다. 공개 API 시그니처 변경은 없습니다.

Changes

Cohort / File(s) Summary
Client — Remind 페이지 필터링
apps/client/src/pages/remind/Remind.tsx
전체 articles 집계 대신 remindAt이 현재 시각보다 이후이고, 현재 시각부터 24시간 이내인 항목만 articlesToDisplay로 필터링. 일부 이전 집계 라인 주석 처리 및 Badge 사용부에 leftIcon 적용.
Design-system — RemindCard 시간 계산
packages/design-system/src/components/card/RemindCard.tsx
endTime 계산에서 이전에 더하던 +24h 오프셋 제거하여 timeRemaining만 사용하도록 변경. 기존 타이머/업데이트 로직 유지; 이전 계산 주석 처리.
Design-system — Badge API/렌더링
packages/design-system/src/components/badge/Badge.tsx
BadgePropsleftIcon?: React.ReactNode 추가 및 컴포넌트 시그니처에 leftIcon 수용. 텍스트 앞에 leftIcon 삽입, countNum는 truthy일 때만 렌더링하도록 변경. Icon 임포트 추가(스니펫에 존재).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor U as 사용자
  participant P as Remind 페이지
  participant S as 서버/데이터
  participant C as RemindCard
  participant B as Badge

  U->>P: 리마인드 페이지 진입
  P->>S: 기사 목록 요청
  S-->>P: articles 반환
  P->>P: remindAt ∈ (now, now+24h]로 필터링
  P->>B: 각 배지 렌더 (leftIcon 포함)
  P->>C: 필터된 카드 렌더
  rect rgba(220,245,230,0.25)
    note over C: RemindCard는 timeRemaining만 사용해 남은 시간 계산
    loop 매 초
      C->>C: 남은 시간 갱신 (0이면 종료)
    end
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

재림, frontend

Suggested reviewers

  • jllee000
  • jjangminii

Poem

꼬리 흔들며 알림을 살펴봤지 🥕
하루 안의 약속들만 살포시 불러왔지
시계의 덧셈은 이제 빼버렸네, 찰나를 보여줘
배지는 아이콘 하나로 눈길을 끌고
토끼가 말하네 — 딱 하루만, 기억하렴!

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Linked Issues Check ⚠️ Warning 링크된 이슈 #169의 “리마인드 시간 24시간 내에서만 카드 노출” 요구사항은 제대로 구현되었지만 #25의 Progress 컴포넌트 구현 요구사항은 전혀 반영되지 않아 연결된 모든 이슈의 목표를 충족하지 못합니다. 현재 PR에 Progress 컴포넌트 관련 코드가 포함되지 않았습니다. 두 이슈의 요구사항을 모두 만족시키려면 관련 기능을 추가로 구현하거나 이슈 연결을 조정해야 합니다. #25 이슈의 Progress 컴포넌트를 구현하거나 해당 이슈 링크를 제거하여 본 PR의 범위에 맞도록 조정해 주세요.
Out of Scope Changes Check ⚠️ Warning Badge 컴포넌트에 leftIcon prop 추가 및 countNum 조건부 렌더링 등은 리마인드 시간 필터링 기능과 직접 관련이 없어 PR 목표 범위를 벗어나는 변경사항입니다. 이로 인해 기능 구현의 집중도가 떨어지고 디자인 시스템 API가 불필요하게 확장되었습니다. 리마인드 로직과 무관한 변경은 별도 PR로 분리하는 것이 좋습니다. 리마인드 시간 필터링과 무관한 Badge 컴포넌트 변경은 별도 PR로 분리하거나 제거하여 PR 범위를 명확히 재조정해 주세요. 이렇게 하면 코드 리뷰와 기능 검증의 효율이 높아집니다.
✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed 제목이 리마인드 카드 노출 로직의 핵심 변경사항인 “24시간 내에서만 카드 뜨도록 수정”을 명확히 요약하고 있어 변경 내용과 완전히 일치합니다. 불필요한 파일 목록이나 이모지 없이 간결하고 구체적인 표현을 사용해 한눈에 이해할 수 있습니다. 이로써 커밋 기록과 히스토리 조회 시 가독성이 높아집니다.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Description Check ✅ Passed PR 설명은 템플릿의 주요 섹션인 관련 이슈(📌 Related Issues), 수행 작업 요약(📄 Tasks), PR Point(⭐ PR Point)를 모두 충실히 포함하고 있어 전반적인 정보 전달이 양호합니다. 스크린샷(📷 Screenshot) 섹션만 별도 내용 없이 남아 있으나 이는 선택적 항목이므로 심각한 누락으로 보기 어렵습니다.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/#169/remind-time-logic-fix

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 and usage tips.

@github-actions
Copy link

github-actions bot commented Oct 1, 2025

✅ Storybook chromatic 배포 확인:
🐿️ storybook

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: 0

🧹 Nitpick comments (2)
packages/design-system/src/components/card/RemindCard.tsx (1)

30-32: 로직 변경이 올바르게 구현되었습니다.

24시간 오프셋 제거로 실제 리마인드 시간까지의 남은 시간을 정확히 표시하게 되었습니다. 다만, 주석 처리된 기존 코드(line 31)는 제거하는 것이 코드 정리에 도움이 됩니다.

다음 diff를 적용하여 주석 처리된 코드를 제거하세요:

-    // const endTime = new Date(timeRemaining).getTime() + 24 * 60 * 60 * 1000;
     const endTime = new Date(timeRemaining).getTime();
apps/client/src/pages/remind/Remind.tsx (1)

58-69: 24시간 필터링 로직이 정확하게 구현되었습니다.

리마인드 시간이 현재 시점 이후이면서 24시간 이내인 아티클만 노출하도록 필터링하는 로직이 요구사항을 올바르게 충족합니다. 다만, 주석 처리된 기존 코드(line 58)는 제거하는 것이 좋습니다.

다음 diff를 적용하여 주석 처리된 코드를 제거하세요:

-  // const articlesToDisplay = data?.pages.flatMap((page) => page.articles) ?? [];
-
   const articlesToDisplay =
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1f001d0 and 6f844b8.

📒 Files selected for processing (2)
  • apps/client/src/pages/remind/Remind.tsx (1 hunks)
  • packages/design-system/src/components/card/RemindCard.tsx (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: storybook
🔇 Additional comments (1)
apps/client/src/pages/remind/Remind.tsx (1)

111-129: 배지 카운트 일관성 확인 필요

Badge 컴포넌트(packages/design-system/src/components/badge/Badge.tsx 라인 36–50)에서 전달받은 countNum을 그대로 렌더링하고 있어, 24시간 필터링된 카드 개수와 배지 숫자가 다를 수 있습니다. 이 동작이 의도된 것인지 확인하고, 배지 카운트에도 동일한 필터를 적용해야 한다면 API 응답 또는 클라이언트 측에서 필터링된 카운트를 사용하도록 로직을 조정해주세요.

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: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6f844b8 and 8847018.

📒 Files selected for processing (2)
  • apps/client/src/pages/remind/Remind.tsx (3 hunks)
  • packages/design-system/src/components/badge/Badge.tsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/client/src/pages/remind/Remind.tsx
🧰 Additional context used
🪛 GitHub Actions: ci
packages/design-system/src/components/badge/Badge.tsx

[error] 1-1: TS6133: 'Icon' is declared but its value is never read. (during build) Command: 'tsc -b && vite build'.

🪛 GitHub Check: lint
packages/design-system/src/components/badge/Badge.tsx

[warning] 1-1:
'Icon' is defined but never used

🔇 Additional comments (3)
packages/design-system/src/components/badge/Badge.tsx (3)

7-7: LGTM!

leftIcon prop이 optional로 올바르게 추가되었고, React.ReactNode 타입은 다양한 아이콘 컴포넌트를 수용하기에 적합합니다. 기존 API와의 하위 호환성도 유지됩니다.


38-38: LGTM!

leftIcon prop이 컴포넌트에 올바르게 추가되었고, 텍스트 앞에 렌더링되어 의미론적으로도 적절합니다. React가 falsy 값을 자동으로 처리하므로 조건부 렌더링 없이도 안전합니다.

Also applies to: 44-44


48-52: LGTM!

countNum에 대한 조건부 렌더링 추가는 좋은 개선입니다. 카운트가 0이거나 없을 때 불필요한 배지를 표시하지 않아 UI가 더 깔끔해집니다.

Copy link
Collaborator

@jllee000 jllee000 left a comment

Choose a reason for hiding this comment

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

굿! 고생하셨슴미다

Comment on lines 120 to 128
text="안 읽음"
countNum={unreadArticleCount}
// countNum={unreadArticleCount}
onClick={() => handleBadgeClick('notRead')}
isActive={activeBadge === 'notRead'}
/>
<Badge
text="읽음"
countNum={readArticleCount}
// countNum={readArticleCount}
onClick={() => handleBadgeClick('read')}
Copy link
Collaborator

Choose a reason for hiding this comment

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

서버 수정반영 후 까먹지말 TODO

@constantly-dev constantly-dev merged commit 1462660 into develop Oct 1, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix 버그 수정하라 러브버그

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Fix] 리마인드 시간 24시간 내에서만 카드 뜨도록 수정

3 participants