Skip to content

사이드바 모션 추가 및 Gnb 버튼 사용#46

Merged
jungwon123 merged 3 commits into
mainfrom
fix/sidebar
Feb 10, 2026
Merged

사이드바 모션 추가 및 Gnb 버튼 사용#46
jungwon123 merged 3 commits into
mainfrom
fix/sidebar

Conversation

@jungwon123

Copy link
Copy Markdown
Contributor

Summary

사이드바 모션 추가 및 Gnb 버튼 사용하도록 수정하였습니다

Issue

Scope

@jungwon123 jungwon123 added this to the 컴포넌트 milestone Feb 9, 2026
@jungwon123 jungwon123 added the 리팩토링 리팩토링 및 리뷰내용 반영시 작성해주세요 label Feb 9, 2026
@github-project-automation github-project-automation Bot moved this to 개발 대기중 in workers Feb 9, 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은 사이드바의 사용자 경험을 개선하기 위해 애니메이션 기능을 도입합니다. framer-motion 라이브러리를 활용하여 사이드바가 접히거나 펼쳐질 때 시각적으로 부드러운 전환 효과를 제공하며, 기존의 사이드바 추가 버튼을 더 일반적인 Gnb 버튼으로 교체하여 컴포넌트 재사용성을 높였습니다. 전반적으로 UI의 동적인 요소를 강화하고 일관된 디자인 시스템을 유지하는 데 기여합니다.

Highlights

  • 애니메이션 라이브러리 추가: 사이드바 모션 구현을 위해 framer-motion 라이브러리가 종속성에 추가되었습니다.
  • 사이드바 접기/펴기 애니메이션: 사이드바의 너비 변화, 로고 전환, 콘텐츠 페이드인/아웃, 프로필 정보 슬라이드 등 접기/펴기 동작에 framer-motion을 활용한 부드러운 애니메이션이 적용되었습니다.
  • GnbAddButton 컴포넌트 사용: 사이드바 스토리북에서 SidebarAddButton 대신 GnbAddButton 컴포넌트를 사용하도록 변경되었습니다.
  • CSS 스타일 조정: 사이드바의 접힌 상태 너비 제어를 framer-motion으로 이관하고, 콘텐츠 영역에 텍스트 오버플로우 처리를 위한 스타일이 추가되었습니다.

🧠 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
  • package.json
    • framer-motion 패키지(버전 ^12.34.0)가 의존성에 추가되었습니다.
    • 개발 의존성 목록의 순서가 재정렬되었습니다.
  • pnpm-lock.yaml
    • framer-motion 및 관련 종속성(motion-dom, motion-utils)에 대한 잠금 파일 항목이 추가되었습니다.
  • src/components/sidebar/Sidebar.stories.tsx
    • SidebarAddButton 대신 GnbAddButton 컴포넌트를 임포트하고 사용하도록 변경되었습니다.
    • GnbAddButtononClick 핸들러가 추가되었습니다.
  • src/components/sidebar/Sidebar.tsx
    • framer-motion에서 motionAnimatePresence를 임포트했습니다.
    • 사이드바의 <aside> 요소가 motion.aside로 래핑되어 너비 애니메이션이 적용되었습니다.
    • 로고 전환 시 AnimatePresencemotion.div를 사용하여 페이드인/아웃 및 스케일 애니메이션을 구현했습니다.
    • 사이드바 콘텐츠 영역에 AnimatePresencemotion.div를 적용하여 접기/펴기 시 콘텐츠의 페이드 애니메이션을 추가했습니다.
    • 프로필 정보 영역에 AnimatePresencemotion.div를 사용하여 접기/펴기 시 슬라이드 및 페이드 애니메이션을 추가했습니다.
  • src/components/sidebar/styles/Sidebar.module.css
    • .collapsed 클래스에서 width: 72px 속성이 제거되어 framer-motion이 너비를 제어하도록 했습니다.
    • .content 클래스에 white-space: nowrapoverflow: hidden 속성이 추가되어 텍스트 오버플로우를 처리합니다.
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은 사이드바에 framer-motion을 사용하여 애니메이션을 추가하고, 기존의 SidebarAddButtonGnbAddButton으로 교체하는 변경 사항을 담고 있습니다. 전반적으로 사이드바의 사용자 경험을 향상시키는 좋은 개선입니다. 몇 가지 코드 개선점을 제안합니다. Sidebar.tsx 컴포넌트에서 하드코딩된 값들을 상수로 추출하고, 중복되는 애니메이션 로직과 렌더링 로직을 리팩토링하여 코드의 가독성과 유지보수성을 높일 수 있습니다.

Comment thread src/components/sidebar/Sidebar.tsx Outdated
Comment on lines +92 to +95
{teamSelect &&
(typeof teamSelect === 'function' ? teamSelect(isCollapsed) : teamSelect)}
{typeof children === 'function' ? children(isCollapsed) : children}
{addButton && (typeof addButton === 'function' ? addButton(isCollapsed) : addButton)}

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.

high

teamSelect, children, addButton을 렌더링하는 로직이 중복되고, children prop의 렌더링 방식이 다른 두 prop과 일관되지 않습니다. 이로 인해 children prop에 0과 같은 falsy 값이 전달될 경우 의도치 않게 렌더링되는 문제가 발생할 수 있습니다.

이 로직을 헬퍼 함수로 추출하여 중복을 제거하고 일관성을 확보하는 것을 권장합니다.

const renderSlot = (slotNode: ReactNode | ((isCollapsed: boolean) => ReactNode)) => {
  if (!slotNode) return null;
  return typeof slotNode === 'function' ? slotNode(isCollapsed) : slotNode;
};

위 함수를 컴포넌트 내부에 정의하고 다음과 같이 코드를 개선할 수 있습니다.

Suggested change
{teamSelect &&
(typeof teamSelect === 'function' ? teamSelect(isCollapsed) : teamSelect)}
{typeof children === 'function' ? children(isCollapsed) : children}
{addButton && (typeof addButton === 'function' ? addButton(isCollapsed) : addButton)}
{renderSlot(teamSelect)}
{renderSlot(children)}
{renderSlot(addButton)}

<aside className={clsx(styles.sidebar, isCollapsed && styles.collapsed)}>
<motion.aside
className={clsx(styles.sidebar, isCollapsed && styles.collapsed)}
animate={{ width: isCollapsed ? 72 : 270 }}

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

사이드바의 접혔을 때와 펼쳤을 때의 너비 값(72, 270)이 하드코딩되어 있습니다. 이 값들을 "매직 넘버"라고 부르며, 코드의 가독성과 유지보수성을 저해할 수 있습니다. 이 값들을 상수로 정의하여 사용하는 것을 권장합니다.

예를 들어, 컴포넌트 외부에 다음과 같이 상수를 선언할 수 있습니다.

const SIDEBAR_WIDTH = {
  COLLAPSED: 72,
  EXPANDED: 270,
};
Suggested change
animate={{ width: isCollapsed ? 72 : 270 }}
animate={{ width: isCollapsed ? SIDEBAR_WIDTH.COLLAPSED : SIDEBAR_WIDTH.EXPANDED }}

Comment on lines +51 to +57
<motion.div
key="icon"
initial={{ opacity: 0, scale: 0.8 }}
animate={{ opacity: 1, scale: 1 }}
exit={{ opacity: 0, scale: 0.8 }}
transition={{ duration: 0.2 }}
>

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

로고 아이콘과 전체 로고의 애니메이션 속성이 중복으로 정의되어 있습니다. framer-motionvariants를 활용하여 중복을 제거하고 코드를 더 간결하게 만들 수 있습니다.

예를 들어, 다음과 같이 variants 객체를 정의하고 사용할 수 있습니다.

const logoVariants = {
  hidden: { opacity: 0, scale: 0.8 },
  visible: { opacity: 1, scale: 1 },
};

이렇게 하면 motion.div가 더 깔끔해집니다.

Suggested change
<motion.div
key="icon"
initial={{ opacity: 0, scale: 0.8 }}
animate={{ opacity: 1, scale: 1 }}
exit={{ opacity: 0, scale: 0.8 }}
transition={{ duration: 0.2 }}
>
<motion.div
key="icon"
variants={logoVariants}
initial="hidden"
animate="visible"
exit="hidden"
transition={{ duration: 0.2 }}
>

@jungwon123 jungwon123 merged commit e1b1386 into main Feb 10, 2026
1 check passed
@github-project-automation github-project-automation Bot moved this from 개발 대기중 to 개발 완료 in workers Feb 10, 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