diff --git a/src/components/ContentGenerator/QuestionAnswerChat.tsx b/src/components/ContentGenerator/QuestionAnswerChat.tsx index f9c07b77d..a0d7addf1 100644 --- a/src/components/ContentGenerator/QuestionAnswerChat.tsx +++ b/src/components/ContentGenerator/QuestionAnswerChat.tsx @@ -7,6 +7,7 @@ import { import type { AllowedFormat } from './ContentGenerator'; import { Loader2Icon, + PartyPopper, RefreshCcwIcon, RotateCwIcon, SendIcon, @@ -56,6 +57,7 @@ export function QuestionAnswerChat(props: QuestionAnswerChatProps) { const [status, setStatus] = useState<'answering' | 'done'>('answering'); const scrollAreaRef = useRef(null); + const inputRef = useRef(null); const { data: aiQuestionSuggestions, @@ -108,6 +110,9 @@ export function QuestionAnswerChat(props: QuestionAnswerChatProps) { flushSync(() => { setActiveMessageIndex(activeMessageIndex + 1); setStatus('answering'); + + // focus the input + inputRef.current?.focus(); }); scrollToBottom(); @@ -226,6 +231,7 @@ export function QuestionAnswerChat(props: QuestionAnswerChatProps) {
setMessage(e.target.value)} className="w-full bg-transparent text-sm focus:outline-none" @@ -248,26 +254,27 @@ export function QuestionAnswerChat(props: QuestionAnswerChatProps) {
+ + {canGenerateNow && ( +
+

+ + Answer a few more questions for better output or{' '} + +

+
+ )} )} )} - - {canGenerateNow && status !== 'done' && activeMessage && ( -
-

- Keep answering for better output or{' '} - -

-
- )} ); } @@ -303,7 +310,7 @@ function QuestionAnswerChatMessage(props: QuestionAnswerChatMessageProps) {