小田急テーマのTypeChangeNotify対応と直通運転時の路線名表示バグ修正#5706
Merged
TinyKitten merged 2 commits intodevfrom Mar 28, 2026
Merged
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
📝 Walkthrough概要TypeChangeNotify コンポーネントに ODAKYU テーマのサポートを追加し、テーマに応じた UI レンダリングと線情報の計算ロジックを実装しました。対応するテストケースも追加されています。 変更内容
シーケンスダイアグラムsequenceDiagram
participant Component as TypeChangeNotify
participant Atoms as Jotai<br/>(Theme/Station)
participant Logic as displayCurrentLine<br/>計算
participant Bars as BarsComponent<br/>(SAIKYO/JO/East/Odakyu)
Component->>Atoms: theme, currentLine, nextLineを取得
Component->>Atoms: stations を取得
Component->>Logic: 現在行・次行以外の線を抽出
Logic-->>Component: displayCurrentLine(中間線)
alt displayCurrentLine が存在する場合
Component->>Bars: displayCurrentLine を props に渡す
Bars-->>Component: テーマに応じたUIをレンダリング
else displayCurrentLine がない場合
Component-->>Component: null を返す
end
推定コードレビュー工数🎯 3 (中程度) | ⏱️ ~25 分 詩
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Contributor
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/components/TypeChangeNotify.tsx (1)
423-436: グラデーション関数がdefaultBarGradient/defaultBoxGradientと同一です。現状は動作に問題ありませんが、将来的に Odakyu 固有のグラデーションが不要であれば、既存の
defaultBarGradient/defaultBoxGradientを再利用できます。🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/components/TypeChangeNotify.tsx` around lines 423 - 436, The odakyuBarGradient and odakyuBoxGradient currently duplicate defaultBarGradient/defaultBoxGradient; replace their definitions to reuse defaultBarGradient and defaultBoxGradient respectively (remove the duplicate string-template implementations) and keep ODAKYU_HIGHLIGHT_OFFSET and odakyuTerminalWidth/BarTerminalOdakyu logic unchanged; update any references to odakyuBarGradient/odakyuBoxGradient to point to the reused default functions to avoid redundant code.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/components/TypeChangeNotify.tsx`:
- Around line 423-436: The odakyuBarGradient and odakyuBoxGradient currently
duplicate defaultBarGradient/defaultBoxGradient; replace their definitions to
reuse defaultBarGradient and defaultBoxGradient respectively (remove the
duplicate string-template implementations) and keep ODAKYU_HIGHLIGHT_OFFSET and
odakyuTerminalWidth/BarTerminalOdakyu logic unchanged; update any references to
odakyuBarGradient/odakyuBoxGradient to point to the reused default functions to
avoid redundant code.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 3929585e-5351-4665-97a2-55f453d7d9cb
📒 Files selected for processing (2)
src/components/TypeChangeNotify.test.tsxsrc/components/TypeChangeNotify.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
station.lines(複数形)から中間路線を特定するロジックを追加バグの原因
useCurrentLine()は直通運転時に全区間で選択路線を返すstation.line(単数)も同様に選択路線が設定されるdropEitherJunctionStationにより接続駅の前路線側データが除去されるstation.lines(複数形)には実際の所属路線が含まれるため、ここからnextLineでもcurrentLineでもない路線を探索することで正しい中間路線名を取得Test plan
npm run typecheckパスnpx biome check ./srcパスnpm test -- src/components/TypeChangeNotify.test.tsx6/6パス🤖 Generated with Claude Code