Skip to content

JR九州テーマTTSに終着放送追加 - #4410

Merged
TinyKitten merged 1 commit into
devfrom
feature/jrkyushu-tts-final-stop
Jul 22, 2025
Merged

TinyKitten merged 1 commit into
devfrom
feature/jrkyushu-tts-final-stop

Conversation

@TinyKitten

@TinyKitten TinyKitten commented Jul 22, 2025 •

Copy link
Copy Markdown
Member

#4365

Summary by CodeRabbit

  • 新機能
    • JR九州テーマのTTS案内において、次駅で乗換路線があり、特定条件を満たす場合に「ご乗車ありがとうございました」などの感謝メッセージが日本語・英語で追加表示されるようになりました。
    • 乗換路線名の表示が改行区切りで統一され、見やすくなりました。

@TinyKitten TinyKitten self-assigned this Jul 22, 2025
@coderabbitai

coderabbitai Bot commented Jul 22, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

余の命により、「useTTSText」なる鉤関数において、JR九州テーマの「ARRIVING」TTS文言に条件付きの感謝表現を加えた。乗換線が存在し、かつ特定条件を満たす場合、路線名と共に感謝の辞が日本語・英語双方に付加される。その他の制御流は一切変わらぬ。

Changes

ファイル 変更概要
src/hooks/useTTSText.ts JR_KYUSHUテーマの「ARRIVING」TTS文言に条件付き感謝表現を追加。乗換線名の連結方法を明示的な改行に変更。

Sequence Diagram(s)

sequenceDiagram
    participant 利用者
    participant useTTSText
    利用者->>useTTSText: TTS文言生成要求(ARRIVING, JR_KYUSHUテーマ)
    useTTSText->>useTTSText: 乗換線情報・groupId等を判定
    alt 乗換線あり & 条件一致
        useTTSText->>useTTSText: 路線名+感謝文言を付加
    else
        useTTSText->>useTTSText: 既存文言を生成
    end
    useTTSText-->>利用者: 生成済みTTS文言返却
Loading

Estimated code review effort

2 (~15分)

Possibly related PRs

Suggested labels

react

Poem

九州の列車、感謝を添えて、
路線名響く、転換のとき、
余の命により、言葉新たに、
ありがとうの声、駅に満ちたり。
🚋✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2d11621 and 8f75e5b.

📒 Files selected for processing (1)
  • src/hooks/useTTSText.ts (2 hunks)
🧠 Learnings (2)
📓 Common learnings
Learnt from: TinyKitten
PR: TrainLCD/MobileApp#4249
File: __tests__/hooks/useTelemetrySender.enabled.test.tsx:54-68
Timestamp: 2025-05-07T23:04:31.413Z
Learning: TinyKitten is working on implementing a queue for movement logs in the TrainLCD mobile app, but realized the implementation differed from their original intention.
src/hooks/useTTSText.ts (3)

Learnt from: TinyKitten
PR: #4286
File: src/components/HeaderLED.tsx:5-10
Timestamp: 2025-05-19T10:59:37.813Z
Learning: The hooks useCurrentStation, useNextStation, useIsNextLastStop, and useNumbering are properly exported in src/hooks/index.ts, allowing them to be imported from '../hooks' in src/components/HeaderLED.tsx as implemented in PR #4286.

Learnt from: TinyKitten
PR: #4396
File: src/components/TrainTypeBoxJRKyushu.tsx:176-183
Timestamp: 2025-07-18T11:04:45.459Z
Learning: TrainTypeBoxJRKyushuコンポーネントでは、trainTypeNameとprevTrainTypeNameは常に文字列となるため、.split()メソッドを使用する際のnull安全性チェックは不要である。これらの変数はuseMemoとuseLazyPreviousを通じて管理され、translate()関数からのフォールバック値により常に文字列が保証される。

Learnt from: TinyKitten
PR: TrainLCD/MobileApp#0
File: :0-0
Timestamp: 2024-12-18T00:29:05.817Z
Learning: 翻訳ファイル(assets/translations/en.json と assets/translations/ja.json)の変更を要約する際、backgroundPermissionDenied のようなキーが追加されているのか削除されているのかを正確に確認する。

🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: TinyKitten
PR: TrainLCD/MobileApp#4249
File: __tests__/hooks/useTelemetrySender.enabled.test.tsx:54-68
Timestamp: 2025-05-07T23:04:31.413Z
Learning: TinyKitten is working on implementing a queue for movement logs in the TrainLCD mobile app, but realized the implementation differed from their original intention.
src/hooks/useTTSText.ts (3)

Learnt from: TinyKitten
PR: #4286
File: src/components/HeaderLED.tsx:5-10
Timestamp: 2025-05-19T10:59:37.813Z
Learning: The hooks useCurrentStation, useNextStation, useIsNextLastStop, and useNumbering are properly exported in src/hooks/index.ts, allowing them to be imported from '../hooks' in src/components/HeaderLED.tsx as implemented in PR #4286.

Learnt from: TinyKitten
PR: #4396
File: src/components/TrainTypeBoxJRKyushu.tsx:176-183
Timestamp: 2025-07-18T11:04:45.459Z
Learning: TrainTypeBoxJRKyushuコンポーネントでは、trainTypeNameとprevTrainTypeNameは常に文字列となるため、.split()メソッドを使用する際のnull安全性チェックは不要である。これらの変数はuseMemoとuseLazyPreviousを通じて管理され、translate()関数からのフォールバック値により常に文字列が保証される。

Learnt from: TinyKitten
PR: TrainLCD/MobileApp#0
File: :0-0
Timestamp: 2024-12-18T00:29:05.817Z
Learning: 翻訳ファイル(assets/translations/en.json と assets/translations/ja.json)の変更を要約する際、backgroundPermissionDenied のようなキーが追加されているのか削除されているのかを正確に確認する。

🔇 Additional comments (2)
src/hooks/useTTSText.ts (2)

731-733: 朕、この終着駅における感謝の辞の実装を嘉す!

JR九州テーマの到着放送において、終着駅の条件判定と感謝表現の追加が適切に実装されておる。nextStation?.groupId === selectedBound?.groupId && !isLoopLineの条件により、環状線以外の終着駅でのみ感謝メッセージが流れる仕組みは誠に合理的である。


1092-1094: 英語版の実装も朕の眼鏡に適う!

日本語版と同様の条件判定により、英語の終着駅感謝放送が適切に実装されている。両言語で一貫した論理構造を保持しており、多言語対応のTTSシステムとして秀逸である。Thank you for using the ${currentLine.nameShort}.の表現も自然で適切だ。

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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