-
Notifications
You must be signed in to change notification settings - Fork 2
[Refactor] Survey Question Zustand로 관리 & 페이지 내 디테일 수정 & 이메일 전송 API 연결 #376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- auth 내에 route grouping 적용 - 임시로 register page는 whitelist 처리해둠 - 모달 페이지가 로딩되지 않는 문제로 인함. - 추후 라우팅 등 수정 후 register page는 다시 whitelist에서 제외할 예정 - GnbLeft 에서 워크스페이스가 없더라도 확인할 수 있도록 수정 - 근데 버그 있어서 다시 수정해야 합니다
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Zustand 기반 설문 질문 상태 관리로의 전면적인 리팩토링과 다양한 페이지 디테일 개선을 수행한 PR입니다.
- Zustand를 이용한 설문 질문 상태 관리 도입으로 기존 props drilling 구조를 개선
- 인증 관련 라우트 보호 기능 강화 및 리디렉션 로직 개선
- 다양한 컴포넌트의 UI/UX 세부사항 개선
Reviewed Changes
Copilot reviewed 51 out of 54 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| src/features/team-mood-tracker/stores/survey-question-store.ts | Zustand 기반 설문 질문 상태 관리 스토어 신규 추가 |
| src/features/team-mood-tracker/hooks/stores/useSurveyQuestionStore.ts | 설문 질문 스토어 훅 인터페이스 제공 |
| src/common/components/inputs/input-survey/**/*.tsx | props 기반에서 questionId 기반 컴포넌트로 전면 리팩토링 |
| src/features/auth/components/protect-routes/ProtectChildren/*.tsx | 라우트 보호 컴포넌트 신규 추가 |
| src/middleware.ts | 미들웨어 구조 정리 및 주석 추가 |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
| subjectiveAnswer: q.subjectiveQuestionDescription, | ||
| }; | ||
| } else { | ||
| throw new Error('FUCKED UP QUESTION TYPE'); |
Copilot
AI
Aug 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P3] 에러 메시지가 부적절합니다. 프로덕션 코드에서는 더 전문적이고 명확한 메시지를 사용해야 합니다.
throw new Error('Invalid question type provided');| throw new Error('FUCKED UP QUESTION TYPE'); | |
| throw new Error(`Invalid question type encountered: ${q.questionType}`); |
| : CheckboxIconsState.SQUARE_CHECKBOX_DISABLED; | ||
| } | ||
|
|
||
| throw new Error('WRONG QUESTION TYPE'); // 잘못된 질문 타입 |
Copilot
AI
Aug 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P3] 에러 메시지를 더 설명적으로 개선하고 한국어 주석을 영어로 변경해야 합니다.
throw new Error('Invalid question type for option rendering');| throw new Error('WRONG QUESTION TYPE'); // 잘못된 질문 타입 | |
| throw new Error(`Invalid question type '${questionType}' encountered in iconState function.`); // Invalid question type |
| }; | ||
|
|
||
| const optionNameChange = (value: string) => { | ||
| if (isCreatingSurvey) return; // 설문을 생성하는 상황이 아닐 경우 변경하지 않습니다. |
Copilot
AI
Aug 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P2] 조건문의 로직이 잘못되었습니다. 설문을 생성하는 상황일 때가 아니라 생성하지 않는 상황일 때 리턴해야 합니다.
if (!isCreatingSurvey) return; // 설문을 생성하는 상황이 아닐 경우 변경하지 않습니다.| if (isCreatingSurvey) return; // 설문을 생성하는 상황이 아닐 경우 변경하지 않습니다. | |
| if (!isCreatingSurvey) return; // 설문을 생성하는 상황이 아닐 경우 변경하지 않습니다. |
| ? { | ||
| ...q, | ||
| multipleOrCheckboxOptions: q.multipleOrCheckboxOptions.map((opt) => | ||
| opt.id === optionId ? value : opt, |
Copilot
AI
Aug 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P2] 옵션 업데이트 로직에서 객체 구조를 잘못 처리하고 있습니다. QuestionOptions 객체의 content 속성을 업데이트해야 합니다.
opt.id === optionId ? { ...opt, content: value } : opt,| opt.id === optionId ? value : opt, | |
| opt.id === optionId ? { ...opt, content: value } : opt, |
| return { | ||
| questionId: q.id, | ||
| type: TeamMoodTrackerSurveyQuestionType.MULTIPLE_CHOICE, | ||
| multipleChoiceId: q.multipleOrCheckboxOptions.map((opt) => opt.id)[0], |
Copilot
AI
Aug 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P2] 설문 참여 시 선택된 옵션이 아닌 첫 번째 옵션의 ID를 항상 반환하고 있습니다. 사용자가 실제로 선택한 옵션을 사용해야 합니다.
multipleChoiceId: q.checkedOptionList[0]?.id || '',| multipleChoiceId: q.multipleOrCheckboxOptions.map((opt) => opt.id)[0], | |
| multipleChoiceId: q.checkedOptionList[0]?.id || '', |
| return { | ||
| questionId: q.id, | ||
| type: TeamMoodTrackerSurveyQuestionType.CHECKBOX_CHOICE, | ||
| checkboxChoiceIdList: q.multipleOrCheckboxOptions.map((opt) => opt.id), |
Copilot
AI
Aug 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P2] 체크박스 응답에서 모든 옵션 ID를 반환하고 있습니다. 사용자가 실제로 선택한 옵션들만 반환해야 합니다.
checkboxChoiceIdList: q.checkedOptionList.map((opt) => opt.id),| checkboxChoiceIdList: q.multipleOrCheckboxOptions.map((opt) => opt.id), | |
| checkboxChoiceIdList: q.checkedOptionList.map((opt) => opt.id), |
|
|
||
| const RootPage = () => { | ||
| return <RootRedirectHandler />; | ||
| redirect(ROUTES.LANDING); |
Copilot
AI
Aug 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P3] 서버 컴포넌트에서 redirect를 사용할 때는 반환문 앞에 await를 사용하는 것이 권장됩니다.
const RootPage = async () => {
redirect(ROUTES.LANDING);
};| * 리스트 컬럼명 부분 | ||
| */ | ||
| const ListHeader = ({ fileType }: ListHeaderProps) => { | ||
| // TODO: 이건 뭐에요? |
Copilot
AI
Aug 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P4] 의미없는 TODO 주석을 제거하거나 더 구체적인 설명으로 개선해야 합니다.
| // TODO: 이건 뭐에요? |
| placeholder={`옵션 ${optionList.indexOf(currentOption) + 1}`} | ||
| onChange={(e) => optionNameChange(e.target.value)} | ||
| // 설문을 생성하는 경우를 제외하고는 readOnly로 설정합니다. | ||
| readOnly={!isCreatingSurvey} |
Copilot
AI
Aug 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P3] 옵션 수정 가능 여부 로직이 일관성이 없습니다. optionNameChange 함수에서는 isCreatingSurvey일 때 리턴하지만, input의 readOnly는 반대 조건을 사용합니다. 로직을 일치시켜야 합니다.
✨ Vercel Preview Deployed📦 PR #376 by @kyeoungwoon 🔗 Links
Powered by Vercel ⚡ |
#️⃣ Related Issues
🧑💻 작업 내용
💾 작업 결과 (선택)
💬 리뷰 시 요청사항 (선택)
📝 Checklist