Skip to content

Conversation

@kyeoungwoon
Copy link
Member

@kyeoungwoon kyeoungwoon commented Aug 21, 2025

#️⃣ Related Issues

연관된 모든 Issue를 작성해주세요.

🧑‍💻 작업 내용

어떤 작업을 진행했는지 자세하게 작성해주세요.

💾 작업 결과 (선택)

사진, 영상 등을 첨부해주세요.

💬 리뷰 시 요청사항 (선택)

Reviewer는 코드 리뷰의 코멘트에 코멘트를 강조하고 싶은 정도를 Pn 규칙
맞춰서 표기해 주세요.

📝 Checklist

  • Reviewer를 추가했나요?
  • Convention을 준수했나요?

- auth 내에 route grouping 적용
- 임시로 register page는 whitelist 처리해둠
- 모달 페이지가 로딩되지 않는 문제로 인함.
- 추후 라우팅 등 수정 후 register page는 다시 whitelist에서 제외할 예정
- GnbLeft 에서 워크스페이스가 없더라도 확인할 수 있도록 수정
- 근데 버그 있어서 다시 수정해야 합니다
Copilot AI review requested due to automatic review settings August 21, 2025 12:54
@kyeoungwoon kyeoungwoon requested a review from a team as a code owner August 21, 2025 12:54
@kyeoungwoon kyeoungwoon requested review from S-Gihun, duwlsssss and strfunctionk and removed request for a team August 21, 2025 12:54
@vercel
Copy link

vercel bot commented Aug 21, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
haru-web Ready Ready Preview Comment Aug 21, 2025 1:48pm

Copy link

Copilot AI left a 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');
Copy link

Copilot AI Aug 21, 2025

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');
Suggested change
throw new Error('FUCKED UP QUESTION TYPE');
throw new Error(`Invalid question type encountered: ${q.questionType}`);

Copilot uses AI. Check for mistakes.
: CheckboxIconsState.SQUARE_CHECKBOX_DISABLED;
}

throw new Error('WRONG QUESTION TYPE'); // 잘못된 질문 타입
Copy link

Copilot AI Aug 21, 2025

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');
Suggested change
throw new Error('WRONG QUESTION TYPE'); // 잘못된 질문 타입
throw new Error(`Invalid question type '${questionType}' encountered in iconState function.`); // Invalid question type

Copilot uses AI. Check for mistakes.
};

const optionNameChange = (value: string) => {
if (isCreatingSurvey) return; // 설문을 생성하는 상황이 아닐 경우 변경하지 않습니다.
Copy link

Copilot AI Aug 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] 조건문의 로직이 잘못되었습니다. 설문을 생성하는 상황일 때가 아니라 생성하지 않는 상황일 때 리턴해야 합니다.

if (!isCreatingSurvey) return; // 설문을 생성하는 상황이 아닐 경우 변경하지 않습니다.
Suggested change
if (isCreatingSurvey) return; // 설문을 생성하는 상황이 아닐 경우 변경하지 않습니다.
if (!isCreatingSurvey) return; // 설문을 생성하는 상황이 아닐 경우 변경하지 않습니다.

Copilot uses AI. Check for mistakes.
? {
...q,
multipleOrCheckboxOptions: q.multipleOrCheckboxOptions.map((opt) =>
opt.id === optionId ? value : opt,
Copy link

Copilot AI Aug 21, 2025

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,
Suggested change
opt.id === optionId ? value : opt,
opt.id === optionId ? { ...opt, content: value } : opt,

Copilot uses AI. Check for mistakes.
return {
questionId: q.id,
type: TeamMoodTrackerSurveyQuestionType.MULTIPLE_CHOICE,
multipleChoiceId: q.multipleOrCheckboxOptions.map((opt) => opt.id)[0],
Copy link

Copilot AI Aug 21, 2025

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 || '',
Suggested change
multipleChoiceId: q.multipleOrCheckboxOptions.map((opt) => opt.id)[0],
multipleChoiceId: q.checkedOptionList[0]?.id || '',

Copilot uses AI. Check for mistakes.
return {
questionId: q.id,
type: TeamMoodTrackerSurveyQuestionType.CHECKBOX_CHOICE,
checkboxChoiceIdList: q.multipleOrCheckboxOptions.map((opt) => opt.id),
Copy link

Copilot AI Aug 21, 2025

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),
Suggested change
checkboxChoiceIdList: q.multipleOrCheckboxOptions.map((opt) => opt.id),
checkboxChoiceIdList: q.checkedOptionList.map((opt) => opt.id),

Copilot uses AI. Check for mistakes.

const RootPage = () => {
return <RootRedirectHandler />;
redirect(ROUTES.LANDING);
Copy link

Copilot AI Aug 21, 2025

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);
};

Copilot uses AI. Check for mistakes.
* 리스트 컬럼명 부분
*/
const ListHeader = ({ fileType }: ListHeaderProps) => {
// TODO: 이건 뭐에요?
Copy link

Copilot AI Aug 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P4] 의미없는 TODO 주석을 제거하거나 더 구체적인 설명으로 개선해야 합니다.

Suggested change
// TODO: 이건 뭐에요?

Copilot uses AI. Check for mistakes.
placeholder={`옵션 ${optionList.indexOf(currentOption) + 1}`}
onChange={(e) => optionNameChange(e.target.value)}
// 설문을 생성하는 경우를 제외하고는 readOnly로 설정합니다.
readOnly={!isCreatingSurvey}
Copy link

Copilot AI Aug 21, 2025

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는 반대 조건을 사용합니다. 로직을 일치시켜야 합니다.

Copilot uses AI. Check for mistakes.
@kyeoungwoon kyeoungwoon changed the title [Refactor] Survey Question Zustand로 관리 & 페이지 내 디테일 수정 [Refactor] Survey Question Zustand로 관리 & 페이지 내 디테일 수정 & 이메일 전송 API 연결 Aug 21, 2025
@kyeoungwoon kyeoungwoon merged commit 3ca9938 into develop Aug 21, 2025
3 checks passed
@kyeoungwoon kyeoungwoon deleted the refactor/#326-question-refactors branch August 21, 2025 13:49
@github-actions
Copy link

✨ Vercel Preview Deployed

📦 PR #376 by @kyeoungwoon
🌿 [refactor/#326-question-refactors] → [develop]
📅 KST 2025-08-21 22:47:05

🔗 Links

✨ Preview 사이트 보러가기

💡 변경사항을 실제 환경에서 확인해보세요!


Powered by Vercel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment