Skip to content

Comments

[Feat/#20] 채팅 바텀 스낵바(pop_up) 컴포넌트 개발 #21

Open
chunjaemin wants to merge 4 commits intodevelopfrom
feat/#20-bottom-snackbar
Open

[Feat/#20] 채팅 바텀 스낵바(pop_up) 컴포넌트 개발 #21
chunjaemin wants to merge 4 commits intodevelopfrom
feat/#20-bottom-snackbar

Conversation

@chunjaemin
Copy link
Contributor

요약

  • 채팅 바텀 스낵바(pop_up) 컴포넌트를 구현했습니다.
  • 스낵바 in/out 애니메이션을 shared/lib/hooks에 구현해두었고 가져다 쓰는 방식으로 구현했습니다.
    스낵바 말고도 팝업창과 같은 다른 UI에도 쓸 수 있으니 애니메이션 필요하신 분들은 가져다가 쓰셔도 좋을 것 같아요

참고사항

  • 스낵바는 absolute로 Floating 하지 않고, stack방식으로 돔 요소 위에 쌓이도록 구현했습니다.
    키보드 유무에 따라 스낵바의 위치도 같이 움직여야 한다는 점을 고려했을 때 absolute 보다 stack 방식이 동적인 움직임을 더 간편하게 조작할 수 있을 것 같아서 stack방식을 채용했습니다

  • 바텀 스낵바는 widgets에 구현했습니다.

  • 스낵바 visible 상태관리는 props로 받아서 on/off 되도록 최대한 간단하게 구현해놓았습니다.
    상태관리를 할 수 있는 방법이 여러가지라 이부분은 은혜님이 사용하시기 편한 방법으로 바꿔서 사용하시면 될 것 같아요 당장에는 가장 직관적으로 사용할 수 있도록 했습니다!

🔗 관련 이슈

💬 리뷰어에게

image image

@github-actions github-actions bot added the feature 새로운 기능 구현 label Feb 23, 2026
@github-actions
Copy link

Thanks for the contribution!
I have applied any labels matching special text in your title and description.

Please review the labels and make any necessary changes.

@gemini-code-assist
Copy link

Summary of Changes

Hello @chunjaemin, 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 요소에도 적용할 수 있도록 설계되었습니다. 특히 키보드 상호작용을 고려하여 동적인 레이아웃에 원활하게 통합될 수 있도록 스택 기반의 배치 방식을 채택했습니다.

Highlights

  • 채팅 하단 스낵바 컴포넌트 구현: 채팅 인터페이스를 위한 하단 스낵바(pop-up) 컴포넌트가 새로 구현되었습니다.
  • 재사용 가능한 애니메이션 훅: 스낵바의 등장/퇴장 애니메이션을 shared/lib/hooksuseFadeSlideVisibility 훅으로 구현하여 다른 UI 요소에도 재사용할 수 있도록 했습니다.
  • 스택 기반 레이아웃 채택: 스낵바는 absolute 포지셔닝 대신 스택(flex) 방식으로 배치되어, 키보드 유무에 따른 동적인 위치 조작을 더 간편하게 처리할 수 있습니다.
  • 간단한 상태 관리: 스낵바의 가시성 상태는 props를 통해 외부에서 제어하도록 설계되어, 사용자가 편리한 방식으로 상태를 관리할 수 있습니다.
Changelog
  • src/app/(tabs)/index.tsx
    • 임포트 순서가 재정렬되었습니다.
  • src/shared/lib/hooks/useFadeSlideVisibility.ts
    • 페이드 및 슬라이드 애니메이션을 위한 새로운 훅이 추가되었습니다.
  • src/widgets/chat/bottom-snackbar/README.md
    • BottomSnackbar 컴포넌트에 대한 사용법 및 참고사항 문서가 추가되었습니다.
  • src/widgets/chat/bottom-snackbar/index.ts
    • BottomSnackbar 컴포넌트와 관련 타입이 외부로 노출되도록 익스포트되었습니다.
  • src/widgets/chat/bottom-snackbar/model/types.ts
    • BottomSnackbarProps 타입 정의가 추가되었습니다.
  • src/widgets/chat/bottom-snackbar/ui/BottomSnackbar.tsx
    • BottomSnackbar UI 컴포넌트의 구현이 추가되었습니다.
Activity
  • 현재까지 이 Pull Request에 대한 특별한 활동(댓글, 리뷰 등)은 없습니다.
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.

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

The pull request introduces a new BottomSnackbar component with fade and slide animations, along with a useFadeSlideVisibility hook to manage its visibility and animation. The implementation looks clean and well-structured, providing a reusable solution for snackbar-like UI elements. The README.md file is comprehensive and provides clear usage instructions and prop documentation. The useMemo hook in useFadeSlideVisibility is correctly used to memoize animatedStyle, preventing unnecessary re-renders. Overall, the changes enhance the UI capabilities with a well-designed and animated component.

Comment on lines +45 to +55
const animatedStyle = useMemo(() => {
const translateY = progress.interpolate({
inputRange: [0, 1],
outputRange: [translateYFrom, 0],
});

return {
opacity: progress,
transform: [{ translateY }],
} as const;
}, [progress, translateYFrom]);

Choose a reason for hiding this comment

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

medium

The useMemo hook here is correctly used to memoize the animatedStyle object. This is a good practice as it prevents unnecessary re-creations of the style object on every render, which could lead to performance issues, especially with complex animations or frequent re-renders of the parent component. This aligns with the general rule of avoiding useMemo when it only returns a prop without any complex computation, as here it does involve computation (interpolation) and depends on progress and translateYFrom.

References
  1. Avoid using useMemo when it only returns a prop without any complex computation, as it offers no performance benefit and adds unnecessary complexity.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

useMemo로 애니메이션 객체 재생성을 막은 것이라 이대로 유지하도록 하겠습니다

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.

[FEAT/#20] 채팅 스낵바(pop_up 컴포넌트) 개발

1 participant