Skip to content

NowHeaderにバス停の場合「都営バス」バッジを表示 - #5762

Merged
TinyKitten merged 1 commit into
devfrom
feature/now-header-for-bus
Apr 4, 2026
Merged

TinyKitten merged 1 commit into
devfrom
feature/now-header-for-bus

Conversation

@TinyKitten

@TinyKitten TinyKitten commented Apr 4, 2026 •

Copy link
Copy Markdown
Member

Summary

  • バス停が表示されている場合、NowHeaderの駅名右側に「都営バス」(英語: "Toei Bus")のバッジを表示
  • Stacked layout(通常表示)とInline layout(スクロール後)の両方に対応
  • LEDテーマ対応の配色(都営バスのコーポレートグリーン系)

Test plan

  • バス停データが入った状態でNowHeaderに「都営バス」バッジが表示されること
  • スクロール後のInline layoutでもバッジが表示されること
  • 鉄道駅の場合はバッジが表示されないこと
  • LEDテーマでも視認性が確保されていること
  • 英語環境で "Toei Bus" と表示されること

🤖 Generated with Claude Code

Summary by CodeRabbit

リリースノート

  • 新機能
    • 駅情報ヘッダーに都営バスバッジを追加しました。都営バスの路線を利用する際、駅名の隣に「都営バス」が表示されるようになり、路線の種類をより簡単に識別できます。

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

coderabbitai Bot commented Apr 4, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

ヘッダーコンポーネントにバス路線検出機能を追加し、駅がバス路線の場合に「都営バス」バッジを表示するように拡張しました。対応する英語と日本語の翻訳キーを新規追加し、UIスタイリングを追加したものです。

Changes

Cohort / File(s) Summary
Translation Files
assets/translations/en.json, assets/translations/ja.json
Added new translation key toeiBusBadge with English value "Toei Bus" and Japanese value "都営バス".
Header Component
src/components/NowHeader.tsx
Added bus line detection via isBusLine() to compute isBus property. Introduced new React Native styles for bus badge display (busStationRow, busBadge, busBadgeText, busBadgeStyle). Conditionally renders toeiBusBadge next to station name when bus line is detected.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 バスの路線、新しく光る
都営バスのバッジがぴかり
翻訳も整い、デザインも整う
ウサギが祝う、新機能の輝き ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed プルリクエストのタイトルは、バス停の場合にNowHeaderに「都営バス」バッジを表示するという変更内容を明確かつ簡潔に表現しており、主要な変更を正確に要約しています。
Description check ✅ Passed プルリクエストの説明は、概要、変更内容、テスト計画を含み、テンプレートの主要なセクションをカバーしていますが、「変更の種類」セクションと「関連Issue」セクションが不足しています。
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 feature/now-header-for-bus

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

@TinyKitten TinyKitten self-assigned this Apr 4, 2026

@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

🤖 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/components/NowHeader.tsx`:
- Around line 136-137: The badge detection and label are inconsistent: update
the bus-detection logic used when computing { label, name, isBus } so it checks
station.line.company (e.g., replace or augment isBusLine(station.line) with a
check for company === Company.Toei or a new isToeiBusLine helper), change the
hardcoded translate('toeiBusBadge') to a generic translate('busBadge') (or
equivalent key) for the label, and add a short comment near the logic explaining
that the app currently only supports Toei buses and where to adjust the
detection/label when other companies are added; ensure references include
isBusLine, station.line.company, and
translate('toeiBusBadge')/translate('busBadge').
🪄 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: 21113f1a-4d45-4f79-b664-3f0d9c3064f9

📥 Commits

Reviewing files that changed from the base of the PR and between 52b3bc9 and 5b1327c.

📒 Files selected for processing (3)
  • assets/translations/en.json
  • assets/translations/ja.json
  • src/components/NowHeader.tsx

Comment thread src/components/NowHeader.tsx Resolved
@TinyKitten
TinyKitten merged commit 2295fbb into dev Apr 4, 2026
6 checks passed
@TinyKitten
TinyKitten deleted the feature/now-header-for-bus branch April 4, 2026 09:14
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