Skip to content

「まもなく」放送がたまに再生されないバグを修正#5341

Merged
TinyKitten merged 1 commit intodevfrom
fix/tts
Feb 19, 2026
Merged

「まもなく」放送がたまに再生されないバグを修正#5341
TinyKitten merged 1 commit intodevfrom
fix/tts

Conversation

@TinyKitten
Copy link
Member

@TinyKitten TinyKitten commented Feb 19, 2026

Summary by CodeRabbit

リリースノート

  • 改善
    • テキスト音声合成の音声抑制判定ロジックを改善し、状態変化への対応性を向上させました。

@TinyKitten TinyKitten self-assigned this Feb 19, 2026
@github-actions github-actions bot added the react label Feb 19, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 19, 2026

📝 Walkthrough

ウォークスルー

TTS フロー内に停止状態の変更を追跡し、その変更に基づいて音声抑制判定を制御する新機能を追加します。useTTS フック で停止状態の前後を比較し、stoppingStateChanged フラグを計算して、computeSuppressionDecision に渡すことで、停止状態の変化時に特定の抑制ロジックをバイパスします。

変更内容

コホート / ファイル(s) 概要
停止状態統合
src/hooks/useTTS.ts
useStoppingState をインポートし、現在の停止状態と前の停止状態を追跡します。stoppingStateChanged を計算して suppressPostFirstSpeech 抑制判定に組み込み、関連する useEffect の依存配列を更新します。また、テキスト変更時に pendingRef をリセットします。
抑制判定ロジック更新
src/utils/computeSuppressionDecision.ts
stoppingStateChanged パラメータを関数シグネチャに追加します。Post-first-speech 抑制パスで、suppressPostFirstSpeechRef が true の場合、stoppingStateChanged が false の時のみ true を返し、そうでない場合はフォールスルーします。
抑制判定テスト拡張
src/utils/computeSuppressionDecision.test.ts
stoppingStateChanged フラグを test パラメータに追加します。stoppingStateChanged が true の場合、suppressPostFirstSpeech 有効時でも抑制が発生しないことを検証する新しいテストケースを追加します。

推定コードレビュー工数

🎯 3 (中程度) | ⏱️ ~20 分

関連する可能性のあるプルリクエスト

推奨ラベル

react

うさぎからのお祝いの詩

🐰 停止の状態、変わりし時に
音声の流れを静かに止める
判定の道に新しき灯り
抑制が賢く、その時を知る
音声の舞が調和として奏でられん ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed タイトルは「まもなく」放送の再生バグ修正という実装内容と一致しており、変更の主要な目的を明確に要約しています。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/tts

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/utils/computeSuppressionDecision.test.ts (1)

1-23: ⚠️ Potential issue | 🟡 Minor

afterEach フックで jest.clearAllMocks() を追加してください。
コーディングガイドラインに従い、各テスト実行後にモックを明示的にクリアする必要があります。

追加例
 import { computeSuppressionDecision } from './computeSuppressionDecision';

+afterEach(() => {
+  jest.clearAllMocks();
+});
+
 const createParams = (
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/utils/computeSuppressionDecision.test.ts` around lines 1 - 23, Add an
afterEach hook in the test file to call jest.clearAllMocks() so mocks are reset
between tests; insert afterEach(() => jest.clearAllMocks()) near the top-level
(alongside the existing describe('computeSuppressionDecision', ...)) to ensure
any mocks used by tests of computeSuppressionDecision and helpers like
createParams are cleared after each test.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@src/utils/computeSuppressionDecision.test.ts`:
- Around line 1-23: Add an afterEach hook in the test file to call
jest.clearAllMocks() so mocks are reset between tests; insert afterEach(() =>
jest.clearAllMocks()) near the top-level (alongside the existing
describe('computeSuppressionDecision', ...)) to ensure any mocks used by tests
of computeSuppressionDecision and helpers like createParams are cleared after
each test.

@TinyKitten TinyKitten merged commit 388accb into dev Feb 19, 2026
6 of 7 checks passed
@TinyKitten TinyKitten deleted the fix/tts branch February 19, 2026 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant