Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Summary of ChangesHello @g-hyxn, 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은 사용자 프로필 및 회원가입 시 선택할 수 있는 전공/관심사 카테고리를 확장하고 관련 매핑을 업데이트하는 것을 목표로 합니다. 이를 통해 사용자에게 더 다양한 선택지를 제공하고, 데이터 일관성을 개선합니다. 또한, 기존 카테고리 ID의 오타를 수정하여 정확성을 높였습니다. Highlights
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
카테고리(전공) 관련 타입을 확장하고, GAME_DEVELOPMENT를 GAME_DEVELOP으로 수정하여 데이터 불일치를 해결한 점이 좋습니다. 리뷰에서는 코드의 유지보수성을 높이기 위해 여러 파일에 흩어져 있는 카테고리 데이터를 한 곳에서 중앙 관리하는 리팩토링 방안을 제안했습니다. 이를 통해 향후 카테고리 추가 및 수정 작업이 훨씬 간편해지고 데이터 정합성을 보장하는 데 도움이 될 것입니다. 자세한 내용은 개별 코멘트를 참고해주세요.
| major: | ||
| | 'FRONTEND' | ||
| | 'BACKEND' | ||
| | 'ANDROID' | ||
| | 'IOS' | ||
| | 'MOBILE_ROBOTICS' | ||
| | 'DESIGN' | ||
| | 'DEVOPS' | ||
| | 'AI' | ||
| | 'IT_NETWORK' | ||
| | 'FLUTTER' | ||
| | 'CYBER_SECURITY' | ||
| | 'GAME_DEVELOP' | ||
| | 'CLOUD_COMPUTING'; | ||
| } | ||
|
|
||
| const majorToInterestMap: Record<string, string> = { | ||
| FRONTEND: 'FE', | ||
| BACKEND: 'BE', | ||
| ANDROID: 'AOS', | ||
| ANDROID: 'Android', | ||
| IOS: 'iOS', | ||
| MOBILE_ROBOTICS: 'Mobile Robotics', | ||
| DESIGN: 'Design', | ||
| DEVOPS: 'DevOps', | ||
| AI: 'AI', | ||
| IT_NETWORK: 'IT Network', | ||
| FLUTTER: 'Flutter', | ||
| CYBER_SECURITY: 'Cyber Security', | ||
| GAME_DEVELOP: 'Game Development', | ||
| CLOUD_COMPUTING: 'Cloud Computing', | ||
| }; |
There was a problem hiding this comment.
안녕하세요! 카테고리 관련 데이터가 여러 파일에 중복으로 정의되어 있어 유지보수성을 개선할 점이 보입니다.
현재 카테고리(전공) 데이터는 다음과 같이 여러 곳에 흩어져 있습니다:
MyPage.tsx:MemberProfile인터페이스의major타입MyPage.tsx:majorToInterestMap객체SignupPage.tsx:interestList배열src/assets/shared/ListData.tsx:interestList배열
이로 인해 새로운 카테고리를 추가하거나 수정할 때 여러 파일을 변경해야 하며, 이번 PR에서 GAME_DEVELOPMENT를 GAME_DEVELOP으로 수정하신 것처럼 불일치가 발생할 수 있습니다.
개선 제안:
src/assets/shared/ListData.tsx와 같은 공통 파일에 카테고리 데이터를 중앙에서 관리하는 것을 제안합니다. 예를 들어, 다음과 같은 구조를 사용할 수 있습니다.
// src/assets/shared/ListData.tsx (예시)
export const CATEGORIES = [
{ key: 'FRONTEND', label: 'FE' },
{ key: 'BACKEND', label: 'BE' },
{ key: 'ANDROID', label: 'Android' },
// ... 나머지 카테고리
] as const;
// 카테고리 키를 기반으로 Major 타입 생성
export type Major = typeof CATEGORIES[number]['key'];
// MyPage에서 사용할 Map과 List
export const majorToInterestMap: Record<Major, string> = Object.fromEntries(
CATEGORIES.map(c => [c.key, c.label])
);
export const interestListForMyPage = CATEGORIES.map(c => ({ id: c.label, label: c.label }));
// SignupPage에서 사용할 List
export const interestListForSignup = CATEGORIES.map(c => ({ id: c.key, label: c.label }));이렇게 하면,
CATEGORIES배열만 수정하면 모든 관련 타입과 데이터가 자동으로 업데이트됩니다.MyPage.tsx와SignupPage.tsx에서는 이 중앙 데이터를 가져와 사용하면 되므로 코드 중복이 사라지고 일관성이 유지됩니다.major타입도import하여 사용할 수 있습니다.
이 리팩토링을 통해 앞으로 카테고리 관리가 훨씬 쉬워질 것입니다. 검토 부탁드립니다!
💡 배경 및 개요
Resolves: #{이슈번호}
📃 작업내용
🙋♂️ 리뷰노트
✅ PR 체크리스트
.env,노션,README)"API 개발 완료됐어요","환경값 추가되었어요")🎸 기타