Repository navigation
TTSの言語切り替え - #5289
Merged
Merged
TTSの言語切り替え#5289
Conversation
Contributor
📝 WalkthroughWalkthroughTTSの有効言語(JA/EN)を永続化・復元する機能を追加し、設定画面での言語トグルとそれに基づく再生フロー(日本語/英語の分岐と個別タイムアウト・リスナー管理)を実装・テストしました。 Changes
Sequence Diagram(s)sequenceDiagram
participant UI as TTSSettings画面
participant Permitted as Permitted
participant Storage as AsyncStorage
participant State as Speech State
participant TTS as useTTSフック
participant Player as AudioPlayer
rect rgba(120,200,160,0.5)
Note over Permitted,State: 起動時の復元
Permitted->>Storage: GET TTS_ENABLED_LANGUAGES
Storage-->>Permitted: JSON配列 (例: ["JA","EN"])
Permitted->>State: set ttsEnabledLanguages
end
rect rgba(160,180,220,0.5)
Note over UI,Storage: ユーザーが言語を切替
UI->>State: update ttsEnabledLanguages
UI->>Storage: SET TTS_ENABLED_LANGUAGES (JSON)
Storage-->>UI: 保存完了
end
rect rgba(200,160,120,0.5)
Note over TTS,Player: 再生フロー(条件分岐)
TTS->>State: read ttsEnabledLanguages
State-->>TTS: ['JA'] または ['EN'] または ['JA','EN']
alt 英語のみ
TTS->>Player: create English player & play
Player-->>TTS: didJustFinish
else 日本語のみまたは両方
TTS->>Player: create Japanese player & play
Player-->>TTS: didJustFinish
opt 英語有効かつ必要
TTS->>Player: create English player & play
Player-->>TTS: didJustFinish
end
end
TTS->>TTS: finishPlaying / cleanup
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Comment |
Contributor
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/hooks/useTTS.test.ts`:
- Around line 105-108: The afterEach in useTTS.test.ts currently only calls
jest.runOnlyPendingTimers() and jest.useRealTimers(), but it must also clear
mocks to avoid cross-test leakage; update the afterEach block in the test file
(the afterEach that calls jest.runOnlyPendingTimers and jest.useRealTimers) to
also call jest.clearAllMocks() so all jest.mocked network/Firebase layers are
reset between tests.
Merged
This was referenced Feb 19, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#4446
Summary by CodeRabbit