Skip to content

fix: 사이드바 기능 추가 및 렌더링 최적화 @jungwon123#79

Merged
Jieunsse merged 3 commits into
mainfrom
feat/boards
Feb 24, 2026
Merged

fix: 사이드바 기능 추가 및 렌더링 최적화 @jungwon123#79
Jieunsse merged 3 commits into
mainfrom
feat/boards

Conversation

@jungwon123

Copy link
Copy Markdown
Contributor

Summary

fix: 사이드바 기능 추가 및 렌더링 최적화

Issue

@jungwon123 jungwon123 requested review from a team, HWAN0218, Jieunsse and yooolleee February 24, 2026 01:23
@jungwon123 jungwon123 added the 리팩토링 리팩토링 및 리뷰내용 반영시 작성해주세요 label Feb 24, 2026
@jungwon123 jungwon123 added this to the 페이지 milestone Feb 24, 2026
@github-project-automation github-project-automation Bot moved this to 개발 대기중 in workers Feb 24, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @jungwon123, 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은 사이드바에 로그아웃 및 팀 추가와 같은 새로운 기능을 도입하고, 데스크톱 및 모바일 뷰 모두에서 프로필 메뉴 상호작용을 리팩토링합니다. memo를 사용하여 컴포넌트를 최적화하고 폼 입력 필드에서 useState 대신 useRef를 사용하여 리렌더링을 줄이는 등 게시판 페이지에 상당한 렌더링 최적화가 적용되었습니다. 또한, 무한 스크롤을 위한 로딩 표시기가 추가되었고, Next.js의 이미지 로딩을 위해 새로운 S3 호스트네임이 화이트리스트에 추가되었습니다.

Highlights

  • 사이드바 기능 확장: 사이드바와 모바일 헤더에 로그아웃 및 팀 추가 기능을 추가했습니다. 프로필 메뉴 클릭 시 드롭다운이 표시되도록 변경되었습니다.
  • 렌더링 최적화: ArticleCard, ArticleSortHeader, BestSection 컴포넌트에 memo를 적용하여 불필요한 리렌더링을 방지했습니다.
  • 무한 스크롤 로딩 표시기: 게시판 페이지의 무한 스크롤에 로딩 표시기를 구현했습니다.
  • 입력 필드 리팩토링: 폼(게시글 작성/수정, 마이페이지)의 InputTextArea 컴포넌트에서 useState 대신 useRef를 사용하여 값 관리를 개선하고 리렌더링을 줄였습니다.
  • 이미지 호스트네임 화이트리스트: next.config.ts에 새로운 S3 호스트네임을 추가하여 원격 이미지 로딩을 허용했습니다.
  • ArticleCard 링크 동작 변경: ArticleCardonClick prop 대신 Link 컴포넌트를 사용하여 내비게이션을 처리하도록 변경하여 접근성과 표준 웹 동작을 개선했습니다.

🧠 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.

Changelog
  • next.config.ts
    • 이미지 최적화를 위해 S3 호스트네임을 추가했습니다.
  • src/app/(root)/boards/BoardsPage.module.css
    • 로딩 표시기 스타일을 추가하고 화살표 버튼 스타일을 업데이트했습니다.
  • src/app/(root)/boards/BoardsPage.tsx
    • ArticleSortHeaderBestSection 컴포넌트를 메모이제이션했습니다.
    • 검색 입력 필드를 useRef를 사용하도록 리팩토링했습니다.
    • 무한 스크롤 로딩 표시기를 통합했습니다.
  • src/app/(root)/boards/[articleId]/ArticleDetailPage.module.css
    • 토스트 래퍼 스타일을 제거했습니다.
  • src/app/(root)/boards/[articleId]/ArticleDetailPage.tsx
    • 토스트 래퍼 div를 제거했습니다.
  • src/app/(root)/boards/[articleId]/edit/ArticleEditPage.tsx
    • 게시글 수정 폼의 제목 및 내용 입력 필드를 useState 대신 useRef를 사용하도록 리팩토링했습니다.
    • 유효성 검사 로직을 추가했습니다.
  • src/app/(root)/boards/page.tsx
    • BoardsPage 컴포넌트에 isFetchingMore prop을 전달했습니다.
  • src/app/(root)/boards/write/ArticleWritePage.tsx
    • 게시글 작성 폼의 제목 및 내용 입력 필드를 useState 대신 useRef를 사용하도록 리팩토링했습니다.
    • 유효성 검사 로직을 추가했습니다.
  • src/app/(root)/layout.tsx
    • SidebarMobileHeader에 로그아웃 및 로고 클릭 핸들러를 통합했습니다.
    • 팀 추가 페이지로의 내비게이션을 추가했습니다.
  • src/app/(root)/mypage/page.tsx
    • 비밀번호 변경 입력 필드를 useState 대신 useRef를 사용하도록 리팩토링했습니다.
  • src/components/Card/ArticleCard/ArticleCard.module.css
    • Link 컴포넌트 관련 스타일을 추가했습니다.
  • src/components/Card/ArticleCard/ArticleCard.stories.tsx
    • ArticleCard Storybook 스토리에서 onClick prop을 제거하고 href prop을 추가하도록 업데이트했습니다.
  • src/components/Card/ArticleCard/ArticleCard.tsx
    • ArticleCardLink 컴포넌트로 변환하고 메모이제이션했습니다.
    • onClick prop을 제거하고 href prop을 추가했습니다.
  • src/components/input/Input.tsx
    • Input 컴포넌트에 ref prop 지원을 추가했습니다.
  • src/components/input/types/types.ts
    • InputPropsref 타입 정의를 추가했습니다.
  • src/components/sidebar/MobileHeader.tsx
    • 로그아웃 및 마이페이지 옵션을 포함하는 프로필 메뉴 드롭다운을 추가했습니다.
    • 로고 클릭 핸들러를 추가했습니다.
  • src/components/sidebar/Sidebar.tsx
    • 로그아웃 및 마이페이지 옵션을 포함하는 프로필 메뉴 드롭다운을 추가했습니다.
    • 로고 클릭 핸들러를 추가했습니다.
  • src/components/sidebar/styles/MobileHeader.module.css
    • 프로필 메뉴 드롭다운 스타일을 추가했습니다.
  • src/components/sidebar/styles/Sidebar.module.css
    • 프로필 메뉴 드롭다운 스타일을 추가했습니다.
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.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

이번 PR에서는 사이드바의 기능을 완성하고, 컴포넌트 메모이제이션 및 비제어 컴포넌트(useRef) 도입을 통해 렌더링 성능을 최적화한 점이 훌륭합니다. 특히 ArticleCardLink 컴포넌트로 전환하여 SEO와 사용자 경험을 개선한 부분이 좋습니다. 다만, 여러 컴포넌트에서 중복되는 외부 클릭 감지 로직이나 유틸리티 함수들을 공통화하고, 로고 클릭 영역의 웹 접근성을 보완한다면 더욱 완성도 높은 코드가 될 것입니다.

Comment on lines +50 to +59
useEffect(() => {
if (!showProfileMenu) return;
const handleClickOutside = (e: MouseEvent) => {
if (profileMenuRef.current && !profileMenuRef.current.contains(e.target as Node)) {
setShowProfileMenu(false);
}
};
document.addEventListener('mousedown', handleClickOutside);
return () => document.removeEventListener('mousedown', handleClickOutside);
}, [showProfileMenu]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

외부 클릭 시 프로필 메뉴를 닫는 로직이 Sidebar 컴포넌트(56-65행)와 완전히 동일하게 구현되어 있습니다. 이러한 공통 로직은 useClickOutside와 같은 커스텀 훅으로 분리하여 관리하면 코드 중복을 줄이고 유지보수성을 높일 수 있습니다.

Comment on lines +64 to +69
<div
className={styles.logo}
onClick={onLogoClick}
role={onLogoClick ? 'button' : undefined}
tabIndex={onLogoClick ? 0 : undefined}
>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

로고 클릭 시 페이지를 이동하는 기능을 div 태그와 onClick 핸들러로 구현하셨습니다. 현재 tabIndexrole이 설정되어 있지만, 키보드 사용자를 위한 Enter 또는 Space 키 이벤트 핸들러가 누락되어 있어 접근성이 떨어집니다. 접근성을 위해 Link 컴포넌트를 사용하거나 button 태그를 사용하는 것을 권장합니다.

Comment on lines +158 to +163
<div
className={styles.logo}
onClick={onLogoClick}
role={onLogoClick ? 'button' : undefined}
tabIndex={onLogoClick ? 0 : undefined}
>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

모바일 헤더와 마찬가지로 사이드바의 로고 영역도 div 대신 Link 컴포넌트를 사용하여 웹 접근성을 개선하는 것이 좋습니다. 현재 구현으로는 키보드 포커스는 가지만 실제 실행은 되지 않는 문제가 있습니다.

Comment on lines +24 to +37
function formatDate(dateString: string): string {
const date = new Date(dateString);
const year = date.getFullYear();
const month = (date.getMonth() + 1).toString().padStart(2, '0');
const day = date.getDate().toString().padStart(2, '0');
return `${year}. ${month}. ${day}`;
}

function formatLikeCount(count: number): string {
if (count >= 1000) {
return '999+';
}
return count.toString();
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

formatDateformatLikeCount 함수는 게시판 목록뿐만 아니라 상세 페이지 등 여러 곳에서 재사용될 가능성이 높은 유틸리티 함수입니다. 현재 ArticleDetailPage 등에서도 유사한 로직이 중복 사용되고 있으므로, src/utils와 같은 공통 디렉토리로 분리하여 관리하는 것을 추천합니다.

@Jieunsse Jieunsse merged commit f82abbe into main Feb 24, 2026
1 check passed
@github-project-automation github-project-automation Bot moved this from 개발 대기중 to 개발 완료 in workers Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

리팩토링 리팩토링 및 리뷰내용 반영시 작성해주세요

Projects

Status: 개발 완료

Development

Successfully merging this pull request may close these issues.

사이드바 및 마이페이지, 자유게시판 렌더링 최적화

4 participants