Conversation
Summary of ChangesHello @seseoju, 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
🧠 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이네요. 전반적으로 핵심적인 버그들이 잘 해결되었습니다. 특히 일정 수정 폼의 데이터 초기화 로직 개선과 삭제 후 내비게이션 처리 방식 변경은 좋은 개선입니다. 다만, 코드의 유지보수성과 아키텍처 일관성을 높이기 위한 제안이 있습니다. 일정 생성 및 수정 페이지에 추가된 에러 처리 로직이 중복되고 있으며, 이는 FSD 아키텍처 원칙에 따라 features 레이어로 옮기는 것이 더 적합합니다. 관련하여 두 파일에 각각 리뷰 코멘트를 남겼으니 확인 부탁드립니다.
| onError: (error) => { | ||
| if ( | ||
| error instanceof ApiError && | ||
| error.code === 'SCHEDULE_INTERVAL_TOO_CLOSE' | ||
| ) { | ||
| toastError('이전 일정과 시작 시간이 너무 가깝습니다'); | ||
| return; | ||
| } | ||
| toastError('일정 수정에 실패했습니다.'); | ||
| }, |
There was a problem hiding this comment.
이 에러 처리 로직은 ScheduleCreatePage.tsx에 있는 로직과 거의 동일하여 중복되고 있습니다.\n\n스타일 가이드의 FSD 아키텍처 규칙(1.2 레이어 책임)에 따라, API 에러 코드를 직접 다루는 비즈니스 로직은 pages가 아닌 features 레이어에서 처리하는 것이 좋습니다.\n\n이러한 중복과 아키텍처 위반을 해결하기 위해, useMutation 로직을 features 레이어의 커스텀 훅으로 추출하는 것을 제안합니다. 예를 들어, features/schedule-edit에 다음과 같은 훅을 만들 수 있습니다.\n\ntypescript\n// features/schedule-edit/hooks/useUpdateSchedule.ts\nimport { useMutation, useQueryClient } from '@tanstack/react-query';\nimport { scheduleQueries } from '@/shared/queries';\nimport { toastError } from '@/shared/ui/toast';\nimport { ApiError } from '@/shared/api/apiHandler';\n\nexport const useUpdateSchedule = (onSuccessCallback: () => void) => {\n const queryClient = useQueryClient();\n\n return useMutation({\n ...scheduleQueries.updateScheduleMutation,\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: scheduleQueries.all });\n onSuccessCallback();\n },\n onError: (error) => {\n if (\n error instanceof ApiError &&\n error.code === 'SCHEDULE_INTERVAL_TOO_CLOSE'\n ) {\n toastError('이전 일정과 시작 시간이 너무 가깝습니다');\n return;\n }\n toastError('일정 수정에 실패했습니다.');\n },\n });\n};\n\n\n이렇게 하면 페이지 컴포넌트는 UI 로직에 더 집중할 수 있게 됩니다.\n\ntypescript\n// ScheduleEditPage.tsx\nconst { pop } = useFlow();\nconst { mutate: updateSchedule } = useUpdateSchedule(() => pop());\n\nconst handleSubmit = (e: React.FormEvent) => {\n // ...\n updateSchedule({ crewId, scheduleId, payload });\n};\n
References
- FSD 아키텍처 규칙(1.2 레이어 책임)에 따라, 비즈니스 로직은
pages가 아닌features레이어에서 처리해야 합니다. API 에러 코드를 직접 다루는 것은 비즈니스 로직에 해당합니다. (link)
🛠️ 변경 사항
세부 변경 내용
initialAcitivity번쩍임 이슈를 종종 봐서 조만간 해결해야 할거같네요,,SCHEDULE_INTERVAL_TOO_CLOSE에 따라 토스트 에러를 처리했습니다.🔍 관련 이슈
📸 스크린샷 / GIF (선택)
🔄 연관 작업