Skip to content

バス路線で列車種別を系統と言い換え長い系統名のtitle表示を改善#5995

Merged
TinyKitten merged 3 commits into
devfrom
feature/bus-route-labels
May 14, 2026
Merged

バス路線で列車種別を系統と言い換え長い系統名のtitle表示を改善#5995
TinyKitten merged 3 commits into
devfrom
feature/bus-route-labels

Conversation

@TinyKitten
Copy link
Copy Markdown
Member

@TinyKitten TinyKitten commented May 14, 2026

概要

バス路線(都営バス等)の UI 表記から鉄道前提の語を取り除き、長い系統名でも読みやすく表示できるように調整。

変更の種類

  • バグ修正
  • 新機能
  • リファクタリング
  • ドキュメント
  • CI/CD
  • その他

変更内容

  • バス路線では trainType / trainTypesNotExist / settingsAndTrainType の表記を新キー busRoute / busRoutesNotExist / settingsAndBusRoute(日本語: 「系統」、英語: Route)に切り替え。
  • SelectBoundSettingListModalisBus プロップを追加し、SelectBoundModal から isBusLine(line) の結果を伝搬。
  • CommonCard の title を、バス路線時のみ最大 3 行まで許容(従来 2 行)。
  • CommonCardisBus && title が指定されたとき、系統名末尾の「行」を「方面」と同様に小フォント(titleAffix)で描画。カッコで分割した各セグメントの末尾を判定するため、「池袋駅東口行(新宿伊勢丹前経由・循環)」のように後続にカッコが続くケースにも対応。

テスト

  • npm run lint が通ること
  • npm test が通ること
  • npm run typecheck が通ること

関連Issue

スクリーンショット(任意)

Summary by CodeRabbit

  • 新機能

    • 設定画面で電車とバスの表示ラベルを区別するよう更新
    • バス系統名の表示をより細かく分割・表示し、行数制限を緩和
  • ローカライズ

    • 英語・日本語にバス関連表示キー(系統、設定・系統、系統なし)を追加

Review Change Stack

@TinyKitten TinyKitten self-assigned this May 14, 2026
@github-actions github-actions Bot added the react label May 14, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 14, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3295fa80-f0cd-42b2-bf2e-7744d2e3b560

📥 Commits

Reviewing files that changed from the base of the PR and between 043d71b and 586ce05.

📒 Files selected for processing (1)
  • src/components/SelectBoundSettingListModal.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/SelectBoundSettingListModal.tsx

📝 Walkthrough

Walkthrough

バス路線用の翻訳キーを追加し、選択画面で isBus による表示分岐を導入。CommonCard のタイトル分割/描画ロジックを拡張して、バス系統名末尾の語(「行」等)を分割し複数の Typography 要素で表示するよう変更した。

Changes

バス路線の多言語対応と選択画面の条件分岐

Layer / File(s) Summary
翻訳キー追加
assets/translations/en.json, assets/translations/ja.json
英語・日本語の翻訳ファイルに settingsAndBusRoutebusRoutebusRoutesNotExist の3キーを追加。
選択画面でのバス路線条件分岐
src/components/SelectBoundModal.tsx, src/components/SelectBoundSettingListModal.tsx
SelectBoundModal のボタンラベル分岐に settingsAndBusRoute を追加し、SelectBoundSettingListModalPropsisBus?: boolean を追加して isBus に基づき表示ラベル(busRoute / busRoutesNotExist など)とフォールバック文言を切替える。
バス系統タイトルの描画ロジック拡張
src/components/CommonCard.tsx
タイトル分割処理を拡張し、titlePartskindparens/main/affix)を持たせることで、バス系統名の末尾語を mainaffix に分離して個別に titleAffix 等で描画。numberOfLines をバス時に 2→3 に変更し、hideParens の扱いを新しい分割形式に合わせて修正。

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • TrainLCD/MobileApp#5992: CommonCard.tsx のバス系統タイトル描画(Typography の行数設定や長い系統名対応)に関する変更で類似のロジック改修があるため関連性が高い。

Poem

🐰 バスの名をそっと分けて
行の末を丁寧に抱きしめる
翻訳も増えて声が揃い
モーダルは道を示すボタンに
タイトルは三行で、景色を描く

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed PRタイトルは、バス路線での表記改善と長い系統名のtitle表示改善という主要な変更内容を的確に反映しており、具体的かつ明確である。
Description check ✅ Passed PR説明は必須セクション(概要・変更の種類・変更内容・テスト)を完全に満たしており、テストチェックボックスもすべてチェックされている。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/bus-route-labels

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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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.

Inline comments:
In `@src/components/SelectBoundSettingListModal.tsx`:
- Around line 225-233: The fallback text for the unselected option incorrectly
always uses the train default; in SelectBoundSettingListModal where
translate(...) is called with the default label (currently using
trainTypeDefault), branch on the isBus prop and use the bus fallback key when
isBus is true (e.g., use 'busRouteDefault' or the existing bus fallback key)
instead of the train key; update the same logic for the other occurrence
mentioned (lines ~252-255) so both the label and the default fallback use the
bus keys when isBus is true.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cf1a62a6-5dc5-4bad-b7e8-f959bd0d179f

📥 Commits

Reviewing files that changed from the base of the PR and between a918439 and 043d71b.

📒 Files selected for processing (5)
  • assets/translations/en.json
  • assets/translations/ja.json
  • src/components/CommonCard.tsx
  • src/components/SelectBoundModal.tsx
  • src/components/SelectBoundSettingListModal.tsx

Comment thread src/components/SelectBoundSettingListModal.tsx
@TinyKitten
Copy link
Copy Markdown
Member Author

Fixes Applied Successfully

Fixed 1 file based on 1 CodeRabbit feedback item.

Files modified:

  • src/components/SelectBoundSettingListModal.tsx

Commit: 586ce05a6

バス文脈で trainTypeName が空のときのフォールバックを trainTypeDefault(「普通/各駅停車」/「Local」)から notSpecified(「指定なし」/「Not specified」)に分岐。busRoute は左ラベルと重複するため採用せず、独立判断で notSpecified を採用しました。

The latest autofix changes are on the feature/bus-route-labels branch.

@TinyKitten TinyKitten merged commit 0a9d98e into dev May 14, 2026
6 checks passed
@TinyKitten TinyKitten deleted the feature/bus-route-labels branch May 14, 2026 23:34
This was referenced May 15, 2026
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