Repository navigation
ロック画面コントロールを長押ししてもアプリが開かない問題を修正 - #6572
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Ez1jjea88ehoXQa6yKYh3x
Contributor
📝 WalkthroughWalkthrough
ChangesOpenTrainLCDIntent の共有化
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant LockScreenControl
participant OpenTrainLCDIntent
participant iOS
LockScreenControl->>OpenTrainLCDIntent: Intentを参照
iOS->>OpenTrainLCDIntent: perform()を実行
OpenTrainLCDIntent-->>iOS: 空のIntentResultを返す
iOS->>iOS: openAppWhenRunによりアプリを開く
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Contributor
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@ios/RideSessionActivity/OpenTrainLCDIntent.swift`:
- Around line 18-20: Update the deep-link handling in OpenTrainLCDIntent so
OpenURLIntent receives an https Universal Link instead of the trainlcd:// or
trainlcd-canary:// custom schemes. Preserve distinct Canary and production
routing, using the configured Associated Domains/AASA Universal Links or another
supported launch path that reliably starts both variants from LockScreenControl.
- Line 27: OpenTrainLCDIntent の共有定義から openAppWhenRun = true を削除し、代わりに
supportedModes で必要なフォアグラウンド遷移を指定してください。アプリ本体と RideSessionActivity
拡張の双方で利用できる設定にし、iOS 18 実機でロック画面および Control Center 操作時の動作を確認してください。
🪄 Autofix
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: e1fa1b31-0b63-4e4e-ad8b-44f7619a89d7
📒 Files selected for processing (5)
ios/RideSessionActivity/LockScreenControl.swiftios/RideSessionActivity/OpenTrainLCDIntent.swiftios/RideSessionActivity/Schemes/Dev/Info.plistios/RideSessionActivity/Schemes/Prod/Info.plistios/TrainLCD.xcodeproj/project.pbxproj
Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Ez1jjea88ehoXQa6yKYh3x
This was referenced Aug 6, 2026
Merged
Merged
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.
概要
#6568 で追加したロック画面コントロールを長押ししても TrainLCD が起動しない不具合を修正する。
ロック画面下部のコントロールは懐中電灯・カメラと同様に「触れたまま押し込む → 拡大したら離す」で発動するため、長押しが正しい起動操作である。つまり操作方法の問題ではなく、コントロールに紐づけた
AppIntentが実行されていなかった。原因:
OpenTrainLCDIntentをRideSessionActivityExtension のターゲットにしか含めていなかった。openAppWhenRun = trueのAppIntentは Extension プロセスでは実行されず、システムがアプリを起動してアプリ側の定義でperform()を走らせる。アプリ本体に定義が無いと実行先が見つからず無反応になる。変更の種類
変更内容
ios/RideSessionActivity/OpenTrainLCDIntent.swift(新規)OpenTrainLCDIntentをLockScreenControl.swiftから切り出し、アプリ本体と共有できるようにしたopenAppWhenRun = trueによる起動に一本化。OpenURLIntentによるディープリンク併用は行わない(後述)ios/TrainLCD.xcodeproj/project.pbxprojios/RideSessionActivity/LockScreenControl.swiftimport AppIntentsを削除(コントロール定義自体は変更なし)ios/RideSessionActivity/Schemes/{Dev,Prod}/Info.plistCURRENT_SCHEME_NAMEを追加。既存の Canary 版ロック画面ウィジェットがwidgetURLで Prod スキーム(trainlcd://)を開いてしまう潜在バグの修正(RideSessionActivity.swiftはBundle.mainからこのキーを読むが、Extension の Info.plist に存在しなかったため常に Prod 側へフォールバックしていた)レビュー反映(
000386a)初回実装では
openAppWhenRunに加えてOpenURLIntentでカスタムスキーム(trainlcd:///trainlcd-canary://)も返していたが、OpenURLIntentは Universal Link 前提の API であり、カスタムスキームでは確実な起動経路にならない。本アプリの entitlements を確認したところ、アプリ本体にはcom.apple.developer.associated-domainsが未設定(applinks:を持つのは App Clip のみ、しかもappclips:プレフィックス)で Universal Link を用意できないため、機能しないコードとしてOpenURLIntentの併用を削除した。Universal Link 経路が必要になるのは
openAppWhenRun単独での起動が実機で失敗した場合に限られ、その際は associated-domains + AASA の整備を含む別 PR で対応する。回帰リスクと緩和策
AppIntents追加:OpenTrainLCDIntentは@available(iOS 18.0, *)で全体をガードしているため、アプリのデプロイターゲット(15.1)を下回る環境では参照されない。AppIntents.framework は可用性情報に基づき自動で weak link される。openAppWhenRunの非推奨化: 後継のsupportedModes/IntentModesは iOS 26.0 以降の API のため、iOS 18 を対象とする本コントロールでは採用できない(適合型より新しい可用性のメンバーでプロトコル要件を満たせない)。supportedModesを宣言しない場合の既定実装がopenAppWhenRunを引き継ぐ後方互換設計に依存する。iOS 18 が最低対応から外れた時点で.foreground(.immediate)へ移行する。trainlcd://を開いていたため、本 PR でtrainlcd-canary://に変わる。Canary ビルドで意図した側のアプリが開くことの確認が必要。テスト
ローカルで以下を実行し、すべて成功することを確認した。
npm run lint: 615 ファイル検査、指摘なしnpm test: 208 suites / 2195 tests すべて成功npm run typecheck: エラーなしnpm run lintが通ることnpm testが通ることnpm run typecheckが通ること未検証事項(レビュー時にご確認ください)
CURRENT_SCHEME_NAME追加による副次的な修正)関連Issue
スクリーンショット(任意)
macOS / シミュレータのない環境での作業のため未添付。動作確認時のロック画面からの起動フローの記録をいただけると助かります(例: iPhone 15 Pro / iOS 18 以降)。