[Bugfix] 임시 일정/할 일 삭제 시 서버 요청 방지#126
Open
yeonjin719 wants to merge 4 commits into
Open
Conversation
1 task
Contributor
There was a problem hiding this comment.
Pull request overview
임시(로컬) 일정/할 일에 대해 isTemporary 플래그로 서버 반영 여부를 구분해, 삭제/상세조회/수정/색상변경 시 불필요한 서버 요청을 방지하고 일부 UI 스타일을 보완한 PR입니다.
Changes:
CalendarEvent.isTemporary를 도입하고, 임시 항목인 경우 delete/detail/patch/색상 patch 요청이 나가지 않도록 조건 분기 추가- 서버 생성 후 임시 이벤트를 실제 id로 교체할 때
isTemporary: false로 상태 전환 - 카드 UI 정렬 및 투두 삭제 아이콘 커서 스타일 보완
한 줄 요약
isTemporary 기반으로 “임시 로컬 데이터 vs 서버 데이터”를 분리해 서버 요청을 차단하는 방향은 타당하나, 투두 삭제 아이콘 클릭 요소의 키보드 접근성 보완이 필요합니다.
발견된 위반 항목
src/features/Todo/components/TodoCard/TodoCard.tsx: 클릭 가능한 SVG 아이콘(Trash)에 대해 키보드 접근/스크린리더 라벨이 없어 접근성 문제가 남아있음(이번 변경 라인에 포함).
추천 구조
- (선택)
shared/ui에 아이콘 버튼/액션 버튼 컴포넌트가 이미 있다면 그 컴포넌트로 교체하거나, 없다면 추후 아래처럼 공용화 고려:src/shared/ui/common/IconButton/IconButton.tsxIconButton.style.ts
최소 리팩토링 단계
TodoCard의 Trash SVG에role,tabIndex,aria-label,onKeyDown(Enter/Space)를 추가해 키보드로도 삭제 트리거 가능하게 수정- (선택) 클릭 액션을 SVG 직접 바인딩 대신
<button type="button">래핑 형태로 정리해 접근성/스타일 일관성 개선
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/shared/ui/Modals/TodoEditor/TodoEditorContent.tsx | 투두 상세 hydration에 initialEvent 전달로 임시 여부 분기 지원 |
| src/shared/types/calendar/types.ts | CalendarEvent에 isTemporary 플래그 추가 |
| src/shared/hooks/form/useTodoEditorForm.ts | 임시 투두는 patch 대신 create 흐름으로 전환 |
| src/shared/hooks/addTodo/useTodoFooter.tsx | 임시 투두 색상 변경 시 patch 요청 차단 |
| src/shared/hooks/addTodo/useTodoDetailHydration.ts | 임시 투두 상세 조회 요청 차단 |
| src/shared/hooks/addSchedule/useScheduleSubmitFlow.ts | 임시 일정은 편집 모드여도 create 흐름으로 전환 |
| src/shared/hooks/addSchedule/useSchedulePatch.ts | 임시 일정 patch 요청 차단 |
| src/shared/hooks/addSchedule/useScheduleFooter.tsx | 임시 일정 삭제/색상 patch 요청 차단 및 삭제 시 모달만 닫기 |
| src/features/Todo/components/TodoCard/TodoCard.tsx | 삭제 아이콘 커서 스타일 추가(UI/UX) |
| src/features/Calendar/utils/helpers/calendarPageHelpers.ts | 로컬 임시 생성 이벤트에 isTemporary: true 설정 |
| src/features/Calendar/hooks/useCalendarEvents.ts | 서버 응답 후 id 교체 시 isTemporary: false로 전환 |
| src/features/Calendar/hooks/useCalendarDraftEvent.ts | 편집 중이더라도 임시 이벤트면 모달 닫을 때 로컬에서 제거 |
| src/features/Calendar/components/EventDetailCard/EventDetailCard.style.ts | 상세 카드 텍스트 좌측 정렬(flex-start) 보정 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 관련 이슈
🧩 작업 요약 (TL;DR)
🔄 변경 유형
해당되는 항목에 체크해주세요.
📌 주요 변경 사항
CalendarEvent에isTemporary플래그를 추가해 서버 반영 전 로컬 임시 데이터와 서버 데이터를 구분했습니다.flex-start로 맞췄습니다.🖼️ 스크린샷 / 영상 (선택)
🧠 리뷰 요청 포인트
isTemporary기준으로 서버 데이터와 로컬 임시 데이터를 분기하는 방식이 적절한지 확인 부탁드립니다.🚧 미완 / 후속 작업
💬 기타 참고 사항
Date.now()기반 양수라서id > 0조건만으로는 서버 저장 여부를 판단하기 어려웠습니다.isTemporary플래그를 추가해 로컬 전용 항목을 명시적으로 구분했습니다.npm run build통과 확인했습니다.@copilot 이 PR을 아래 기준으로 검토해주세요:
.github/instructions/capstone.instructions.md 파일을 지침으로 삼으세요.
폴더/파일 위치가 프로젝트 구조 규칙과 일치하는지
컴포넌트가 단일 책임 원칙(SRP)을 지키는지
import 방향이 올바른지 (shared → features 역방향