Skip to content

自動テーマが直通運転時に切り替わらない不具合を修正#5686

Merged
TinyKitten merged 2 commits intodevfrom
feature/fix-auto-theme-through-service
Mar 26, 2026
Merged

自動テーマが直通運転時に切り替わらない不具合を修正#5686
TinyKitten merged 2 commits intodevfrom
feature/fix-auto-theme-through-service

Conversation

@TinyKitten
Copy link
Copy Markdown
Member

@TinyKitten TinyKitten commented Mar 26, 2026

Summary

  • themeAtomlineState.selectedLineのみを参照していたため、直通運転で路線が切り替わってもテーマが変更されなかった
  • stationStateも購読し、useCurrentLineフックと同等のロジックで現在駅が実際に属する路線を算出してテーマを解決するように修正
  • 例: 東京メトロ副都心線→東急東横線の直通時、テーマがTOKYO_METRO→TYに自動切替される

Test plan

  • npm run typecheck — 型エラーなし
  • npm run lint — Biomeチェック通過
  • npm test — 143 suites / 1345 tests 全パス
  • AUTOテーマ設定で直通運転(副都心線→東横線等)時にテーマが自動切替されることを確認

🤖 Generated with Claude Code

Summary by CodeRabbit

  • 改善
    • テーマ自動選択を強化:現在地・駅情報と進行方向を組み合わせて適切な路線を判定し、テーマ表示をより正確に反映するようになりました。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the react label Mar 26, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 26, 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: 526109a9-7211-4b52-9298-90ddb58844d3

📥 Commits

Reviewing files that changed from the base of the PR and between c7dd9b6 and 8092c70.

📒 Files selected for processing (1)
  • src/store/atoms/theme.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/store/atoms/theme.ts

📝 Walkthrough

Walkthrough

themeAtom の AUTO ロジックが stationState を参照して現在駅を派生し、selectedDirection に基づく駅順序で currentLine を決定して resolveThemeForLine() を呼び出すようになりました。

Changes

Cohort / File(s) Summary
Theme Atom Logic
src/store/atoms/theme.ts
themePreferenceAtomAUTO の場合、stationState を追加で読み取り、stations と照合して currentStation を導出。selectedDirection に応じて駅リストを反転して actualCurrentStation を選び、そこから currentLine を算出して resolveThemeForLine(currentLine) を呼ぶように変更。

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 駅の並びで色が変わる
方向に合わせて道を選び、
線が囁けばテーマが答える。
小さな足で渡るコードの野原、
ぴょんと歓迎の春が来た。

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed PRのタイトルは直通運転時の自動テーマ切り替え不具合の修正という主な変更内容を明確に表現しており、変更内容に関連しています。
Description check ✅ Passed PR説明は「概要」セクションで変更内容を詳しく記述し、「Test plan」でテストの実施状況を記載しており、テンプレートのほぼすべての重要セクションを満たしています。
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/fix-auto-theme-through-service

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

@TinyKitten TinyKitten self-assigned this Mar 26, 2026
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 the current code and only fix it if needed.

Inline comments:
In `@src/store/atoms/theme.ts`:
- Around line 35-37: The comment says this should behave like useCurrentLine but
currentLine currently falls back to selectedLine when actualCurrentStation?.line
is missing; make the behavior consistent by changing currentLine logic in the
atoms/theme module to match useCurrentLine: if actualCurrentStation?.line cannot
be resolved, set currentLine to null instead of selectedLine (references:
currentLine, selectedLine, actualCurrentStation, useCurrentLine); alternatively,
if you prefer the current fallback behavior, update the comment to explicitly
state that currentLine falls back to selectedLine when actualCurrentStation is
unavailable.
🪄 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: 7d2dfff1-1228-40c4-9055-02148c8b5e58

📥 Commits

Reviewing files that changed from the base of the PR and between 8ed85fc and c7dd9b6.

📒 Files selected for processing (1)
  • src/store/atoms/theme.ts

Comment thread src/store/atoms/theme.ts Outdated
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@TinyKitten TinyKitten merged commit e2660a8 into dev Mar 26, 2026
6 checks passed
@TinyKitten TinyKitten deleted the feature/fix-auto-theme-through-service branch March 26, 2026 15:23
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