Skip to content

리스트 컴포넌트 구현#39

Merged
jungwon123 merged 4 commits into
mainfrom
feat/list
Feb 10, 2026
Merged

리스트 컴포넌트 구현#39
jungwon123 merged 4 commits into
mainfrom
feat/list

Conversation

@jungwon123

Copy link
Copy Markdown
Contributor

Summary

리스트 컴포넌트 구현입니다.

Issue

#38

@jungwon123 jungwon123 added this to the 컴포넌트 milestone Feb 6, 2026
@jungwon123 jungwon123 added the 기능추가 기능개발 및 추가할 때 사용해주세요. label Feb 6, 2026
@github-project-automation github-project-automation Bot moved this to 개발 대기중 in workers Feb 6, 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은 할 일 목록에 사용될 재사용 가능한 TaskListItem 컴포넌트를 도입합니다. 이 컴포넌트는 할 일의 제목, 날짜, 완료 여부, 선택 상태, 반복 설정 및 댓글 수와 같은 주요 정보를 표시하며, 제목을 인라인으로 편집할 수 있는 기능도 제공합니다. 다양한 시나리오에서 컴포넌트의 동작을 검증하기 위한 Storybook 스토리가 함께 추가되었습니다.

Highlights

  • 새로운 TaskListItem 컴포넌트 구현: 할 일 목록의 개별 항목을 표시하는 TaskListItem 컴포넌트가 새로 구현되었습니다. 이 컴포넌트는 체크박스, 제목, 케밥 메뉴, 날짜, 반복 정보 등을 포함합니다.
  • 다양한 상태 지원: 컴포넌트는 완료(checked), 선택됨(isSelected), 편집 모드(isEditing), 댓글 수, 반복 정보 등 다양한 상태를 지원하며, 각 상태에 따라 시각적으로 다르게 표현됩니다.
  • 반응형 디자인 적용: 모바일 화면 크기에 따라 체크박스 크기 및 아이콘 크기가 조절되는 반응형 디자인이 적용되었습니다.
  • Storybook 스토리 추가: 새로 구현된 TaskListItem 컴포넌트의 다양한 상태와 상호작용을 시각적으로 확인할 수 있도록 Storybook 스토리가 추가되었습니다.

🧠 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
  • src/components/list/TaskListItem.stories.tsx
    • TaskListItem 컴포넌트의 Storybook 스토리를 추가하여 기본, 선택됨, 완료됨, 댓글 포함, 반복 설정 포함, 편집 모드 등 다양한 상태를 시각적으로 테스트할 수 있도록 했습니다.
    • useArgs 훅을 사용하여 체크박스 상태를 제어하는 ControlledTaskListItem 렌더러를 구현했습니다.
    • 편집 모드에서 제목 변경 및 제출을 테스트할 수 있는 EditingTaskListItem 렌더러를 추가했습니다.
  • src/components/list/TaskListItem.tsx
    • TaskListItem 컴포넌트의 핵심 로직을 구현했습니다.
    • checked, isSelected, isEditing, frequency, commentCount 등 다양한 props를 기반으로 UI를 렌더링합니다.
    • 모바일 화면 크기에 따라 아이콘 크기를 조절하는 반응형 로직을 useEffect 훅을 사용하여 구현했습니다.
    • 제목 편집 모드에서 Enter 키 입력 시 onTitleSubmit 콜백을 호출하는 기능을 추가했습니다.
  • src/components/list/constants/taskListItemConstants.ts
    • TaskListItem 컴포넌트에서 사용되는 캘린더, 반복, 댓글, 케밥 아이콘의 경로를 상수로 정의했습니다.
  • src/components/list/index.ts
    • TaskListItem 컴포넌트와 TaskListItemProps 타입을 외부에서 쉽게 가져다 쓸 수 있도록 export 했습니다.
  • src/components/list/styles/TaskListItem.module.css
    • TaskListItem 컴포넌트의 스타일을 정의했습니다.
    • 카드, 제목, 메타 정보 등 각 요소에 대한 스타일을 포함하며, 선택됨 및 완료됨 상태에 대한 시각적 피드백을 제공합니다.
    • 모바일 화면 크기에 따른 반응형 스타일 조정을 위한 미디어 쿼리를 추가했습니다.
  • src/components/list/types/types.ts
    • TaskListItem 컴포넌트의 props에 대한 TypeScript 타입을 정의했습니다.
    • 각 prop의 목적과 예상되는 값에 대한 JSDoc 주석을 추가했습니다.
Activity
  • 이 PR은 새로운 컴포넌트와 관련 파일을 추가하는 초기 구현입니다. 현재까지 특별한 리뷰 활동이나 코멘트는 없습니다.
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 잘 보았습니다. 전반적으로 컴포넌트 구조, 파일 분리, Storybook 작성 등 모범적인 방식으로 구현되었습니다. 다만, 컴포넌트의 반응형 처리를 위해 사용된 useEffect 훅이 잠재적인 성능 문제를 일으킬 수 있어 이에 대한 개선 의견을 남겼습니다. 해당 부분을 수정하면 더 완성도 높은 컴포넌트가 될 것 같습니다.

Comment thread src/components/list/TaskListItem.tsx Outdated
Comment on lines +38 to +45
useEffect(() => {
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT}px)`);
const handleChange = () => setIsMobile(mql.matches);

handleChange();
mql.addEventListener('change', handleChange);
return () => mql.removeEventListener('change', handleChange);
}, []);

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

TaskListItem 컴포넌트 인스턴스마다 window.matchMedia를 사용하여 미디어 쿼리 리스너를 등록하고 있습니다. 만약 페이지에 많은 수의 TaskListItem이 렌더링된다면, 다수의 이벤트 리스너가 생성되어 애플리케이션 성능에 부정적인 영향을 줄 수 있습니다.

이 문제를 해결하기 위해, isMobile 상태를 한 곳에서 관리하고 이를 모든 TaskListItem 컴포넌트가 공유하도록 하는 것이 좋습니다. React Context를 사용하여 이 상태를 제공하는 ViewportProvider를 만드는 것을 권장합니다.

예시:

// context/ViewportProvider.tsx
'use client';
import { createContext, useContext, useEffect, useState } from 'react';

const MOBILE_BREAKPOINT = 375;
const ViewportContext = createContext({ isMobile: false });

export function ViewportProvider({ children }) {
  const [isMobile, setIsMobile] = useState(false);

  useEffect(() => {
    const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT}px)`);
    const handleChange = () => setIsMobile(mql.matches);

    handleChange();
    mql.addEventListener('change', handleChange);
    return () => mql.removeEventListener('change', handleChange);
  }, []);

  return (
    <ViewportContext.Provider value={{ isMobile }}>
      {children}
    </ViewportContext.Provider>
  );
}

export const useViewport = () => useContext(ViewportContext);

이렇게 ViewportProvider를 애플리케이션의 상위 레벨(예: layout.tsx)에서 감싸준 뒤, TaskListItem에서는 useViewport 훅을 사용하여 isMobile 값을 가져오면 이벤트 리스너를 하나만 유지하면서 상태를 공유할 수 있습니다.

// TaskListItem.tsx
import { useViewport } from '@/context/ViewportProvider';
// ...
const { isMobile } = useViewport();
const iconSize = isMobile ? 10 : 12;
// ...

이러한 리팩토링은 성능을 크게 개선하고 코드의 재사용성을 높일 것입니다.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

수정 완료하였습니다

@jungwon123 jungwon123 merged commit 5a76684 into main Feb 10, 2026
1 check passed
@github-project-automation github-project-automation Bot moved this from 개발 대기중 to 개발 완료 in workers Feb 10, 2026
@jungwon123 jungwon123 deleted the feat/list branch February 20, 2026 11:53
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