Repository navigation
プリセットの始発駅解決を駅一覧の並び順に依存しないよう修正 - #6602
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QXtc54wueuBNTReyz1mnh2
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthrough始発駅の解決処理を Changesプリセット始発駅解決
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
This was referenced Aug 10, 2026
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.
概要
ホーム画面のプリセットウィジェットで、始発駅と行き先が同じ駅として表示される不具合(例: 「小田原 ↓ 小田原」、実際は「前橋 → 小田原」)を修正します。
プリセットの端点は保存済みの
directionを「駅一覧のどちら側の終端から乗るか」として解釈していますが、駅一覧の取得クエリが保存時と表示時で異なり、並びが揃わないことがあります。useLineSelection)lineGroupStations/lineStations(単一取得)usePresetCarouselData)lineGroupListStations/lineListStations(一括取得)一括取得側で並びが反転して返ると
directionの指す終端が行き先そのものになり、from === toになります。保存UI(SelectBoundModalのpresetDirectionOptions)は始発駅と行き先が同じ選択肢を明示的に除外しているため、この状態は並び順の食い違いでしか発生しません。変更の種類
変更内容
src/utils/presetRouteEndpoints.tsにgetPresetOriginStationを新設し、directionから求めた終端が行き先と一致する場合は反対側の終端へ倒すようにした。終端の集合自体は並び順に依存しないため、行き先が終端駅のケースは並びが反転していても始発駅を正しく復元できるgetPresetRouteEndpointsの始発駅解決をgetPresetOriginStation経由に変更(ホーム画面ウィジェットとアプリ内プリセットカードの双方に反映される)src/hooks/usePresetStops.tsのpresetOriginも共通化した。未修正だと同じプリセットをタップした際にpresetStopsが1駅に潰れて乗車導線側も壊れるためpresetRouteEndpoints.test.ts/usePresetStops.test.ts/usePresetsWidgetSync.test.tsxに追加既知の制限
行き先が途中駅で並びが反転しているケースは、どちらの終端が始発かを判定する材料が保存データに無いため、反対側の終端が表示され得ます。根本解決には
SavedRouteに始発駅のgroupIdを持たせるか、一覧側も保存時と同じクエリを使う必要があり、本PRのスコープ外としています。回帰リスクと緩和策
getPresetRouteEndpoints/usePresetStops.presetOrigin)。directionの指す終端が行き先と重ならない従来ケースの挙動は変わらないwantedDestinationIdがnull)のプリセットは従来どおりdirectionの指す終端をそのまま返す。既存テストで担保済みusePresetStopsの変更はSelectBoundModalの方面カード表示・区間切り出しに関わるため、既存のusePresetStops.test.ts/SelectBoundModal.render.test.tsxの通過を確認済みPresetsWidget.swift/ AndroidPresetsWidgetProvider.kt)は変更していないため、ウィジェットの描画・リロード経路への影響はないテスト
ローカルで以下を実行し、すべて成功することを確認しました。
npm run lintが通ることnpm testが通ることnpm run typecheckが通ること関連Issue
スクリーンショット(任意)
Generated by Claude Code
Summary by CodeRabbit