Repository navigation
バスTTS実装を鉄道TTS実装に統合し共通テンプレートで音声を生成 - #5997
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
💤 Files with no reviewable changes (2)
📝 WalkthroughWalkthroughuseBusTTSText フックを廃止し、バス/鉄道の TTS テキスト生成機能を統合された useTTSText フックへ統合。新しい isBus パラメータと拡張テンプレートフラグ(hasTrainType、shouldAnnounceAfterNextStop、announceVehicleSummary)により、複数テーマのテンプレートを vehicleJa/vehicleEn を軸に再構成。 ChangesバスTTS機能の統合
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Comment |
概要
バスTTS実装を鉄道TTS実装と共通化した理由は、柔軟性と保守コストの削減です。また、バスTTSでは文言がテーマで変わっていなかったのですが、この修正でテーマによって違う音声を楽しめることになります。保守性としては鉄道のTTSの文言を最低差分でバスにも対応できるというところです。
変更の種類
変更内容
useTTSTextに第3引数isBusを追加し、useTTS.tsからtransportType === Bus判定で 1 回だけ呼ぶように整理templates.tsに乗物名 ({vehicleJa}/{vehicleEn}/{vehicleEnPlural})・停車場名 ({placeEn}でstation/stopを切替)・「Thank you for using the …」用{currentLineThanksEn}を導入し、列車種別関連は{#if hasTrainType}でゲート{vehicleJa}は…ゆきですブロックはannounceVehicleSummaryで挙動を分岐(鉄道は常時、バスは初回放送のみ — TOEIバスTTSで「このバスは〜ゆきです」が毎回再生される不具合を修正 #5996 と同じ意図を維持)useBusTTSText.ts/busTemplates.ts) を削除、テストファイルはuseTTSText.bus.test.tsxにリネームしuseTTSText(_, _, true)経由で同等のカバレッジを維持テスト
npm run lintが通ることnpm testが通ることnpm run typecheckが通ること関連Issue
スクリーンショット(任意)
Summary by CodeRabbit
リリースノート
改善
リファクタリング