-
Notifications
You must be signed in to change notification settings - Fork 29
refactor: 인터뷰 기능 개선 #1644
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
Merged
Merged
refactor: 인터뷰 기능 개선 #1644
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
cfb7f9c
feat(interview): update interview end condition
woowahan-neo 821a84c
Refactor: InterviewSession 및 Interviewer 상호작용 개선
woowahan-neo 28dea72
feat: 인터뷰 세션 UI 개선 및 답변 후 포커스 유지
woowahan-neo 5a6f075
fix(interview): 채팅 메시지 줄바꿈 유지 및 완료 조건 단순화
woowahan-neo cea9b53
refactor(interview): 초기 질문의 흐름을 벗어나지 않도록 프롬프트 개선
woowahan-neo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 10 additions & 1 deletion
11
backend/src/main/java/wooteco/prolog/interview/application/InterviewSessionResponse.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,21 @@ | ||
| package wooteco.prolog.interview.application; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| public record InterviewSessionResponse( | ||
| Long id, | ||
| Long memberId, | ||
| boolean finished, | ||
| List<InterviewMessageResponse> messages | ||
| List<InterviewMessageResponse> messages, | ||
| int currentRound | ||
| ) { | ||
| private static final int START_ROUND = 1; | ||
| private static final int MAX_ROUND = 10; | ||
|
|
||
| @JsonProperty("remainRound") | ||
| public int remainRound() { | ||
| return MAX_ROUND + START_ROUND - currentRound; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,7 @@ | |
| @Embeddable | ||
| public class InterviewMessages { | ||
|
|
||
| private static final int START_ROUND = 1; | ||
| private static final int MAX_ROUND = 10; | ||
|
|
||
| @ElementCollection | ||
|
|
@@ -39,7 +40,11 @@ public InterviewMessages with(final InterviewMessage message) { | |
| return new InterviewMessages(newValues); | ||
| } | ||
|
|
||
| public int getRound() { | ||
| public int getCurrentRound() { | ||
| return getIntervieweeMessageCount() + START_ROUND; | ||
| } | ||
|
|
||
| public int getIntervieweeMessageCount() { | ||
| return (int) values.stream() | ||
| .filter(InterviewMessage::isByInterviewee) | ||
| .count(); | ||
|
|
@@ -50,7 +55,12 @@ public List<InterviewMessage> values() { | |
| } | ||
|
|
||
| public boolean canFinish() { | ||
| return getRound() >= MAX_ROUND && !hasInterviewerClosingSummary(); | ||
| if (values.isEmpty()) { | ||
| return false; | ||
| } | ||
| return getCurrentRound() > MAX_ROUND && | ||
| lastMessage().isByInterviewer() && | ||
| !hasInterviewerClosingSummary(); | ||
|
Comment on lines
57
to
+63
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| } | ||
|
|
||
| private boolean hasInterviewerClosingSummary() { | ||
|
|
@@ -76,6 +86,10 @@ public InterviewMessage lastMessage() { | |
| return values.getLast(); | ||
| } | ||
|
|
||
| List<InterviewMessage> getMessages() { | ||
| return Collections.unmodifiableList(values); | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return "InterviewMessages{" + | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| /** @jsxImportSource @emotion/react */ | ||
|
|
||
| import React, { useState } from 'react'; | ||
| import React, {useState} from 'react'; | ||
| import styled from '@emotion/styled'; | ||
| import { MainContentStyle } from '../../PageRouter'; | ||
| import {MainContentStyle} from '../../PageRouter'; | ||
| import InterviewSetup from './InterviewSetup'; | ||
| import InterviewSession from './InterviewSession'; | ||
|
|
||
|
|
@@ -53,20 +53,41 @@ const SectionTitle = styled.h2` | |
| margin: 0; | ||
| `; | ||
|
|
||
| const RoundInfo = styled.span` | ||
| font-size: 1rem; | ||
| font-weight: 400; | ||
| color: #666; | ||
| margin-left: 1rem; | ||
| `; | ||
|
|
||
| const SectionContent = styled.div` | ||
| flex: 1; | ||
| min-height: 0; | ||
| padding: 2rem; | ||
| `; | ||
|
|
||
| interface InterviewSessionData { | ||
| id: number; | ||
| memberId: number; | ||
| finished: boolean; | ||
| messages: { | ||
| sender: 'SYSTEM' | 'INTERVIEWER' | 'INTERVIEWEE'; | ||
| content: string; | ||
| hint: string; | ||
| createdAt: string; | ||
| }[]; | ||
| currentRound: number; | ||
| remainRound: number; | ||
| } | ||
|
Comment on lines
+69
to
+81
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| const InterviewPage = () => { | ||
| const [session, setSession] = useState<any>(null); | ||
| const [session, setSession] = useState<InterviewSessionData | null>(null); | ||
|
|
||
| const handleSessionStart = (newSession: any) => { | ||
| const handleSessionStart = (newSession: InterviewSessionData) => { | ||
| setSession(newSession); | ||
| }; | ||
|
|
||
| const handleSessionUpdate = (updatedSession: any) => { | ||
| const handleSessionUpdate = (updatedSession: InterviewSessionData) => { | ||
| setSession(updatedSession); | ||
| }; | ||
|
|
||
|
|
@@ -91,7 +112,14 @@ const InterviewPage = () => { | |
| </SetupSection> | ||
| <SessionSection> | ||
| <SectionHeader> | ||
| <SectionTitle>레벨 인터뷰 진행</SectionTitle> | ||
| <SectionTitle> | ||
| 레벨 인터뷰 진행 | ||
| {session && | ||
| <RoundInfo> | ||
| 남은 인터뷰: {session.remainRound}회 | ||
| </RoundInfo> | ||
| } | ||
| </SectionTitle> | ||
| </SectionHeader> | ||
| <SectionContent> | ||
| <InterviewSession | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Consider defining
START_ROUNDas a constant in a single, shared location (e.g., a configuration class or interface) to avoid duplication and potential inconsistencies withInterviewSessionResponse.java.