From 2c5d98627fe96f337e5e7ac0b5abde8bb99a03b7 Mon Sep 17 00:00:00 2001 From: tegnike Date: Mon, 16 Dec 2024 18:52:50 +0100 Subject: [PATCH 1/3] =?UTF-8?q?=E3=82=B9=E3=83=9E=E3=83=9B=E7=89=88?= =?UTF-8?q?=E3=81=A7=E5=85=A5=E5=8A=9B=E3=83=95=E3=82=A9=E3=83=BC=E3=83=A0?= =?UTF-8?q?=E3=81=8C=E3=81=9A=E3=82=8C=E3=82=8B=E4=B8=8D=E5=85=B7=E5=90=88?= =?UTF-8?q?=E3=81=8C=E3=81=82=E3=81=A3=E3=81=9F=E3=81=AE=E3=81=A7=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/messageInput.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/components/messageInput.tsx b/src/components/messageInput.tsx index 96237c0d..606f1921 100644 --- a/src/components/messageInput.tsx +++ b/src/components/messageInput.tsx @@ -46,6 +46,8 @@ export const MessageInput = ({ } else { if (textareaRef.current) { textareaRef.current.value = '' + textareaRef.current.style.height = 'auto' + setRows(1) textareaRef.current.focus() } } @@ -80,6 +82,14 @@ export const MessageInput = ({ onClickMicButton(event) } + const handleSendClick = (event: React.MouseEvent) => { + onClickSendButton(event) + setRows(1) + if (textareaRef.current) { + textareaRef.current.style.height = 'auto' + } + } + return (
{showPermissionModal && ( @@ -130,7 +140,7 @@ export const MessageInput = ({ className="bg-secondary hover:bg-secondary-hover active:bg-secondary-press disabled:bg-secondary-disabled" isProcessing={chatProcessing} disabled={chatProcessing || !userMessage || realtimeAPIMode} - onClick={onClickSendButton} + onClick={handleSendClick} />
From 6111a37608429327c6940e555162d20987d90aa9 Mon Sep 17 00:00:00 2001 From: tegnike Date: Mon, 16 Dec 2024 21:44:57 +0100 Subject: [PATCH 2/3] =?UTF-8?q?=E3=81=AB=E3=81=98=E3=83=9C=E3=82=A4?= =?UTF-8?q?=E3=82=B9=E3=81=AE=E3=82=AD=E3=83=A3=E3=83=A9=E5=88=A5=E3=82=AA?= =?UTF-8?q?=E3=82=B9=E3=82=B9=E3=83=A1=E8=A9=B1=E9=80=9F=E3=82=92=E3=83=87?= =?UTF-8?q?=E3=83=95=E3=82=A9=E3=83=AB=E3=83=88=E3=81=A7=E8=A8=AD=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/settings/voice.tsx | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/components/settings/voice.tsx b/src/components/settings/voice.tsx index d3815662..167d10df 100644 --- a/src/components/settings/voice.tsx +++ b/src/components/settings/voice.tsx @@ -63,6 +63,7 @@ const Voice = () => { const { t } = useTranslation() const [nijivoiceSpeakers, setNijivoiceSpeakers] = useState>([]) + const [prevNijivoiceActorId, setPrevNijivoiceActorId] = useState('') // にじボイスの話者一覧を取得する関数 const fetchNijivoiceSpeakers = async () => { @@ -89,6 +90,30 @@ const Voice = () => { } }, [selectVoice, nijivoiceApiKey]) + // nijivoiceActorIdが変更された時にrecommendedVoiceSpeedを設定する処理を追加 + useEffect(() => { + if ( + selectVoice === 'nijivoice' && + nijivoiceActorId && + nijivoiceActorId !== prevNijivoiceActorId + ) { + // 現在選択されているキャラクターを探す + const selectedActor = nijivoiceSpeakers.find( + (actor) => actor.id === nijivoiceActorId + ) + + // キャラクターが見つかり、recommendedVoiceSpeedが設定されている場合 + if (selectedActor?.recommendedVoiceSpeed) { + settingsStore.setState({ + nijivoiceSpeed: selectedActor.recommendedVoiceSpeed, + }) + } + + // 前回の選択を更新 + setPrevNijivoiceActorId(nijivoiceActorId) + } + }, [nijivoiceActorId, nijivoiceSpeakers, prevNijivoiceActorId, selectVoice]) + // 追加: realtimeAPIMode または audioMode が true の場合にメッセージを表示 if (realtimeAPIMode || audioMode) { return ( From b5fec7c4b89523fd89ba1a5556b2cc90f518cdc6 Mon Sep 17 00:00:00 2001 From: tegnike Date: Mon, 16 Dec 2024 23:56:09 +0100 Subject: [PATCH 3/3] =?UTF-8?q?=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7?= =?UTF-8?q?=E3=83=B3=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/settings/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/settings/index.tsx b/src/components/settings/index.tsx index 1a9f9db6..d250580b 100644 --- a/src/components/settings/index.tsx +++ b/src/components/settings/index.tsx @@ -126,7 +126,7 @@ const Main = () => { const Footer = () => { return ( ) }