Skip to content

Conversation

@junghyeonsu
Copy link
Contributor

@junghyeonsu junghyeonsu commented Dec 16, 2025

Summary by CodeRabbit

  • 새로운 기능
    • 문서 페이지에 시각적 배지 추가: 최근 업데이트된 페이지에 "업데이트됨" 배지 표시
  • 개선
    • 14일 기준의 최근 수정 판정 로직 적용
    • 비활성(Deprecated) 배지는 컴포넌트 페이지에만 표시하도록 판정 흐름 개선
    • 페이지 존재성 검사 및 메타데이터 로딩을 안전하게 처리해 오류 방지
  • 기타
    • 배지 표시 위치를 페이지명 뒤로 일관되게 표기

✏️ Tip: You can customize this high-level summary in your review settings.

…mponents; add functionality to retrieve git last modified dates for content files
@junghyeonsu junghyeonsu self-assigned this Dec 16, 2025
@changeset-bot
Copy link

changeset-bot bot commented Dec 16, 2025

⚠️ No Changeset found

Latest commit: ad0d3d4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link

coderabbitai bot commented Dec 16, 2025

Walkthrough

페이지 렌더링에 UpdatedBadge와 RECENTLY_UPDATED_DAYS(14일) 기반 최근 업데이트 판정이 추가되고, Deprecated 판정이 컴포넌트 페이지로 제한되며 배지 결정 흐름과 null 안전성이 개선되었습니다. NotificationBadge가 새로 도입됩니다.

Changes

Cohort / File(s) 변경 요약
페이지 배지 및 메타 로직
docs/app/source.tsx
UpdatedBadge 컴포넌트 추가(NotificationBadge 사용), RECENTLY_UPDATED_DAYS = 14isRecentlyUpdated(lastModified) 도입으로 날짜 기반 최근성 판단 추가. Deprecated 판정 로직을 컴포넌트 페이지로 한정하도록 리팩터링하고, 배지 렌더링 흐름을 재구성(Deprecated 우선, 비Deprecated이면 최근 업데이트 시 Updated 표시). 페이지 존재 검사 및 메타데이터 접근에 대한 널 안전성 강화. getComponentIdFromUrl는 유지하되 컴포넌트 ID 유효 시에만 사용하도록 변경. 임포트 정리 및 NotificationBadge 신규 임포트 추가.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • 검토 포인트:
    • 최근성 판정(isRecentlyUpdated)의 시간대/포맷 경계 처리
    • Deprecated 판정이 컴포넌트 페이지에만 적용되도록 한 조건의 정확성
    • 페이지 널 검사 및 메타데이터 접근 보호 로직의 일관성
    • NotificationBadge 사용 방식과 스타일/접근성 영향

Poem

🐇 깃 자국을 따라 발자국 세고,
열넷 밤 사이 반짝임을 찾았네.
오래된 표시는 숨고 새 배지는 춤춰,
문서 길 위에 작은 기쁨을 남기네. ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Pull request title accurately summarizes the main change: implementing badge components for deprecated and recently updated pages.
✨ 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 docs/updated-badge

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.

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

🧹 Nitpick comments (3)
docs/app/source.tsx (3)

68-73: 불필요한 new Date() 생성자 호출

lastModified는 이미 Date 타입(Map<string, Date>)이므로 Line 72의 new Date(lastModified)는 불필요합니다.

 function isRecentlyUpdated(lastModified: Date | undefined): boolean {
   if (!lastModified) return false;
   const fourteenDaysAgo = new Date();
   fourteenDaysAgo.setDate(fourteenDaysAgo.getDate() - RECENTLY_UPDATED_DAYS);
-  return new Date(lastModified) > fourteenDaysAgo;
+  return lastModified > fourteenDaysAgo;
 }

101-105: getGitLastModifiedDates() 호출 위치 최적화 제안

getGitLastModifiedDates()transformNode 내부에서 매 페이지마다 호출됩니다. 함수 내부에 캐시가 있어 실제 git 명령어는 한 번만 실행되지만, 캐시 확인 오버헤드를 줄이려면 transformPageTreeWithBadges 함수 시작 시점에 한 번만 호출하는 것이 더 명확합니다.

 async function transformPageTreeWithBadges(
   tree: Root,
   sourceLoader: typeof baseSource,
   contentDir: string,
 ): Promise<Root> {
   try {
+    const gitDates = getGitLastModifiedDates();
+
     async function transformNode(node: Node): Promise<Node> {
       if (node.type === "page") {
         // ...
-        const gitDates = getGitLastModifiedDates();
         const filePath = `docs/content/${contentDir}/${page.path}`;

120-130: 배지 렌더링 구조 불일치

DeprecatedBadge 렌더링(Line 113)에서는 node.name<span>으로 감싸지만, UpdatedBadge 렌더링(Line 125)에서는 감싸지 않습니다. 일관성을 위해 동일한 구조를 사용하는 것이 좋습니다.

         if (isUpdated) {
           return {
             ...node,
             name: (
               <span className="flex items-center" key={node.$id}>
-                {node.name}
+                <span>{node.name}</span>
                 <UpdatedBadge />
               </span>
             ),
           };
         }
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between d844081 and 0c1027c.

📒 Files selected for processing (1)
  • docs/app/source.tsx (5 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/docs.mdc)

**/*.{ts,tsx}: Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError)
Structure files: exported component, subcomponents, helpers, static content, types
Favor named exports for components
Use TypeScript for all code; prefer interfaces over types
Avoid enums; use maps instead
Use the "function" keyword for pure functions
Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements

Files:

  • docs/app/source.tsx
**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/docs.mdc)

**/*.tsx: Use functional components with TypeScript interfaces
Use declarative JSX
Use Tailwind CSS for styling
Implement responsive design with Tailwind CSS; use a mobile-first approach
Minimize 'use client', 'useEffect', and 'setState'; favor React Server Components (RSC)
Wrap client components in Suspense with fallback
Optimize images: use WebP format, include size data, implement lazy loading
Use 'nuqs' for URL search parameter state management
Limit 'use client': favor server components and Next.js SSR; use only for Web API access in small components; avoid for data fetching or state management

Files:

  • docs/app/source.tsx
docs/**

📄 CodeRabbit inference engine (.cursor/rules/overview.mdc)

The docs/ directory contains online documentation built on Next.js and Fumadocs

Files:

  • docs/app/source.tsx
🧬 Code graph analysis (1)
docs/app/source.tsx (2)
packages/react/src/components/NotificationBadge/NotificationBadge.tsx (1)
  • NotificationBadge (24-26)
docs/components/rootage.ts (1)
  • getRootageMetadata (50-66)
⏰ 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). (3)
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Deploy seed-design-v3 Storybook Alpha
  • GitHub Check: Deploy Seed Design V3 Docs
🔇 Additional comments (3)
docs/app/source.tsx (3)

62-64: LGTM!

UpdatedBadge 컴포넌트가 간결하게 구현되었습니다. NotificationBadge를 적절히 활용하고 있습니다.


188-202: LGTM!

각 페이지 트리 변환 함수가 적절한 contentDir 값을 전달하고 있습니다. 이전 코멘트에서 언급한 경로 확인 후 정상 동작을 검증해 주세요.


43-45: 파일 경로 매핑 불일치 가능성

Line 43에서 docs/content/로 시작하는 경로를 캐시에 저장하지만, Line 103에서는 docs/content/${contentDir}/${page.path} 형태로 경로를 구성합니다.

contentDir"docs"인 경우 docs/content/docs/... 경로가 되는데, 실제 git log 출력의 경로와 일치하는지 확인이 필요합니다.

#!/bin/bash
# Description: Verify actual file paths in docs/content directory

# List directory structure under docs/content
fd -t d . docs/content --max-depth 2 2>/dev/null || fd -t d . content --max-depth 2

# Check git log output format for file paths
git log --oneline --name-only -3 -- "docs/content" 2>/dev/null | head -20

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Dec 16, 2025

Deploying seed-design-v3 with  Cloudflare Pages  Cloudflare Pages

Latest commit: ad0d3d4
Status: ✅  Deploy successful!
Preview URL: https://571a3145.seed-design.pages.dev
Branch Preview URL: https://docs-updated-badge.seed-design.pages.dev

View logs

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 (1)
docs/app/source.tsx (1)

68-73: 불필요한 new Date() 생성자 호출

lastModified는 이미 getGitLastModifiedDates()에서 Date 객체로 반환됩니다. Line 72의 new Date(lastModified)는 불필요한 객체 생성입니다.

 function isRecentlyUpdated(lastModified: Date | undefined): boolean {
   if (!lastModified) return false;
   const fourteenDaysAgo = new Date();
   fourteenDaysAgo.setDate(fourteenDaysAgo.getDate() - RECENTLY_UPDATED_DAYS);
-  return new Date(lastModified) > fourteenDaysAgo;
+  return lastModified > fourteenDaysAgo;
 }
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 0c1027c and 777cf0b.

📒 Files selected for processing (1)
  • docs/app/source.tsx (5 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/docs.mdc)

**/*.{ts,tsx}: Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError)
Structure files: exported component, subcomponents, helpers, static content, types
Favor named exports for components
Use TypeScript for all code; prefer interfaces over types
Avoid enums; use maps instead
Use the "function" keyword for pure functions
Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements

Files:

  • docs/app/source.tsx
**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/docs.mdc)

**/*.tsx: Use functional components with TypeScript interfaces
Use declarative JSX
Use Tailwind CSS for styling
Implement responsive design with Tailwind CSS; use a mobile-first approach
Minimize 'use client', 'useEffect', and 'setState'; favor React Server Components (RSC)
Wrap client components in Suspense with fallback
Optimize images: use WebP format, include size data, implement lazy loading
Use 'nuqs' for URL search parameter state management
Limit 'use client': favor server components and Next.js SSR; use only for Web API access in small components; avoid for data fetching or state management

Files:

  • docs/app/source.tsx
docs/**

📄 CodeRabbit inference engine (.cursor/rules/overview.mdc)

The docs/ directory contains online documentation built on Next.js and Fumadocs

Files:

  • docs/app/source.tsx
🧬 Code graph analysis (1)
docs/app/source.tsx (2)
packages/react/src/components/NotificationBadge/NotificationBadge.tsx (1)
  • NotificationBadge (24-26)
docs/components/rootage.ts (1)
  • getRootageMetadata (50-66)
⏰ 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). (3)
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Deploy Seed Design V3 Docs
  • GitHub Check: Deploy seed-design-v3 Storybook Alpha
🔇 Additional comments (4)
docs/app/source.tsx (4)

1-11: LGTM!

필요한 의존성들이 올바르게 import 되었습니다. execSync를 캐싱과 함께 사용하는 것은 빌드 타임 컨텍스트에서 적절합니다.


12-52: 캐시 무효화 전략 검토 필요

모듈 레벨 캐시(gitDatesCache)는 빌드 타임에는 적절하지만, 개발 모드에서 Hot Module Replacement(HMR) 시 캐시가 무효화되지 않아 새로운 git 변경사항이 반영되지 않을 수 있습니다.

개발 환경에서 문제가 되지 않는지 확인해 주세요.


188-202: LGTM!

각 소스에 대해 올바른 contentDir 값이 전달되고 있습니다. 비동기 함수를 통한 lazy loading 패턴도 적절합니다.


101-105: 파일 경로 구성 검증 필요

page.path의 형식에 따라 경로가 올바르게 구성되는지 확인이 필요합니다. 만약 page.path가 슬래시로 시작하거나 파일 확장자를 포함하지 않는다면 git 캐시에서 매칭이 실패할 수 있습니다.

다음 스크립트로 실제 파일 경로 형식을 확인해 주세요:

#!/bin/bash
# Description: Check the actual file structure in docs/content to verify path format

# List files in each content directory to understand the path structure
echo "=== docs/content/docs ===" 
fd -t f -e mdx -e md . docs/content/docs 2>/dev/null | head -10

echo "=== docs/content/react ==="
fd -t f -e mdx -e md . docs/content/react 2>/dev/null | head -10

# Check git log output format to verify file paths match
echo "=== Git log sample output ==="
git log --format="%H %aI" --name-only --diff-filter=ACMR -n 5 -- "docs/content" 2>/dev/null | head -20

… for last modified dates; remove git date caching functionality
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 (3)
docs/app/source.tsx (3)

24-29: 불필요한 Date 생성자 호출을 제거할 수 있습니다.

Line 28에서 new Date(lastModified)lastModified가 이미 Date 객체인 경우 불필요합니다. fumadocs의 lastModified가 Date 타입을 반환한다면 직접 비교할 수 있습니다.

 function isRecentlyUpdated(lastModified: Date | undefined): boolean {
   if (!lastModified) return false;
   const fourteenDaysAgo = new Date();
   fourteenDaysAgo.setDate(fourteenDaysAgo.getDate() - RECENTLY_UPDATED_DAYS);
-  return new Date(lastModified) > fourteenDaysAgo;
+  return lastModified > fourteenDaysAgo;
 }

18-20: Tailwind 클래스를 사용하여 인라인 스타일 제거

style={{ transform: "translateX(6px)" }}을 Tailwind 유틸리티 클래스로 대체하세요. 코딩 가이드라인에서 *.tsx 파일은 Tailwind CSS를 사용하도록 권장합니다. NotificationBadge 컴포넌트는 className prop을 지원합니다.

 const UpdatedBadge = () => {
-  return <NotificationBadge size="small" style={{ transform: "translateX(6px)" }} />;
+  return <NotificationBadge size="small" className="translate-x-1.5" />;
 };

56-84: 배지 렌더링 로직이 올바르게 구현되었습니다.

deprecated와 updated 상태를 명확히 분리하고, 하나의 배지만 표시되도록 한 로직이 정확합니다. React key로 node.$id를 사용한 것도 적절합니다.

Line 58의 page.data.load()는 모든 페이지 노드에 대해 호출되지만, 이는 빌드/렌더 시간에 실행되는 트리 변환 작업이며 Promise.all을 통해 병렬 처리되므로 실시간 성능에는 영향을 주지 않습니다. 문서 사이트 규모가 급격히 증가할 경우 빌드 시간 모니터링을 고려할 수 있습니다.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 777cf0b and ad0d3d4.

📒 Files selected for processing (1)
  • docs/app/source.tsx (4 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/docs.mdc)

**/*.{ts,tsx}: Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError)
Structure files: exported component, subcomponents, helpers, static content, types
Favor named exports for components
Use TypeScript for all code; prefer interfaces over types
Avoid enums; use maps instead
Use the "function" keyword for pure functions
Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements

Files:

  • docs/app/source.tsx
**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/docs.mdc)

**/*.tsx: Use functional components with TypeScript interfaces
Use declarative JSX
Use Tailwind CSS for styling
Implement responsive design with Tailwind CSS; use a mobile-first approach
Minimize 'use client', 'useEffect', and 'setState'; favor React Server Components (RSC)
Wrap client components in Suspense with fallback
Optimize images: use WebP format, include size data, implement lazy loading
Use 'nuqs' for URL search parameter state management
Limit 'use client': favor server components and Next.js SSR; use only for Web API access in small components; avoid for data fetching or state management

Files:

  • docs/app/source.tsx
docs/**

📄 CodeRabbit inference engine (.cursor/rules/overview.mdc)

The docs/ directory contains online documentation built on Next.js and Fumadocs

Files:

  • docs/app/source.tsx
⏰ 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). (3)
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Deploy Seed Design V3 Docs
  • GitHub Check: Deploy seed-design-v3 Storybook Alpha
🔇 Additional comments (1)
docs/app/source.tsx (1)

45-54: 좋은 null 안전성과 최적화 로직입니다.

Line 45의 early return으로 null 안전성을 확보했으며, Line 52에서 frontmatter에 deprecated가 없을 때만 metadata를 가져오는 것은 불필요한 API 호출을 방지하는 좋은 최적화입니다. 컴포넌트 페이지에만 deprecated 체크를 제한한 것도 요구사항에 부합합니다.

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