Skip to content

Fix/toggle#200

Merged
dasosann merged 3 commits intomainfrom
fix/toggle
Mar 26, 2026
Merged

Fix/toggle#200
dasosann merged 3 commits intomainfrom
fix/toggle

Conversation

@dasosann
Copy link
Copy Markdown
Contributor

@dasosann dasosann commented Mar 26, 2026

요약

구현 사항

  • 코드 로직 개선
  • 전체선택, 선택해제 버튼 분리
  • [ ]
  • [ ]

📸 스크린샷

Need Review

  • ~ 부분 이렇게 구현했어요, 피드백 부탁해요!

Reference

📜 리뷰 규칙

Reviewer는 아래 P5 Rule을 참고하여 리뷰를 진행합니다.
P5 Rule을 통해 Reviewer는 Reviewee에게 리뷰의 의도를 보다 정확히 전달할 수 있습니다.

  • P1: 꼭 반영해주세요 (Comment)
  • P2: 적극적으로 고려해주세요 (Comment)
  • P3: 웬만하면 반영해 주세요 (Comment)
  • P4: 반영해도 좋고 넘어가도 좋습니다 (Approve)
  • P5: 그냥 사소한 의견입니다 (Approve)

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 26, 2026

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

Project Deployment Actions Updated (UTC)
fe Ready Ready Preview, Comment Mar 26, 2026 7:35am

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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은 사진 목록 컴포넌트의 선택 기능을 개선하여 사용자 경험을 향상시키는 데 중점을 둡니다. 기존의 단일 토글 버튼을 두 개의 명확한 '전체 선택' 및 '선택 해제' 버튼으로 분리하고, 내부 로직을 최적화하여 선택 상태 관리를 더욱 직관적이고 효율적으로 만들었습니다.

Highlights

  • 선택 로직 분리: 기존의 단일 토글 방식의 전체 선택/해제 로직을 '전체 선택'과 '선택 해제' 두 개의 개별 함수로 명확하게 분리했습니다.
  • UI 개선: 사용자 인터페이스에서 '전체 선택'과 '선택 해제' 버튼을 명확하게 분리하여 사용성을 향상시켰습니다.
  • 성능 최적화: 선택 가능한 사진 ID 목록을 useMemo를 사용하여 캐싱함으로써 관련 로직의 효율성을 높였습니다.

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

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.

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
Copy Markdown
Contributor

@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

This pull request refactors the photo selection logic in PhotoList.tsx by separating 'select all' and 'clear all' functionalities into distinct handlers and updating the UI to display separate, conditional buttons for these actions. It also optimizes photo ID collection using a useMemo hook to prevent redundant computations. The review suggests extracting the new buttons into a reusable ActionButton component to reduce code duplication and improve maintainability, and recommends using Tailwind CSS utility classes instead of inline styles for better consistency.

Comment on lines 255 to +278
<div className='mb-3'>
<div className='mb-3 flex justify-between'>
<button
type='button'
className='typo-body-sm-medium text-text-subtle rounded-[4px] px-3 py-1.5'
style={{
background: '#F1F2F3',
}}
onClick={handleToggleSelectAll}
>
{hasAnySelected ? '전체 선택 취소' : '전체 선택'}
</button>
<div className='flex gap-1.5'>
<button
type='button'
className='typo-body-sm-medium text-text-subtle rounded-[4px] px-3 py-1.5'
style={{
background: '#F1F2F3',
}}
onClick={handleSelectAll}
>
전체 선택
</button>
{hasAnySelected && (
<button
type='button'
className='typo-body-sm-medium text-text-subtle rounded-[4px] px-3 py-1.5'
style={{
background: '#F1F2F3',
}}
onClick={handleClearAll}
>
선택 해제
</button>
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 내의 버튼들은 스타일과 구조가 매우 유사하여 코드 중복이 발생합니다. 바로 뒤에 있는 '취소' 버튼도 동일한 스타일을 사용하므로, 유지보수성을 높이기 위해 이 버튼들을 재사용 가능한 컴포넌트로 추출하는 것을 고려해 보세요.

예를 들어, 다음과 같이 ActionButton 컴포넌트를 만들 수 있습니다.

const ActionButton = ({ onClick, children }: { onClick: React.MouseEventHandler<HTMLButtonElement>; children: React.ReactNode }) => (
  <button
    type='button'
    className='typo-body-sm-medium text-text-subtle rounded-[4px] px-3 py-1.5'
    style={{ background: '#F1F2F3' }}
    onClick={onClick}
  >
    {children}
  </button>
);

그리고 다음과 같이 사용하면 코드가 더 깔끔해집니다.

<div className='flex gap-1.5'>
  <ActionButton onClick={handleSelectAll}>전체 선택</ActionButton>
  {hasAnySelected && (
    <ActionButton onClick={handleClearAll}>선택 해제</ActionButton>
  )}
</div>

추가적으로, style={{ background: '#F1F2F3' }}와 같은 인라인 스타일 대신 Tailwind CSS 유틸리티 클래스를 사용하는 것이 프로젝트 전체의 스타일 일관성을 유지하는 데 도움이 됩니다.

@dasosann dasosann merged commit 9f11171 into main Mar 26, 2026
4 checks passed
@dasosann dasosann deleted the fix/toggle branch March 26, 2026 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant