Repository navigation
gpx:replayで終点の座標から行先を引いて表示し、引けなければ再生を始めないようにした - #7190
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (3)
Included review availability: This review used your included allowance. 1 included review remains after this review. Your included PR review attempts over the past 7 days set your current allowance at 3 reviews per hour. 📝 WalkthroughWalkthroughAndroidのGPX再生スクリプトに、再生開始前に終点座標でStationAPIへ問い合わせる処理を追加しました。取得した駅名を開始時と進捗に表示します。駅を取得できない場合は、テストプロバイダの設定前に終了します。 ChangesGPX再生の行先駅表示
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant ReplayScript
participant StationAPI
participant adb
ReplayScript->>StationAPI: GPX終点座標でstationsNearbyを問い合わせる
StationAPI-->>ReplayScript: 最寄り駅の情報を返す
ReplayScript->>adb: 行先駅の取得後にsetupを実行する
Merge Risk: ⚪ Minimal · up to No actionable issue was identified that would prevent merging. The deployed staging API was not independently verified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
うさぎは地図をくるりと広げ Comment |
概要
npm run gpx:replayの再生中に、列車がどの駅へ向かっているのかが分かりませんでした。再生を始める前に GPX の終点の座標で StationAPI に 1 回だけ問い合わせ、いちばん近い駅を行先として表示するようにしました。行先を引けなかったときは、再生を始めずに異常終了します。変更の種類
変更内容
scripts/replay-location-gpx.mjsstationsNearby(limit: 1)を呼び、行先を決めます。https://gql-stg.trainlcd.app/です。環境変数GQL_API_URLがあればそちらを使います。行先: 京王八王子と表示し、進捗行にも[812/2484] 京王八王子行 +811s …のように載せます。行先を取得できませんでした: <理由>を出して終了コード 1 で止まります。通信の失敗、5 秒のタイムアウト、HTTP エラー、GraphQL のエラー、駅が見つからない場合です。scripts/replay-location-gpx.test.mjs(新規): adb と StationAPI を偽物に差し替えて、次の 2 点を確かめるテストです。docs/location-simulation.md: Android で再生する節に、上の動作の説明を追記しました。GPX ファイルと生成スクリプト(
gpx:generate)は変更していません。テスト
npm run lintが通ることnpm testが通ることnpm run typecheckが通ること省略: アプリのコード(
src/など)は変更していません。npm run lintは実行して通りました。ただし対象はsrcだけです。npm run test:scripts: 111 件すべて成功しました。GQL_API_URL=http://127.0.0.1:1/)を指定しました。行先を取得できませんでした: fetch failedと出て終了コード 1 で止まりました。このときandroid:mock_locationはdefaultのままで、テストプロバイダも作られていませんでした。関連Issue
スクリーンショット(任意)
UI変更なし: 開発用スクリプトと docs だけの変更で、アプリの画面には影響しません。
🤖 Generated with Claude Code
Summary by CodeRabbit