From 531e7c435e0edf6a3819b14a9ed5c016c401d7e4 Mon Sep 17 00:00:00 2001 From: Woody Date: Mon, 18 May 2026 15:38:48 +0800 Subject: [PATCH] fix: enable half-question and final-submit buttons during interim ASR text Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- frontend/src/components/QueryInput.tsx | 2 +- .../src/test/test_phase2_QueryInput_integration.test.tsx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/QueryInput.tsx b/frontend/src/components/QueryInput.tsx index b26ebf0..c8d770c 100644 --- a/frontend/src/components/QueryInput.tsx +++ b/frontend/src/components/QueryInput.tsx @@ -49,7 +49,7 @@ export const QueryInput: React.FC = ({ onSubmit, onHalfQuestion } } - const isDisabled = isLoading || displayValue.trim() === '' || (!hasUserInput && !!partialText) + const isDisabled = isLoading || displayValue.trim() === '' const textareaClassName = [ 'w-full rounded border border-gray-300 px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent disabled:bg-gray-100 disabled:cursor-not-allowed', diff --git a/frontend/src/test/test_phase2_QueryInput_integration.test.tsx b/frontend/src/test/test_phase2_QueryInput_integration.test.tsx index 185f4c9..3f1f84c 100644 --- a/frontend/src/test/test_phase2_QueryInput_integration.test.tsx +++ b/frontend/src/test/test_phase2_QueryInput_integration.test.tsx @@ -151,9 +151,9 @@ describe('QueryInput with partialText (Phase 2.4)', () => { const textarea = screen.getByPlaceholderText('Ask a question about your documents...') const button = screen.getByRole('button', { name: /submit/i }) - // partialText is shown but user hasn't typed, button should be disabled - // (partial text is not a real user input — it's just display) - expect(button).toBeDisabled() + // partialText is shown and user hasn't typed — button should be enabled + // (users can now submit during interim ASR text) + expect(button).toBeEnabled() }) it('test_user_can_submit_after_typing_over_partialText', () => {