Conversation
- InterviewSession.answer(): - 인터뷰이 메시지 생성 책임을 Interviewer 구현체로 이전. - AI 응답 후 업데이트된 전체 대화 기록으로 종료 조건 확인. - AzureOpenAiInterviewer.followUp(): - 인터뷰이 메시지 추가 후 AI 호출 전 불필요한 canFinish() 검사 제거. - AI 후속 질문 요청 로직 일관성 확보. - 누락된 checkFollowUpQuestion 메소드 복원.
- 인터뷰 종료 시 마지막 피드백 메시지 스타일 변경 시도 (진단용 스타일 적용 상태) - 답변 제출 후 입력창에 포커스 유지 기능 추가
- Shift+Enter로 입력된 여러 줄의 메시지가 올바르게 표시되도록 white-space 속성 수정 - 인터뷰 종료 여부 확인 로직 간소화
There was a problem hiding this comment.
Hello @jaeyeonling, 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!
Summary of Changes
This pull request focuses on improving the interview session functionality, covering both backend and frontend enhancements. The primary goals are to refine interview round tracking, improve session state management, and enhance UI feedback for a better user experience and system stability. Key changes include adding round tracking to the backend, improving the interview end condition logic, adding transaction management, displaying the remaining rounds in the UI, and emphasizing the last message upon interview completion. Additionally, there are updates to the frontend to improve type safety and input focus handling, as well as new tests to validate the round calculations and end conditions.
Highlights
- Backend: Interview Round Tracking and State Management: The
InterviewSessionResponsenow includescurrentRoundandremainRoundfields for tracking interview progress. ThecanFinishmethod has been updated to provide clearer termination criteria. - Backend: Transaction Management: The
createSessionmethod inInterviewServiceis now transactional to ensure that session creation errors are properly rolled back. - Frontend: UI Improvements: The interview header now displays the number of remaining rounds, and an
EmphasizedFeedbackMessagecomponent highlights the final message upon interview completion. - Frontend: Type Safety and State Management: An
InterviewSessionDatainterface has been introduced to enhance type safety in theInterviewPageandInterviewSessioncomponents. - Frontend: Input Focus Handling: The input field now automatically focuses after submitting an answer, as long as the interview hasn't ended.
- Tests: Added tests to
InterviewMessagesTestto verify round calculations, empty message handling, and interview termination conditions.
Changelog
Click here to see the changelog
- backend/src/main/java/wooteco/prolog/interview/application/InterviewService.java
- Added
@Transactionalannotation tocreateSessionmethod to ensure rollback on errors (line 37).
- Added
- backend/src/main/java/wooteco/prolog/interview/application/InterviewSessionMapper.java
- Added
interviewSession.getRound()to themapToResponsemethod (line 28).
- Added
- backend/src/main/java/wooteco/prolog/interview/application/InterviewSessionResponse.java
- Added
currentRoundfield to the record (line 12). - Added
remainRoundproperty to calculate remaining rounds (line 18).
- Added
- backend/src/main/java/wooteco/prolog/interview/domain/InterviewMessage.java
- Added
getOriginalContentmethod to retrieve the original message content (line 144).
- Added
- backend/src/main/java/wooteco/prolog/interview/domain/InterviewMessages.java
- Added
START_ROUNDconstant (line 19). - Renamed
getRoundtogetCurrentRoundand updated logic to reflect the starting round offset (line 43). - Modified
canFinishmethod to include checks for empty messages and interviewer closing summary (line 57). - Added
getMessagesmethod to return an unmodifiable list of messages (line 89).
- Added
- backend/src/main/java/wooteco/prolog/interview/domain/InterviewSession.java
- Modified
answermethod to handle empty messages and ensure it's the interviewer's turn (line 60). - Added
getRoundmethod to return the current round (line 88).
- Modified
- backend/src/main/java/wooteco/prolog/interview/infrastructure/AzureOpenAiInterviewer.java
- Updated
followUpmethod to usegetCurrentRoundand ensure the interview is not over (line 123). - Updated
finishmethod to usegetCurrentRoundto check if the interview is not finished (line 167).
- Updated
- backend/src/test/java/wooteco/prolog/interview/domain/InterviewMessagesTest.java
- Added tests for round calculation, empty message handling, and interview termination conditions (lines 51-102).
- frontend/src/pages/InterviewPage/InterviewPage.tsx
- Added
RoundInfocomponent to display remaining rounds (line 118). - Defined
InterviewSessionDatainterface for type safety (lines 69-81). - Updated
handleSessionStartandhandleSessionUpdateto use the newInterviewSessionDatatype (lines 86, 90).
- Added
- frontend/src/pages/InterviewPage/InterviewSession.tsx
- Added
EmphasizedFeedbackMessagecomponent to highlight the last message on interview completion (line 36). - Defined
InterviewSessionDatainterface for type safety (lines 164-176). - Updated
InterviewSessionPropsto use the newInterviewSessionDatatype (line 179). - Added logic to focus the input field after submitting an answer if the interview is not finished (line 239).
- Added
Using Gemini Code Assist
The 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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and 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 to provide feedback.
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.
A session's state,
With rounds to track and show,
UX made better.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Code Review
This pull request introduces several improvements to the interview session feature, including better round tracking, refined session state handling, and enhanced UI feedback. The changes aim to improve user experience and system stability. Overall, the changes look good, but there are a few areas that could be improved.
Summary of Findings
- Inconsistent use of
START_ROUNDconstant: TheSTART_ROUNDconstant is defined in bothInterviewSessionResponseandInterviewMessages. It should be defined in a single place to avoid inconsistency. - Clarity of
canFinishmethod: ThecanFinishmethod inInterviewMessagescould be more readable by extracting the conditions into separate, well-named methods. - Duplicated Interface: The
InterviewSessionDatainterface is defined in bothInterviewPage.tsxandInterviewSession.tsx. It should be defined in a single place and imported where needed.
Merge Readiness
The pull request is almost ready to be merged. However, there are a few issues that should be addressed before merging, particularly the inconsistent use of the START_ROUND constant and the duplicated interface. Addressing these issues will improve the code's maintainability and reduce the risk of errors. I am unable to approve this pull request, and recommend that others review and approve this code before merging.
| private static final int START_ROUND = 1; | ||
| private static final int MAX_ROUND = 10; |
| public boolean canFinish() { | ||
| return getRound() >= MAX_ROUND && !hasInterviewerClosingSummary(); | ||
| if (values.isEmpty()) { | ||
| return false; | ||
| } | ||
| return getCurrentRound() > MAX_ROUND && | ||
| lastMessage().isByInterviewer() && | ||
| !hasInterviewerClosingSummary(); |
| interface InterviewSessionData { | ||
| id: number; | ||
| memberId: number; | ||
| finished: boolean; | ||
| messages: { | ||
| sender: 'SYSTEM' | 'INTERVIEWER' | 'INTERVIEWEE'; | ||
| content: string; | ||
| hint: string; | ||
| createdAt: string; | ||
| }[]; | ||
| currentRound: number; | ||
| remainRound: number; | ||
| } |
| interface InterviewSessionData { | ||
| id: number; | ||
| memberId: number; | ||
| finished: boolean; | ||
| messages: { | ||
| sender: 'SYSTEM' | 'INTERVIEWER' | 'INTERVIEWEE'; | ||
| content: string; | ||
| hint: string; | ||
| createdAt: string; | ||
| }[]; | ||
| currentRound: number; | ||
| remainRound: number; | ||
| } |
이 Pull Request는 인터뷰 세션 기능에 대한 여러 개선 사항과 버그 수정을 포함합니다. 주요 변경 사항은 인터뷰 라운드 추적 개선, 세션 상태 처리 정교화, 인터뷰 진행 상황에 대한 UI 피드백 강화 등이며, 사용자 경험 향상과 시스템 안정성 확보를 목표로 합니다.
백엔드 변경 사항
인터뷰 라운드 추적 및 상태 관리:
InterviewSessionResponse에currentRound및remainRound필드를 추가하여 현재 인터뷰 라운드 및 남은 라운드를 추적합니다.remainRound는 동적으로 계산됩니다. ([1], [2], [3])InterviewMessages에서getRound를getCurrentRound로 이름을 변경하고, 시작 라운드 오프셋을 반영하는 로직으로 수정했습니다. ([1], [2])canFinish메서드를 수정하여, 빈 메시지 존재 여부나 인터뷰어의 종료 멘트 여부 등을 포함해 보다 명확한 종료 기준을 적용했습니다. (backend/src/main/java/wooteco/prolog/interview/domain/InterviewMessages.javaL53-R63)트랜잭션 관리:
InterviewService의createSession메서드에@Transactional어노테이션을 추가했습니다. (backend/src/main/java/wooteco/prolog/interview/application/InterviewService.javaR37)새로운 메서드 및 리팩터링:
getOriginalContent메서드를InterviewMessage에 추가했습니다. (backend/src/main/java/wooteco/prolog/interview/domain/InterviewMessage.javaR144-R147)getMessages메서드를InterviewMessages에 추가했습니다. (backend/src/main/java/wooteco/prolog/interview/domain/InterviewMessages.javaR89-R92)프론트엔드 변경 사항
UI 개선:
remainRound)를 표시하여 사용자에게 인터뷰 진행 상황을 명확하게 제공합니다. (frontend/src/pages/InterviewPage/InterviewPage.tsxL94-R122)EmphasizedFeedbackMessage컴포넌트를 추가했습니다. (frontend/src/pages/InterviewPage/InterviewSession.tsxR259-R271)타입 안정성과 상태 관리:
InterviewSessionData인터페이스를 새로 정의하여 타입 안정성을 강화하고, 이를InterviewPage및InterviewSession의 상태 관리에 적용했습니다. ([1], [2])입력 포커스 처리:
테스트 업데이트
InterviewMessagesTest에 테스트 케이스를 추가하여 라운드 계산, 빈 메시지 처리, 인터뷰 종료 조건 등을 검증했습니다. (backend/src/test/java/wooteco/prolog/interview/domain/InterviewMessagesTest.javaL44-R102)