Skip to content

카드 투두 구현#43

Merged
jungwon123 merged 2 commits into
mainfrom
feat/todo
Feb 10, 2026
Merged

카드 투두 구현#43
jungwon123 merged 2 commits into
mainfrom
feat/todo

Conversation

@jungwon123

Copy link
Copy Markdown
Contributor

Summary

카드 투두 구현입니다.

Issue

#42

@jungwon123 jungwon123 added this to the 컴포넌트 milestone Feb 8, 2026
@jungwon123 jungwon123 added the 기능추가 기능개발 및 추가할 때 사용해주세요. label Feb 8, 2026
@github-project-automation github-project-automation Bot moved this to 개발 대기중 in workers Feb 8, 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은 할일 목록을 표시하고 관리할 수 있는 새로운 TodoCard 컴포넌트를 구현합니다. 이 컴포넌트는 UI 일관성을 높이고, 향후 작업 관리 기능에 재사용 가능한 빌딩 블록을 제공합니다.

Highlights

  • 새로운 컴포넌트 추가: 재사용 가능한 TodoCard 컴포넌트가 새로 추가되었습니다.
  • 기능 및 UI: 이 컴포넌트는 제목, 완료 상태를 나타내는 뱃지, 그리고 상호작용 가능한 할일 항목 목록을 포함합니다.
  • 확장성: 카드 내용을 확장하거나 축소할 수 있는 기능을 지원하여 유연한 UI를 제공합니다.
  • Storybook 통합: 컴포넌트의 다양한 상태(기본, 모두 완료, 축소 등)를 시연하고 문서화하기 위한 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/todo-card/TodoCard.stories.tsx
    • TodoCard 컴포넌트의 Storybook 스토리를 추가하여 다양한 상태(기본, 모두 완료, 축소, 개요)를 시연합니다.
  • src/components/todo-card/TodoCard.tsx
    • 제목, 항목, 체크 변경 핸들러, 케밥 클릭 핸들러, 확장 상태를 위한 props를 포함하는 핵심 TodoCard React 컴포넌트를 추가했습니다.
  • src/components/todo-card/constants/todoCardConstants.ts
    • 케밥 아이콘 경로를 포함한 TodoCard 관련 상수를 추가했습니다.
  • src/components/todo-card/index.ts
    • TodoCard 및 관련 타입을 내보내는 인덱스 파일을 추가했습니다.
  • src/components/todo-card/styles/TodoCard.module.css
    • TodoCard 컴포넌트의 스타일을 위한 CSS 모듈을 추가했습니다.
  • src/components/todo-card/types/types.ts
    • TodoItemTodoCardProps에 대한 TypeScript 타입 정의를 추가했습니다.
Activity
  • 이 PR은 TodoCard 컴포넌트라는 새로운 기능을 도입하며, 모든 관련 파일이 새로 추가되었습니다.
  • 컴포넌트의 기능과 다양한 상태를 보여주기 위해 Storybook 스토리가 포함되었습니다.
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

카드 투두 컴포넌트 구현을 잘 보았습니다. 전반적으로 컴포넌트 구조와 기능이 명확하게 작성되었습니다. 몇 가지 개선점을 제안드립니다.

  • TodoCard 컴포넌트에서 items 배열이 변경될 때만 checkedCount를 다시 계산하도록 useMemo를 사용하여 성능을 최적화할 수 있습니다.
  • onItemCheckedChange prop이 제공되지 않았을 때 체크박스가 읽기 전용으로 동작하도록 수정하여 의도치 않은 사용자 인터랙션을 방지하는 것이 좋습니다.
  • Storybook 파일에서 ControlledTodoCard의 props 타입을 더 정확하게 지정하고, 중복되는 상태 업데이트 로직을 함수로 추출하여 코드 유지보수성을 높일 수 있습니다.

자세한 내용은 각 파일의 주석을 참고해주세요.

Comment thread src/components/todo-card/TodoCard.tsx Outdated
checked={item.checked}
size="small"
label={<span className={styles.itemLabel}>{item.text}</span>}
onCheckedChange={(checked) => onItemCheckedChange?.(item.id, checked)}

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

onItemCheckedChange prop이 제공되지 않은 경우, CheckBox는 클릭은 되지만 상태가 변경되지 않아 사용자에게 혼란을 줄 수 있습니다. onItemCheckedChange가 없을 때 CheckBoxonCheckedChange prop에 undefined를 전달하여 CheckBox가 내부적으로 읽기 전용(read-only) 상태가 되도록 하는 것이 좋습니다. 이렇게 하면 사용자가 체크박스를 변경할 수 없다는 것을 명확히 알 수 있습니다.

Suggested change
onCheckedChange={(checked) => onItemCheckedChange?.(item.id, checked)}
onCheckedChange={onItemCheckedChange ? (checked) => onItemCheckedChange(item.id, checked) : undefined}

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.

리뷰 반영하여 수정하였습니다

Comment on lines +49 to +52
}: {
items: TodoItem[];
title: string;
}) => {

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

ControlledTodoCard 컴포넌트의 props 타입이 { items: TodoItem[]; title: string; }으로 지정되어 있어, ...args로 전달되는 expanded, onKebabClick 등의 다른 TodoCard props에 대한 타입 체크가 이루어지지 않습니다. TodoCardProps를 사용하여 더 정확한 타입을 지정하는 것이 좋습니다. 이렇게 하면 타입 안정성이 향상되고, 컴포넌트의 의도된 사용법을 더 명확하게 할 수 있습니다. (./types/types에서 TodoCardProps를 import해야 합니다.)

}: Omit<TodoCardProps, 'onItemCheckedChange'>) => {

Comment on lines +102 to +104
onItemCheckedChange={(id, checked) =>
setItems1((prev) => prev.map((item) => (item.id === id ? { ...item, checked } : item)))
}

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

Overview 스토리 내에서 setItems1setItems2에 전달되는 상태 업데이트 로직이 중복됩니다. 이 로직은 ControlledTodoCard 컴포넌트의 handleCheckedChange 함수에도 동일하게 존재합니다. 코드 중복을 줄이고 유지보수성을 높이기 위해 이 로직을 별도의 헬퍼 함수로 추출하여 재사용하는 것을 고려해 보세요.

예를 들어, 다음과 같은 헬퍼 함수를 정의할 수 있습니다.

const updateItemChecked = (prev: TodoItem[], id: string, checked: boolean) =>
  prev.map((item) => (item.id === id ? { ...item, checked } : item));

그리고 이 함수를 handleCheckedChangeOverview 스토리에서 사용하면 코드가 더 간결해집니다.

// In ControlledTodoCard
const handleCheckedChange = (id: string, checked: boolean) => {
  setItems((prev) => updateItemChecked(prev, id, checked));
};

// In Overview story
// ...
onItemCheckedChange={(id, checked) => setItems1((prev) => updateItemChecked(prev, id, checked))}
// ...

expanded = true,
className,
}: TodoCardProps) {
const checkedCount = items.filter((item) => item.checked).length;

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

items prop이 변경되지 않았음에도 컴포넌트가 리렌더링될 때마다 checkedCount가 다시 계산됩니다. items 배열이 클 경우 성능에 영향을 줄 수 있습니다. useMemo를 사용하여 items가 변경될 때만 값을 다시 계산하도록 최적화하는 것을 권장합니다.

이를 위해 react에서 useMemo를 import해야 합니다: import { useMemo } from 'react';

Suggested change
const checkedCount = items.filter((item) => item.checked).length;
const checkedCount = useMemo(() => items.filter((item) => item.checked).length, [items]);

@jungwon123 jungwon123 merged commit a81f08e 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/todo 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