From 3d4ab6607629c1f2644dff892faeab32c1d54c7f Mon Sep 17 00:00:00 2001 From: Justin Yoo Date: Wed, 30 Jul 2025 23:30:42 +0900 Subject: [PATCH 1/2] =?UTF-8?q?.NET=20Aspire=20=EB=B2=84=EC=A0=84=20?= =?UTF-8?q?=EC=97=85=EA=B7=B8=EB=A0=88=EC=9D=B4=EB=93=9C=20=F0=9F=91=89=20?= =?UTF-8?q?9.4.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InterviewAssistant.AppHost.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/InterviewAssistant.AppHost/InterviewAssistant.AppHost.csproj b/src/InterviewAssistant.AppHost/InterviewAssistant.AppHost.csproj index af47e8b..fb6d720 100644 --- a/src/InterviewAssistant.AppHost/InterviewAssistant.AppHost.csproj +++ b/src/InterviewAssistant.AppHost/InterviewAssistant.AppHost.csproj @@ -1,6 +1,6 @@ - + Exe From 431a5594843feca759ec3a0ecc8eba5fe6c5586e Mon Sep 17 00:00:00 2001 From: gitjiho Date: Sun, 17 Aug 2025 23:51:39 +0900 Subject: [PATCH 2/2] =?UTF-8?q?Fix:=20window.isSend=20JavaScript=20?= =?UTF-8?q?=ED=94=8C=EB=9E=98=EA=B7=B8=EC=99=80=20Home.razor=20=EC=BB=B4?= =?UTF-8?q?=ED=8F=AC=EB=84=8C=ED=8A=B8=EC=9D=98=20C#=20isSend=20=ED=94=8C?= =?UTF-8?q?=EB=9E=98=EA=B7=B8=EA=B0=80=20=EB=8F=99=EA=B8=B0=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/Pages/Home.razor | 7 ++++--- .../wwwroot/js/chatFunctions.js | 4 ++++ .../Components/Pages/HomeTests.cs | 12 ++++++++++++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/InterviewAssistant.Web/Components/Pages/Home.razor b/src/InterviewAssistant.Web/Components/Pages/Home.razor index 3f6b540..bc8e139 100644 --- a/src/InterviewAssistant.Web/Components/Pages/Home.razor +++ b/src/InterviewAssistant.Web/Components/Pages/Home.razor @@ -160,7 +160,7 @@ StateHasChanged(); var assistantMessage = new ChatMessage - { + { Role = MessageRoleType.Assistant, Message = string.Empty }; @@ -207,7 +207,8 @@ // 키 입력 처리 (엔터키로 메시지 전송) private async Task HandleKeyDown(KeyboardEventArgs e) { - if (e.Repeat || isSend) return; + var isSendJs = await JSRuntime.InvokeAsync("isMessageSendInProgress"); + if (e.Repeat || isSend || isSendJs) return; isSend = true; @@ -273,7 +274,7 @@ bool first = true; await foreach (var response in responses) - { + { if (first) { isLoading = false; diff --git a/src/InterviewAssistant.Web/wwwroot/js/chatFunctions.js b/src/InterviewAssistant.Web/wwwroot/js/chatFunctions.js index 653c880..c44d6fe 100644 --- a/src/InterviewAssistant.Web/wwwroot/js/chatFunctions.js +++ b/src/InterviewAssistant.Web/wwwroot/js/chatFunctions.js @@ -102,4 +102,8 @@ window.resetTextAreaHeight = function (elementId) { textarea.style.height = ""; textarea.style.overflowY = "hidden"; } +}; + +window.isMessageSendInProgress = function () { + return window.isSend || false; }; \ No newline at end of file diff --git a/test/InterviewAssistant.AppHost.Tests/Components/Pages/HomeTests.cs b/test/InterviewAssistant.AppHost.Tests/Components/Pages/HomeTests.cs index fcc799c..09493de 100644 --- a/test/InterviewAssistant.AppHost.Tests/Components/Pages/HomeTests.cs +++ b/test/InterviewAssistant.AppHost.Tests/Components/Pages/HomeTests.cs @@ -363,6 +363,18 @@ public async Task Home_HandleKeyDown_PreventsDuplicateWithIsSendFlag() Timeout = 5000 }); + // 초기 AI 응답 및 UI 준비 대기 + await Page.WaitForSelectorAsync(".welcome-message", new PageWaitForSelectorOptions + { + State = WaitForSelectorState.Detached, + Timeout = 15000 + }); + await Page.WaitForSelectorAsync(".response-status", new PageWaitForSelectorOptions + { + State = WaitForSelectorState.Detached, + Timeout = 40000 + }); + var textarea = Page.Locator("textarea#messageInput"); // 초기 메시지 개수 확인