Skip to content

refactor(header): 헤더 레이아웃 시프팅 처리 및 AuthSlot 처리 개선#379

Merged
sageherb merged 1 commit into
devfrom
fix/header-style
Jan 7, 2026
Merged

refactor(header): 헤더 레이아웃 시프팅 처리 및 AuthSlot 처리 개선#379
sageherb merged 1 commit into
devfrom
fix/header-style

Conversation

@sageherb
Copy link
Copy Markdown
Collaborator

@sageherb sageherb commented Jan 7, 2026

📖 개요

헤더 레이아웃 시프트 처리 및 인증 슬롯 처리 개선

📌 관련 이슈

N/A

🛠️ 상세 작업 내용

  • 대형 화면에서 grid 기반 레이아웃을 사용하도록 헤더 구조 수정
  • 반응형 정렬 및 간격을 조정해 전체 헤더 정렬 개선
  • HeaderAuthSlot에서 로딩/비인증 상태 분기 로직 정리
  • 로그아웃 시 유저 관련 query cache를 확실히 제거하도록 처리
  • auction 섹션 설명 문구 소폭 수정

✅ PR 체크리스트

  • 기능 테스트
  • UI/레이아웃 확인
  • 타입 정의 및 로직 셀프 리뷰
  • 불필요한 주석 및 코드 제거
  • pnpm build 로 실행 테스트
  • 다른 기능에 영향 없는지 테스트

- 대형 화면에서 grid 기반 레이아웃을 사용하도록 헤더 구조 수정
- 반응형 정렬 및 간격을 조정해 전체 헤더 정렬 개선
- HeaderAuthSlot에서 로딩/비인증 상태 분기 로직 정리
- 로그아웃 시 유저 관련 query cache를 확실히 제거하도록 처리
- auction 섹션 설명 문구 소폭 수정
@sageherb sageherb requested a review from Copilot January 7, 2026 05:35
@github-actions github-actions Bot added the refactor 코드 리팩토링 / 구조 개선 label Jan 7, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the header component to address layout shifting issues and improve authentication slot handling. The changes focus on implementing a grid-based layout for large screens and cleaning up conditional rendering logic.

Key Changes:

  • Implemented CSS Grid layout for xl screens with a 3-column structure (logo, search, auth slot) to prevent layout shifts
  • Refactored HeaderAuthSlot to use a single return statement with conditional content assignment for better code structure
  • Enhanced logout flow to explicitly clear user query cache before navigation

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/widgets/header/header.tsx Introduces grid-based layout for xl screens with explicit column sizing to prevent layout shift, wraps search in a container div for proper flex/grid behavior
src/widgets/header/ui/header-auth-slot.tsx Refactors conditional rendering to use a single return with a wrapper div, improving consistency and enabling better layout control
src/widgets/header/ui/header-user-menu.tsx Adds explicit query cache clearing on logout with setQueryData before removeQueries
src/screens/main/model/sections.ts Updates auction section description text to be more concise

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

} catch {
showToast.error("로그아웃에 실패했습니다. 잠시 후 다시 시도해주세요.");
} finally {
queryClient.setQueryData(userKeys.basic(), null);
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

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

The setQueryData call on line 46 is redundant since removeQueries on line 47 will remove all user-related queries including the basic query. Setting the data to null before removal serves no functional purpose and adds unnecessary complexity. Consider removing line 46 and relying solely on removeQueries to clean up the cache.

Suggested change
queryClient.setQueryData(userKeys.basic(), null);

Copilot uses AI. Check for mistakes.
@sageherb sageherb merged commit 7353a18 into dev Jan 7, 2026
7 checks passed
@sageherb sageherb deleted the fix/header-style branch January 7, 2026 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor 코드 리팩토링 / 구조 개선

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants