Repository navigation
useTTSText の英語アナウンスで transferLines 末尾ピリオドの単複不整合を修正 - #5919
Merged
Merged
Conversation
Contributor
📝 WalkthroughWalkthrough英語TTS出力の乗り換え路線リスト末尾ピリオド付与ルールをテーマ・件数間で統一するため、hasMultipleTransferLinesコンテキストフラグを削除し、3つのテンプレートを簡略化してテスト カバレッジを追加。 Changes単数乗り換え路線ピリオド統一
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 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)
Comment |
Contributor
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/hooks/useTTSText.test.tsx (1)
552-552: ⚡ Quick winテスト名を期待値に合わせると誤読を防げます。
Line 552 の名前は「without trailing period」ですが、期待値は
...Shinjuku-sanchome.で末尾ピリオドありです。名称だけ合わせると意図が伝わりやすくなります。差分案
- test('JR_KYUSHU NEXT renders list inline without trailing period for length=1', () => { + test('JR_KYUSHU NEXT renders list inline with trailing period for length=1', () => {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/hooks/useTTSText.test.tsx` at line 552, Rename the test titled "JR_KYUSHU NEXT renders list inline without trailing period for length=1" to reflect the expected output that includes a trailing period (e.g., mention "with trailing period"), so the test name matches the expectation checked in the assertion; locate the test declaration in useTTSText.test.tsx (the test(...) call with that exact title) and update its string to clearly state the presence of the trailing period.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/hooks/useTTSText.test.tsx`:
- Line 552: Rename the test titled "JR_KYUSHU NEXT renders list inline without
trailing period for length=1" to reflect the expected output that includes a
trailing period (e.g., mention "with trailing period"), so the test name matches
the expectation checked in the assertion; locate the test declaration in
useTTSText.test.tsx (the test(...) call with that exact title) and update its
string to clearly state the presence of the trailing period.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d6349006-e10d-41cc-9e85-c402ad159b6e
📒 Files selected for processing (4)
src/hooks/tts/formatters.tssrc/hooks/tts/templates.tssrc/hooks/useTTSText.test.tsxsrc/hooks/useTTSText.ts
💤 Files with no reviewable changes (2)
- src/hooks/tts/formatters.ts
- src/hooks/useTTSText.ts
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.
概要
useTTSTextの英語テンプレートで、乗り換え路線リスト (transferLines) 末尾ピリオドの付与ルールがテーマごと・件数ごとに揃っていなかった (#5914) ので length=1 でも末尾.を付けて複数件と整合させた。あわせて JR_KYUSHU ARRIVING では文中ピリオド (Marunouchi Line. at Shinjuku-sanchome.) を廃止し、Marunouchi Line at Shinjuku-sanchome.に統一した (英語としてatの前にピリオドは不要なため)。変更の種類
変更内容
src/hooks/tts/templates.ts:YAMANOTE_EN.NEXT/SAIKYO_EN.NEXT:{#if hasMultipleTransferLines}.{/if}を素のピリオドに置換。length=1 でも末尾.が付くようになり、複数件と整合。JR_KYUSHU_EN.ARRIVING:transferLinesEnList直後のピリオド分岐を完全に削除。length>=2 で起きていた... Line. at Shinjuku-sanchome.のような文中ピリオドを解消し、単複ともに... Line at Shinjuku-sanchome.に統一。src/hooks/tts/formatters.ts:formatLinesListEnのコメントから「単数のときだけピリオドを落とす挙動 (※既知の不整合 useTTSText: 英語アナウンスの transferLines 末尾ピリオドが単複で不統一 #5914)」の記述を削除。src/hooks/useTTSText.ts: テンプレート側で使われなくなったhasMultipleTransferLinescontext キーを削除。src/hooks/useTTSText.test.tsx: length=1 transferLines で各テーマ (TOKYO_METRO / TY / YAMANOTE / SAIKYO / JR_WEST / TOEI / JR_KYUSHU) の NEXT/ARRIVING を検証する describe ブロック (14 件) を追加。次駅 (Shinjuku-sanchome) のlinesから東京メトロ副都心線を除外してtransferLinesを 1 件に絞り、英語 SSML の末尾ピリオドを検証。テスト
npm run lintが通ることnpm testが通ることnpm run typecheckが通ることローカル実行ログ:
npx cross-env TZ=UTC jest: 152 suites / 1488 tests pass (新規 14 件含む)npm run typecheck: passnpm run lint: pass (Windows ローカルでは既存 CRLF/LF 警告 20 件あり。base ブランチと同数で、本 PR の変更とは無関係)関連Issue
Closes #5914
スクリーンショット(任意)
Summary by CodeRabbit
リリースノート