Fix/kanban item#76
Conversation
Summary of ChangesHello @Jieunsse, 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! 이 Pull Request는 Highlights
🧠 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
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
이번 PR은 [teamid] 및 addteam 관련 페이지의 파일들을 중앙 위치로 이동하는 대규모 리팩터링으로 보입니다. 코드 구성과 재사용성을 위한 좋은 변화입니다. 하지만 제공된 변경사항에는 삭제된 파일만 표시되고, 이동으로 인해 추가되거나 수정된 새 파일들은 보이지 않습니다. 새로운 코드가 없으면 전체적인 리뷰를 진행하기 어렵습니다. 따라서 제 피드백은 삭제되는 코드에 한정되며, 만약 기존 패턴이 새 코드로 이전되었다면 이 피드백이 도움이 되기를 바랍니다.
I am having trouble creating individual review comments. Click here to see my feedback.
src/app/[teamid]/_domain/hooks/useKanbanTasks.ts (80-86)
props(또는 props에서 파생된 메모이즈된 값)와 state를 동기화하기 위한 이 패턴은 React의 안티패턴이며 예기치 않은 동작을 유발할 수 있습니다. 렌더링 함수 본문에서 직접 state를 업데이트해서는 안 됩니다. useEffect 훅을 사용하여 파생된 computedTasks 값이 변경될 때 state를 업데이트하는 것이 올바른 접근 방식입니다. 또한 이 방법을 사용하면 prevComputed state가 필요 없어져 로직이 더 단순해집니다.
const [tasks, setTasks] = useState<KanbanTask[]>(computedTasks);
useEffect(() => {
setTasks(computedTasks);
}, [computedTasks]);
src/app/[teamid]/_domain/hooks/useKanbanTasks.ts (17-31)
localStorage에 직접 접근하면 서버 사이드 렌더링(SSR) 중에 오류가 발생할 수 있습니다. localStorage는 브라우저 전용 API이기 때문입니다. 이 훅이 클라이언트 컴포넌트에서 사용될 가능성이 높지만, 잠재적인 문제를 방지하기 위해 localStorage 접근을 보호하는 것이 좋습니다. typeof window !== 'undefined' 체크를 추가하면 이 코드가 브라우저 환경에서만 실행되도록 보장할 수 있습니다.
function getStoredStatus(groupId: number, taskListId: number): KanbanStatus | null {
if (typeof window === 'undefined') return null;
try {
const stored = localStorage.getItem(`kanban-status-${groupId}-${taskListId}`);
if (stored === 'todo' || stored === 'inProgress' || stored === 'done') return stored;
return null;
} catch {
return null;
}
}
function setStoredStatus(groupId: number, taskListId: number, status: KanbanStatus): void {
if (typeof window === 'undefined') return;
try {
localStorage.setItem(`kanban-status-${groupId}-${taskListId}`, status);
} catch {}
}
Summary
Issue
Scope
포함
특이사항