Skip to content

都営プレフィックスを東京都交通局に変更してnameShortと整合性を取る - #5821

Merged
TinyKitten merged 4 commits into
devfrom
claude/update-transit-prefix-DfVwx
Apr 14, 2026
Merged

TinyKitten merged 4 commits into
devfrom
claude/update-transit-prefix-DfVwx

Conversation

@TinyKitten

@TinyKitten TinyKitten commented Apr 14, 2026 •

Copy link
Copy Markdown
Member

Summary by CodeRabbit

リリースノート

  • バグ修正

    • 東京都交通局の正式な社名表記に合わせてテーマ判定ルールを更新し、該当路線で正しいTOEIテーマが適用されるようにしました。
  • テスト

    • 判定ロジックに対応するテストと固定データを社名表記の変更に合わせて更新し、期待するテーマ適用を継続的に検証します。

@github-actions github-actions Bot added the react label Apr 14, 2026
@coderabbitai

coderabbitai Bot commented Apr 14, 2026 •

Copy link
Copy Markdown
Contributor

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: a1f9b92e-9aee-4452-ad56-0f82526a837c

📥 Commits

Reviewing files that changed from the base of the PR and between e972919 and 58c6e3b.

📒 Files selected for processing (1)
  • src/utils/__fixtures__/search.ts
✅ Files skipped from review due to trivial changes (1)
  • src/utils/fixtures/search.ts

📝 Walkthrough

Walkthrough

TOEI の会社名接頭辞マッピングを 都営 から 東京都交通局 に変更し、関連するテストと fixtures(src/__fixtures__/line.ts、src/__fixtures__/station.ts、src/utils/__fixtures__/search.ts)の company.nameShort を新しい社名に合わせて更新しました。期待結果のテーマは変わりません。

Changes

Cohort / File(s) Summary
テーマ解決ロジック
src/utils/resolveThemeForLine.ts
COMPANY_PREFIX_TO_THEME の TOEI エントリで会社名接頭辞を 都営 から 東京都交通局 に変更。その他のマッピングとフォールバックは不変。
テスト
src/utils/resolveThemeForLine.test.ts
TOEI 関連のテストケースでモック会社名を 都営/都営地下鉄 から 東京都交通局/東京都交通局地下鉄 に変更。期待されるテーマは APP_THEME.TOEI のまま。
フィクスチャ
src/__fixtures__/line.ts, src/__fixtures__/station.ts, src/utils/__fixtures__/search.ts
TOEI_SHINJUKU_LINE_LOCAL と複数の station/search fixtures の company.nameShort を 都営 / 都営地下鉄 から 東京都交通局 / 東京都交通局地下鉄 に更新。データ構造や他フィールドは変更なし。

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰🚇 名前伸びても路線はそのまま
都の名呼べばテーマは跳ねるよ
テストもフィクスチャも一緒にぴょん
小さな差分で世界は整い
にんじん抱えて今日も祝うよ

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning プルリクエストの説明が提供されておらず、リポジトリの必須テンプレートの構成やセクションを満たしていません。 プルリクエストの説明を追加し、概要、変更の種類、変更内容、テストの実施状況などのテンプレートセクションを記入してください。
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed プルリクエストのタイトルは、変更内容を正確に反映しており、都営プレフィックスを東京都交通局に変更する主要な変更を明確に要約しています。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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 claude/update-transit-prefix-DfVwx

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/utils/resolveThemeForLine.test.ts (1)

80-84: TOEIテストケースが実データ形を再現できていません。

Line 83 は nameShort='東京都交通局' 固定のため、nameShort='都営' の実データ形での回帰を拾えません。nameShort: '都営'(必要なら nameFull: '東京都交通局' も)を含むケースを追加してください。

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/utils/resolveThemeForLine.test.ts` around lines 80 - 84, The TOEI unit
test for resolveThemeForLine uses makeCompany with nameShort='東京都交通局' which
doesn't match real data; update or add the test case that builds the Line with
makeCompany including nameShort: '都営' (and optionally nameFull: '東京都交通局') so
resolveThemeForLine is exercised with the actual data shape; modify the existing
test invocation that calls makeLine({ id: 99301, company: makeCompany('東京都交通局')
}) to use makeCompany({ nameShort: '都営', nameFull: '東京都交通局' }) or add a new
it(...) case asserting the same expected result.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/utils/resolveThemeForLine.ts`:
- Line 20: resolveThemeForLine.ts のテーマ判定で '東京都交通局'
だけをキーにしているため、line.company?.nameShort が '都営' のデータ(例: line id 99301)が一致せず TOEI
判定が漏れています。APP_THEME.TOEI のエントリ(現在の '東京都交通局')に '都営' を併記するか、または
resolveThemeForLine の判定ロジック(関数名や該当ループ)で line.company?.nameFull や
line.company?.name も検査対象に追加して、nameShort が '都営' のケースも TOEI と判定されるようにしてください。

---

Nitpick comments:
In `@src/utils/resolveThemeForLine.test.ts`:
- Around line 80-84: The TOEI unit test for resolveThemeForLine uses makeCompany
with nameShort='東京都交通局' which doesn't match real data; update or add the test
case that builds the Line with makeCompany including nameShort: '都営' (and
optionally nameFull: '東京都交通局') so resolveThemeForLine is exercised with the
actual data shape; modify the existing test invocation that calls makeLine({ id:
99301, company: makeCompany('東京都交通局') }) to use makeCompany({ nameShort: '都営',
nameFull: '東京都交通局' }) or add a new it(...) case asserting the same expected
result.
🪄 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: 0e23e104-1715-4808-a48e-186030c61812

📥 Commits

Reviewing files that changed from the base of the PR and between edc2b49 and 4195920.

📒 Files selected for processing (2)
  • src/utils/resolveThemeForLine.test.ts
  • src/utils/resolveThemeForLine.ts

Comment thread src/utils/resolveThemeForLine.ts Resolved
@TinyKitten
TinyKitten merged commit 5b8f992 into dev Apr 14, 2026
5 checks passed
@TinyKitten
TinyKitten deleted the claude/update-transit-prefix-DfVwx branch April 14, 2026 01:36
@TinyKitten TinyKitten mentioned this pull request Apr 17, 2026
6 of 9 tasks
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.

2 participants