Conversation
…atPage.tsx에서 메시지 길이 제한 추가, MentoringPage.tsx에서 멤버 정보 가져오기 로직 개선
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Summary of ChangesHello @koreahghg, 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은 API 연결 설정, 실시간 채팅 기능, 그리고 멘토링 페이지의 데이터 로딩 방식에 대한 여러 개선 사항을 포함합니다. 특히, 개발 환경에서의 API 엔드포인트 유연성을 높이고, WebSocket 연결의 안정성을 강화하며, 사용자 경험을 위한 채팅 메시지 유효성 검사를 추가하고, 멘토링 목록 조회 로직을 최적화하여 사용자 맞춤형 정보를 제공하려는 목적을 가집니다. 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
이 PR은 멘토링 기능과 웹소켓 연결 안정성을 개선하는 여러 수정 사항을 포함하고 있습니다. axios.ts에서 baseURL 설정을 환경 변수로 오버라이드할 수 있도록 변경하여 개발 편의성을 높였고, useStomp.ts에서는 웹소켓 URL 생성 로직과 Stomp 클라이언트 연동 방식을 개선하여 연결 안정성을 크게 향상시켰습니다. 또한 ChatPage.tsx에 메시지 길이 제한을 추가하고, MentoringPage.tsx에서는 사용자 기수에 맞는 멘토 목록을 불러오도록 데이터 페칭 로직을 변경하여 사용자 경험을 개선했습니다. 전반적으로 코드 품질과 안정성을 높이는 좋은 변경이며, 코드 가독성 및 유지보수성 향상을 위한 몇 가지 제안을 드립니다.
| if (message.length > 250) { | ||
| toast.error( | ||
| `메시지는 250자 이하로 작성해주세요. (현재 ${message.length}자)` | ||
| ); | ||
| return; |
There was a problem hiding this comment.
메시지 최대 길이를 나타내는 숫자 250이 코드에 직접 사용되었습니다 (매직 넘버). 이 값을 상수로 정의하면 코드의 가독성과 유지보수성을 높일 수 있습니다. 예를 들어, 나중에 최대 길이를 변경해야 할 때 한 곳만 수정하면 됩니다. 이 상수는 handleSendMessage 함수 외부(예: 파일 최상단)에 선언하는 것이 더 좋습니다.
| if (message.length > 250) { | |
| toast.error( | |
| `메시지는 250자 이하로 작성해주세요. (현재 ${message.length}자)` | |
| ); | |
| return; | |
| const MAX_MESSAGE_LENGTH = 250; | |
| if (message.length > MAX_MESSAGE_LENGTH) { | |
| toast.error( | |
| `메시지는 ${MAX_MESSAGE_LENGTH}자 이하로 작성해주세요. (현재 ${message.length}자)` | |
| ); | |
| return; | |
| } |
| setCurrentMemberId(null); | ||
| } | ||
|
|
||
| const mentorParams: any = { page: 0, size: 100 }; |
There was a problem hiding this comment.
mentorParams에 any 타입을 사용하고 있습니다. 이는 타입 안정성을 저해할 수 있습니다. API 파라미터에 대한 명확한 타입을 명시하면 실수를 방지하고 코드의 명확성을 높일 수 있습니다. 파일 상단에 별도의 interface를 정의하여 사용하는 것을 더 권장합니다.
| const mentorParams: any = { page: 0, size: 100 }; | |
| const mentorParams: { page: number; size: number; generation?: number } = { page: 0, size: 100 }; |
…서 MentorParams 타입 추가
💡 배경 및 개요
Resolves: #{이슈번호}
📃 작업내용
🙋♂️ 리뷰노트
✅ PR 체크리스트
.env,노션,README)"API 개발 완료됐어요","환경값 추가되었어요")🎸 기타