Skip to content

[✨ Feat/#63] Header 공통 컴포넌트 구현#66

Merged
Lseojeong merged 2 commits into
devfrom
feat/#63
Jul 7, 2026
Merged

[✨ Feat/#63] Header 공통 컴포넌트 구현#66
Lseojeong merged 2 commits into
devfrom
feat/#63

Conversation

@Lseojeong

@Lseojeong Lseojeong commented Jul 6, 2026

Copy link
Copy Markdown
Member

#️⃣연관된 이슈

체크 사항

  • UI 동작 및 레이아웃 확인
  • 불필요한 console 제거
  • 기능 정상 동작
  • 팀 컨벤션에 맞게 구현했는지

📝작업 내용

Header 공통 컴포넌트 구현

  • widgets/common/header에 공통 Header 컴포넌트를 추가했습니다.
  • 게스트 상태에서는 로그인 버튼을 렌더링합니다.
  • 로그인 사용자 상태에서는 사용자 프로필을 렌더링합니다.
  • 스크롤 시 Header 배경 blur가 적용되도록 구현했습니다.

디자인 토큰 정리

  • Header z-index를 --z-index-header 토큰으로 관리하도록 추가했습니다.
  • 로그인 버튼 shadow를 colors.css의 shadow token으로 분리했습니다.
  • 로그인 경로를 ROUTES.LOGIN 상수로 추가했습니다.

Storybook 문서화

  • 게스트/로그인 사용자 상태별 Header Storybook을 추가했습니다.
  • 스크롤 상태를 고정해서 확인할 수 있는 Story를 함께 작성했습니다.

스크린샷 (선택)

추가한 라이브러리

  • 없음

💬리뷰 요구사항(선택)

Summary by CodeRabbit

  • New Features
    • 앱 전반에서 로그인 경로를 공통 상수로 참조할 수 있게 추가했습니다.
    • 공통 헤더에 로그인/비로그인 상태 및 스크롤 여부에 따른 표시를 제공하는 헤더 컴포넌트와 Storybook 프리뷰를 추가했습니다.
  • Style
    • 헤더 관련 그림자 및 헤더 레이어용 z-index 스타일 토큰을 추가했습니다.
  • Bug Fixes
    • 헤더가 스크롤에 따라 배경/그림자/블러 스타일을 일관되게 전환합니다.
    • 로고 클릭 및 로그인 링크 동작 경로 기준을 통일했습니다.

@Lseojeong Lseojeong self-assigned this Jul 6, 2026
@Lseojeong Lseojeong added the ✨Feature 새로운 기능 구현 label Jul 6, 2026
@Lseojeong Lseojeong linked an issue Jul 6, 2026 that may be closed by this pull request
6 tasks
@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
rewrite Ready Ready Preview, Comment Jul 7, 2026 11:05am

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

🧪 테스트 결과

항목 결과
✅ Jest 테스트 success

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 76ec90d9-6cbc-4c38-bf68-ac224df8e8b0

📥 Commits

Reviewing files that changed from the base of the PR and between ce6bb0d and afbe662.

📒 Files selected for processing (1)
  • src/widgets/common/header/Header.stories.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/widgets/common/header/Header.stories.tsx

Walkthrough

로그인 라우트 상수와 헤더용 스타일 토큰이 추가되었고, 로그인 여부와 스크롤 상태에 따라 로고, 배경 블러, 로그인 CTA를 바꾸는 공통 Header 컴포넌트가 새로 구현되었습니다. Storybook 스토리와 모듈 재export도 함께 추가되었습니다.

Changes

Header 공통 컴포넌트 구현

Layer / File(s) Summary
라우트 및 스타일 토큰 추가
src/shared/constants/routes.ts, src/shared/styles/base/colors.css, src/shared/styles/base/z-index.css
ROUTES.LOGIN과 헤더 버튼 그림자 토큰, --z-index-header가 추가됨.
Header 상태 로직
src/widgets/common/header/Header.tsx
HeaderProps와 로그인 여부, 로고 경로, 스크롤 기반 blur 상태 계산 로직이 추가됨.
Header 렌더링 및 export
src/widgets/common/header/Header.tsx, src/widgets/common/header/index.ts
Profile/로그인 CTA 조건 렌더링과 스티키 헤더 스타일 적용, Header 재export가 추가됨.
Storybook 스토리
src/widgets/common/header/Header.stories.tsx
게스트/로그인 및 스크롤 상태 조합을 보여주는 스토리가 추가됨.

Estimated code review effort: 2 (Simple) | ~15 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Browser
  participant Header
  participant ScrollListener
  participant ROUTES

  Browser->>Header: 페이지 렌더링 (user, isBackgroundBlurred 등 props 전달)
  alt isBackgroundBlurred 미전달
    Header->>ScrollListener: scroll 이벤트 리스너 등록
    Browser->>ScrollListener: scroll 발생
    ScrollListener->>Header: hasScrolled 업데이트
  end
  Header->>ROUTES: authenticatedLogoHref / loginHref 조회
  alt user 존재
    Header->>Browser: Profile 컴포넌트 렌더링
  else user 없음
    Header->>Browser: 로그인 LinkButton 렌더링
  end
Loading

Possibly related PRs

  • Rewrite-Team/Rewrite-FE#28: ROUTES 상수를 확장하는 흐름이 같고, 라우팅 토큰을 UI 컴포넌트에서 참조한다는 점에서 직접 연관이 있습니다.
  • Rewrite-Team/Rewrite-FE#40: 로그인 CTA가 사용하는 LinkButton 컴포넌트의 동작과 이 PR의 Header 렌더링이 코드 수준에서 맞물립니다.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목이 헤더 공통 컴포넌트 구현이라는 주요 변경을 간결하게 잘 요약합니다.
Linked Issues check ✅ Passed 게스트/로그인 헤더, 스크롤 시 블러, 로고 연결, Storybook 추가가 이슈 요구사항과 대체로 일치합니다.
Out of Scope Changes check ✅ Passed 추가된 라우트 토큰과 스타일 토큰, 스토리북, 재export는 헤더 구현 목적에 부합합니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/#63

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

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

🚦 CI 검증 결과

항목 결과
🧠 TypeScript 타입 체크 success
🧹 ESLint 검사 success
🎨 Prettier 검사 success
🏗️ Build 검증 success

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
src/widgets/common/header/Header.stories.tsx (1)

47-64: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

LoggedIn/LoggedInScrolled 스토리 간 user 객체 리터럴 중복.

동일한 user 값을 상수로 추출해서 재사용하면 값 변경 시 두 곳을 동기화할 필요가 없어집니다.

♻️ 제안 리팩터링
+const loggedInUser = {
+  name: '이서정',
+  profileImageUrl: DefaultProfileImage.src,
+};
+
 export const LoggedIn: Story = {
   args: {
-    user: {
-      name: '이서정',
-      profileImageUrl: DefaultProfileImage.src,
-    },
+    user: loggedInUser,
   },
 };

 export const LoggedInScrolled: Story = {
   args: {
     isBackgroundBlurred: true,
-    user: {
-      name: '이서정',
-      profileImageUrl: DefaultProfileImage.src,
-    },
+    user: loggedInUser,
   },
 };
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/widgets/common/header/Header.stories.tsx` around lines 47 - 64, The
LoggedIn and LoggedInScrolled story args duplicate the same user object literal,
so extract that shared user value into a reusable constant in Header.stories.tsx
and reference it from both Story definitions. Keep the existing Story objects
the same otherwise, and use the shared symbol to avoid having to update the name
and profileImageUrl in two places.
src/widgets/common/header/Header.tsx (1)

44-64: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

스크롤 blur 로직에 대한 단위 테스트 부재.

스크롤 임계값(blurThreshold) 기준 blur 전환, 외부 제어(isBackgroundBlurred) 시 스크롤 리스너 미등록 등은 로직 분기가 있는 만큼 회귀 방지를 위한 테스트 커버리지를 추가하는 것을 고려해보세요.

원하시면 React Testing Library 기반 테스트 코드를 작성해 드릴 수 있습니다.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/widgets/common/header/Header.tsx` around lines 44 - 64, The scroll blur
behavior in Header.tsx is missing unit test coverage, so add tests around the
Header component’s useEffect and shouldBlur logic: verify blurThreshold flips
the blurred state based on window.scrollY, and verify that when
isBackgroundBlurred is provided the component does not register the scroll
listener and relies on the external value instead. Use the existing Header,
hasScrolled, and handleScroll behavior as the primary targets for the tests.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/widgets/common/header/Header.stories.tsx`:
- Around line 47-64: The LoggedIn and LoggedInScrolled story args duplicate the
same user object literal, so extract that shared user value into a reusable
constant in Header.stories.tsx and reference it from both Story definitions.
Keep the existing Story objects the same otherwise, and use the shared symbol to
avoid having to update the name and profileImageUrl in two places.

In `@src/widgets/common/header/Header.tsx`:
- Around line 44-64: The scroll blur behavior in Header.tsx is missing unit test
coverage, so add tests around the Header component’s useEffect and shouldBlur
logic: verify blurThreshold flips the blurred state based on window.scrollY, and
verify that when isBackgroundBlurred is provided the component does not register
the scroll listener and relies on the external value instead. Use the existing
Header, hasScrolled, and handleScroll behavior as the primary targets for the
tests.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6154e621-ba7a-483e-97b2-99c399f79cc5

📥 Commits

Reviewing files that changed from the base of the PR and between 54c28b5 and ce6bb0d.

📒 Files selected for processing (6)
  • src/shared/constants/routes.ts
  • src/shared/styles/base/colors.css
  • src/shared/styles/base/z-index.css
  • src/widgets/common/header/Header.stories.tsx
  • src/widgets/common/header/Header.tsx
  • src/widgets/common/header/index.ts

@Lseojeong Lseojeong merged commit 0005e8a into dev Jul 7, 2026
5 checks passed
@Lseojeong Lseojeong deleted the feat/#63 branch July 7, 2026 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨Feature 새로운 기능 구현

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[✨ Feature] Header 공통 컴포넌트 구현

1 participant