Skip to content

tts修正 - #5312

Merged
TinyKitten merged 2 commits into
devfrom
fix/tts
Feb 17, 2026
Merged

TinyKitten merged 2 commits into
devfrom
fix/tts

Conversation

@TinyKitten

@TinyKitten TinyKitten commented Feb 17, 2026 •

Copy link
Copy Markdown
Member

Summary by CodeRabbit

リリースノート

  • 新機能

    • 自動モード対応の音声再生機能を追加しました。
  • 改善

    • 日本語音声完了後の英語再生タイミングを最適化し、より自然な再生順序を実現しました。
    • テキスト変更時の音声トリガー制御を強化し、安定性を向上させました。

@github-actions github-actions Bot added the react label Feb 17, 2026
@TinyKitten TinyKitten self-assigned this Feb 17, 2026
@coderabbitai

coderabbitai Bot commented Feb 17, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

useTTS.tsフックにおいて、英語再生の遅延制御と複数の抑制参照を導入し、自動モード中の初期化時とテキスト変更時の不正なトリガーを防止する機能を追加しました。

Changes

Cohort / File(s) Summary
TTS Playback制御の拡張
src/hooks/useTTS.ts
navigationStateから自動モードの状態を読み込み、英語再生に100msの遅延を追加。suppressInitialCheckDoneRef、suppressPostFirstSpeechRefなどの新規参照を導入し、初期化時と最初の音声再生後のテキスト変更トリガーを抑制。複数の早期復帰条件を追加して、自動モード時の不正な抑制解除を防止。

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

react

Poem

🐰 うさぎの耳で聞こえてくるね、
日本語が流れて、少し待ってね、
英語のメロディ、百ミリ秒の美学、
抑制フラグ踊る、音のハーモニー、
自動モードの優雅な舞踏!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive プルリクエストのタイトルが曖昧で具体性に欠けており、変更内容を明確に説明していません。 タイトルを「Delay English playback in useTTS hook with auto-mode support」など、具体的な変更内容を明確に示すものに変更してください。
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/hooks/useTTS.ts (1)

516-537: 抑制ロジックは正しく動作しますが、複雑さに注意。

条件分岐が多く複雑になっています。現状のコメントで意図は説明されていますが、将来のメンテナンスのため、以下のような状態遷移のパターンをドキュメント化することを検討してください:

  1. 行先選択時(停車中)→ 発車まで抑制
  2. オートモード初期化時 → 初回チェック完了まで抑制
  3. 初回放送後 → テキスト変化による再トリガー抑制
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/hooks/useTTS.ts` around lines 516 - 537, The suppression logic around
firstSpeechRef, suppressPostFirstSpeechRef,
suppressFirstSpeechUntilDepartureRef, and suppressInitialCheckDoneRef is correct
but hard to follow—extract and document the state transitions: "stopped→suppress
until departure", "auto-mode init→suppress until initial check done", "after
first speech→suppress post-first update". Refactor the block into a small helper
(e.g., ensureSuppressionState or computeSuppressionDecision) that encapsulates
the if-chain and add a concise doc comment or enum describing the three states
and transitions so future maintainers can read and test the behavior without
parsing the inline conditionals.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/hooks/useTTS.ts`:
- Around line 516-537: The suppression logic around firstSpeechRef,
suppressPostFirstSpeechRef, suppressFirstSpeechUntilDepartureRef, and
suppressInitialCheckDoneRef is correct but hard to follow—extract and document
the state transitions: "stopped→suppress until departure", "auto-mode
init→suppress until initial check done", "after first speech→suppress post-first
update". Refactor the block into a small helper (e.g., ensureSuppressionState or
computeSuppressionDecision) that encapsulates the if-chain and add a concise doc
comment or enum describing the three states and transitions so future
maintainers can read and test the behavior without parsing the inline
conditionals.

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