Skip to content

Conversation

@bini0918
Copy link

@bini0918 bini0918 commented Dec 28, 2025

💡 To Reviewers

  • 피그마 화면 크기와 노트북 화면 크기가 안 맞아서 피그마 기준 w-[1440px] 으로 화면 맞춰놓고 하는 중입니다. 이대로 해도 되는 게 맞을까요?

🔥 작업 내용 (가능한 구체적으로 작성해 주세요)

  • 헤더 UI 구현

🤔 추후 작업 예정

  • 홈화면 구현 예정입니다

📸 작업 결과 (스크린샷)

스크린샷 2025-12-29 오전 1 34 51

🔗 관련 이슈

Summary by CodeRabbit

  • New Features
    • Introduced a new application header with top navigation bar featuring a logo and dynamic menu items
    • Added navigation icons for search, notifications, and user profile functionality
    • Active navigation state indicators for current page context

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

@coderabbitai
Copy link

coderabbitai bot commented Dec 28, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

This PR introduces a new header component with navigation and integrates it into the main application layout through a MainLayout wrapper. It adds a Header component with logo, navigation menu items, and action icons, along with a NavItem sub-component for individual navigation links, and updates TypeScript configuration to include Next.js generated type files.

Changes

Cohort / File(s) Summary
Layout Components
src/app/(main)/layout.tsx, src/app/(main)/page.tsx
Adds MainLayout wrapper that renders Header with children, and HomePage component as default page route.
Header Components
src/components/layout/Header.tsx, src/components/layout/NavItem.tsx
Introduces Header with responsive navigation bar featuring logo, NAV menu items with active state detection based on current pathname, and icon buttons for search/notifications/profile; NavItem sub-component renders styled links with conditional active styling.
Configuration
tsconfig.json
Reformats array structures to multi-line format and adds Next.js type generation patterns (.next/types/**/*.ts, .next/dev/types/**/*.ts) to TypeScript include paths.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant Router as Next.js Router
    participant MainLayout
    participant Header
    participant NavItem
    
    User->>Router: Navigate to route
    Router->>MainLayout: Render with pathname context
    MainLayout->>Header: Mount Header component
    Header->>Header: Call usePathname() to get current path
    loop For each NAV item
        Header->>NavItem: Render with href, label, active state
        Note over NavItem: Determine if href matches pathname<br/>("/" → exact match, others → startsWith)
        NavItem->>NavItem: Apply active or inactive styles
    end
    NavItem-->>Header: Render styled link
    Header-->>User: Display navigation bar with active indicator
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • fix: 폴더 이동 #4: Both PRs modify tsconfig.json to include Next.js-generated type files in TypeScript compilation paths, with potential overlap in the .next/types/**/*.ts patterns.

Poem

🐰 A header hops into the layout with flair,
Navigation items dancing everywhere,
Active states shimmer when paths align,
The app now has structure, so divine!
One Header to rule them all, so fine.

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 (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'feat: header UI 추가' clearly indicates the main change: adding header UI. It is specific, concise, and directly relates to the primary change of implementing a Header component.
Linked Issues check ✅ Passed The PR successfully implements the objectives from Issue #8: a Header component has been created and integrated into the layout through MainLayout, with responsive design and navigation items as shown in the code changes.
Out of Scope Changes check ✅ Passed All changes are within scope. The PR includes Header component implementation, layout integration, and necessary tsconfig updates for Next.js type definitions. No unrelated modifications were introduced.

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.

@gemini-code-assist
Copy link

Summary of Changes

Hello @bini0918, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 애플리케이션의 핵심 헤더 UI를 구현하여 사용자 인터페이스의 기반을 마련합니다. 로고, 주요 내비게이션 링크, 그리고 검색, 알림, 프로필과 같은 사용자 액션 아이콘을 포함하는 헤더가 추가되었습니다. 또한, 새로운 레이아웃 구조를 도입하고 필요한 SVG 에셋을 추가하여 향후 페이지 개발을 위한 준비를 마쳤습니다.

Highlights

  • 헤더 UI 구현: 애플리케이션의 핵심 헤더 UI가 구현되었습니다. 로고, 내비게이션 링크, 검색/알림/프로필 아이콘을 포함합니다.
  • 새로운 SVG 에셋 추가: 로고, 알림, 프로필, 검색 아이콘을 위한 새로운 SVG 파일들이 public 디렉토리에 추가되었습니다.
  • 레이아웃 구조 변경: src/app/(main)/layout.tsx 파일이 추가되어 Header 컴포넌트를 포함하는 메인 레이아웃을 정의하고, 기존 src/app/page.tsxsrc/app/page.backup.tsx로 이름이 변경되었습니다.
  • 내비게이션 컴포넌트 분리: 헤더 내비게이션 링크의 활성 상태를 관리하는 NavItem.tsx 컴포넌트가 새로 추가되었습니다.
  • TypeScript 설정 업데이트: tsconfig.json 파일이 Next.js 타입 정의 경로를 포함하도록 업데이트되었습니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link

@bini0918 bini0918 changed the base branch from main to dev December 28, 2025 16:37
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

헤더 UI를 추가하는 PR 잘 보았습니다. 전반적으로 Next.js와 Tailwind CSS를 사용하여 깔끔하게 컴포넌트를 구성해주셨습니다. 몇 가지 코드의 유지보수성과 재사용성을 높일 수 있는 부분을 중심으로 리뷰를 남겼습니다. 하드코딩된 스타일 값을 tailwind.config.js로 옮겨 관리하는 것과, 반복되는 아이콘 링크를 데이터 기반으로 렌더링하여 가독성과 접근성을 개선하는 방안을 제안드렸습니다. 피그마 화면 크기에 맞춰 w-[1440px]로 작업하신 부분은 좋은 접근 방식이며, 이 값을 테마 설정에 추가하면 프로젝트 전반에서 일관되게 사용할 수 있어 더욱 좋을 것 같습니다. 앞으로의 작업도 기대하겠습니다!

Comment on lines +19 to +20
<header className="w-full bg-[#7B6154]">
<div className="mx-auto w-full max-w-[1440px] px-3 py-7">

Choose a reason for hiding this comment

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

medium

하드코딩된 스타일 값(bg-[#7B6154], max-w-[1440px])을 사용하고 있습니다. 이러한 값들을 tailwind.config.js에 테마 값으로 등록하여 사용하면 일관성을 유지하고 재사용하기 용이해집니다.

예를 들어, tailwind.config.js에 다음과 같이 추가할 수 있습니다:

// tailwind.config.js
module.exports = {
  theme: {
    extend: {
      colors: {
        'brand-primary': '#7B6154',
      },
      maxWidth: {
        'desktop': '1440px',
      }
    },
  },
  // ...
}

이렇게 하면 코드에서는 bg-brand-primary, max-w-desktop과 같이 의미 있는 클래스 이름을 사용할 수 있어 가독성과 유지보수성이 향상됩니다.

Comment on lines 53 to 92
{/*아이콘*/}
<div className="flex items-center gap-4">
<Link href="/search" aria-label="검색" className="relative h-6 w-6">
<Image
src="/search.svg"
alt=""
fill
className="object-contain"
priority
/>
</Link>

<Link
href="/notification"
aria-label="알림"
className="relative h-6 w-6"
>
<Image
src="/notification.svg"
alt=""
fill
className="object-contain"
priority
/>
</Link>

<Link
href="/profile"
aria-label="프로필"
className="relative h-6 w-6"
>
<Image
src="/profile.svg"
alt=""
fill
className="object-contain"
priority
/>
</Link>
</div>

Choose a reason for hiding this comment

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

medium

아이콘 링크들이 반복적으로 작성되어 있고, 이미지에 alt 속성이 비어있습니다. 가독성, 유지보수성, 접근성을 개선하기 위해 아이콘 링크 데이터를 배열로 관리하고 map을 사용해 렌더링하는 것을 권장합니다. 또한, 이미지가 로드되지 않거나 스크린 리더 사용자를 위해 각 이미지에 의미 있는 alt 텍스트를 추가해야 합니다.

          {/*아이콘*/}
          <div className="flex items-center gap-4">
            {[
              { href: "/search", label: "검색", src: "/search.svg" },
              { href: "/notification", label: "알림", src: "/notification.svg" },
              { href: "/profile", label: "프로필", src: "/profile.svg" },
            ].map((icon) => (
              <Link
                key={icon.href}
                href={icon.href}
                aria-label={icon.label}
                className="relative h-6 w-6"
              >
                <Image
                  src={icon.src}
                  alt={`${icon.label} 아이콘`}
                  fill
                  className="object-contain"
                  priority
                />
              </Link>
            ))}
          </div>

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)
src/components/layout/NavItem.tsx (1)

9-28: Consider using a className utility for cleaner conditional styling.

The array.join(" ") pattern works but is verbose. Consider using a utility like clsx or cn (classnames helper) for more maintainable conditional className construction.

📘 Example refactor using clsx

First, install clsx:

npm install clsx

Then refactor the component:

+import clsx from 'clsx';
 import Link from "next/link";

 interface NavItemProps {
   href: string;
   label: string;
   active: boolean;
 }

 export function NavItem({ href, label, active }: NavItemProps) {
   return (
     <Link
       href={href}
-      className={[
-        "flex w-32 items-center justify-center gap-2.5 p-2.5",
-        active ? "border-b-2 border-white" : "border-b-2 border-transparent",
-      ].join(" ")}
+      className={clsx(
+        "flex w-32 items-center justify-center gap-2.5 p-2.5 border-b-2",
+        active ? "border-white" : "border-transparent"
+      )}
     >
       <span
-        className={[
-          "text-center text-xl font-semibold leading-7",
-          active ? "text-white" : "text-gray-200",
-        ].join(" ")}
+        className={clsx(
+          "text-center text-xl font-semibold leading-7",
+          active ? "text-white" : "text-gray-200"
+        )}
       >
         {label}
       </span>
     </Link>
   );
 }
src/components/layout/Header.tsx (1)

19-32: Consider moving hard-coded color to theme configuration.

The arbitrary color value bg-[#7B6154] works but could be defined in your Tailwind theme for better maintainability and consistency across the application.

Regarding the max-w-[1440px] width you mentioned in the PR description: this approach is acceptable for matching a fixed design width, though you may want to consider responsive breakpoints for smaller screens in future iterations.

💡 Example: Adding to Tailwind theme

In tailwind.config.ts:

export default {
  theme: {
    extend: {
      colors: {
        brand: {
          brown: '#7B6154',
        },
      },
    },
  },
};

Then use it as:

-<header className="w-full bg-[#7B6154]">
+<header className="w-full bg-brand-brown">
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ad62f6f and ce170ed.

⛔ Files ignored due to path filters (4)
  • public/logo.svg is excluded by !**/*.svg
  • public/notification.svg is excluded by !**/*.svg
  • public/profile.svg is excluded by !**/*.svg
  • public/search.svg is excluded by !**/*.svg
📒 Files selected for processing (6)
  • src/app/(main)/layout.tsx
  • src/app/(main)/page.tsx
  • src/app/page.backup.tsx
  • src/components/layout/Header.tsx
  • src/components/layout/NavItem.tsx
  • tsconfig.json
🧰 Additional context used
🧬 Code graph analysis (2)
src/app/(main)/layout.tsx (1)
src/components/layout/Header.tsx (1)
  • Header (15-97)
src/components/layout/Header.tsx (1)
src/components/layout/NavItem.tsx (1)
  • NavItem (9-28)
🔇 Additional comments (9)
tsconfig.json (1)

4-43: LGTM! Standard Next.js TypeScript configuration improvements.

The formatting changes improve readability, and including .next/types/**/*.ts aligns with Next.js 15+ conventions for TypeScript type generation.

src/components/layout/NavItem.tsx (1)

1-7: LGTM! Clean prop interface.

The interface is well-defined with appropriate types for the navigation item component.

src/app/(main)/page.tsx (1)

1-3: LGTM! Placeholder for upcoming home screen implementation.

The empty component serves as a valid placeholder, aligning with the PR's stated plan to implement the home screen in a follow-up.

src/app/(main)/layout.tsx (1)

1-11: LGTM! Clean layout composition.

The MainLayout correctly integrates the new Header component and follows Next.js 15+ layout conventions.

src/components/layout/Header.tsx (5)

1-6: LGTM! Correct client directive and imports.

The "use client" directive is properly placed for the usePathname hook usage, and all imports are appropriate for the header implementation.


8-13: LGTM! Well-structured navigation data.

The navigation items are clearly defined with appropriate labels and routes.


34-50: LGTM! Correct active state logic.

The navigation active state handling properly addresses the common edge case where "/" would match all routes. The special condition ensures the home item only activates on the exact "/" path while other items use prefix matching.


54-92: LGTM! Excellent accessibility implementation.

The icon links properly use aria-label attributes with empty alt="" on images, which is the correct WCAG pattern when the link itself is labeled. The priority flag on these above-the-fold images is also appropriate.


24-91: All required image assets (logo.svg, search.svg, notification.svg, profile.svg) are present in the public directory. No action needed.

@bini0918 bini0918 requested a review from shinwokkang December 28, 2025 16:51
@bini0918 bini0918 requested a review from hongik-luke December 28, 2025 16:51
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.

[feat] 헤더 추가

5 participants