Repository navigation
ロック画面最下部に置けるiOS 18向け円形コントロールを追加 - #6568
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Ez1jjea88ehoXQa6yKYh3x
Contributor
📝 WalkthroughWalkthroughiOS 18以降のロック画面・コントロールセンター用ControlWidgetを追加しました。乗車状態をApp Groupから表示し、タップ時にTrainLCDを開きます。乗車状態の更新時は、ウィジェットとコントロールを再読み込みします。 Changesロック画面コントロール
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant RideSessionWidgetBundle
participant LockScreenControl
participant LockScreenControlProvider
participant LockScreenEntry
participant OpenTrainLCDIntent
participant TrainLCD
RideSessionWidgetBundle->>LockScreenControl: iOS 18以降で登録
LockScreenControl->>LockScreenControlProvider: 表示値を要求
LockScreenControlProvider->>LockScreenEntry: current()から状態を取得
LockScreenEntry-->>LockScreenControlProvider: 路線名・行き先・色を返す
LockScreenControl->>OpenTrainLCDIntent: タップ時に実行
OpenTrainLCDIntent->>TrainLCD: アプリを開く
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: 1
🤖 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/LockScreenControl.swift`:
- Around line 89-97: Update the ControlWidgetButton displaying value.title and
value.subtitle to apply privacySensitive(), ensuring lineName and boundFor are
hidden while the device is locked.
🪄 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: 39a9151e-f126-4c1e-a4bf-6416a5f77130
📒 Files selected for processing (6)
ios/Localizable/en.lproj/Localizable.stringsios/Localizable/ja.lproj/Localizable.stringsios/Modules/LiveActivity/LiveActivityModule.swiftios/RideSessionActivity/LockScreenControl.swiftios/RideSessionActivity/LockScreenWidget.swiftios/TrainLCD.xcodeproj/project.pbxproj
4 of 9 tasks
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.
概要
ロック画面の最下部(懐中電灯・カメラと同じ列)とコントロールセンターに配置できる丸いコントロールを、iOS 18 の
ControlWidgetとして追加する。時計下のウィジェット枠に置く
accessoryCircularは #6561 で対応済みのため、本 PR ではその下段にあたる「コントロール」領域を新たに埋める。タップすると TrainLCD 本体が起動し、乗車中は路線カラーと路線名が反映される。変更の種類
変更内容
ios/RideSessionActivity/LockScreenControl.swift(新規)StaticControlConfiguration+ControlValueProvider構成のControlWidgetを追加。ロック画面最下部とコントロールセンターの双方に配置できるopenAppWhenRunを立てたOpenTrainLCDIntentを実行。Extension の親アプリが起動するため Canary / Prod で URL スキームを出し分ける必要がないtram.fill+ 路線名 + 方面、未乗車時はtram+TrainLCDを表示Color(hex:)は空文字を渡すとほぼ透明になるため、ブランドカラー277BC0へフォールバックするios/RideSessionActivity/LockScreenWidget.swiftLockScreenEntry.current()へ切り出し、ロック画面ウィジェットとコントロールで共通化(LockScreenProvider内のloadEntry()を置き換え)WidgetBundleへif #available(iOS 18.0, *)付きでLockScreenControl()を追加。Extension のデプロイターゲットは 16.1 のままios/Modules/LiveActivity/LiveActivityModule.swiftreloadLockScreenSurfaces()を追加し、WidgetCenter.reloadTimelines(ofKind:)とControlCenter.shared.reloadControls(ofKind:)を必ず同時に呼ぶよう集約。乗車開始・終了の両経路から利用するios/Localizable/{en,ja}.lproj/Localizable.stringsopenApp/controlDescriptionを追加ios/TrainLCD.xcodeproj/project.pbxprojRideSessionActivityターゲットへ新規ファイルを登録回帰リスクと緩和策
loadEntry()をLockScreenEntry.current()へ移設した箇所は処理内容を変えていない純粋な移動で、getSnapshot/getTimelineの呼び出し結果は従来どおり。ControlWidgetは iOS 18 以降のみ。WidgetBundle内でif #availableにより除外しているため、旧 OS では従来のライブアクティビティとロック画面ウィジェットのみが配信される。なおWidgetBundle内の#availableは Xcode 16.1 beta 3 で修正済みの既知不具合があったが、CI はmacos-26(Xcode 26)のため影響しない。syncLockScreenWidgetStateの差分ガード(lastWidgetState比較)の内側で発火するため、更新頻度は現状のウィジェットと同じ。テスト
ローカルで以下を実行し、すべて成功することを確認した。
npm run lint: 613 ファイル検査、指摘なしnpm test: 207 suites / 2192 tests すべて成功npm run typecheck: エラーなしnpm run lintが通ることnpm testが通ることnpm run typecheckが通ること未検証事項(レビュー時にご確認ください)
ControlValueProviderのpreviewValue/currentValue()、ControlWidgetTemplate.tint(_:)、ControlCenter.shared.reloadControls(ofKind:)、.displayName/.description)だが、実ビルドと実機配置の確認をお願いしたい。関連Issue
スクリーンショット(任意)
macOS / シミュレータのない環境での作業のため未添付。ロック画面下部のコントロール追加 UI と、乗車中の路線カラー反映の実機確認をお願いしたい(例: iPhone 15 Pro / iOS 18 以降)。
Generated by Claude Code
Summary by CodeRabbit
新機能
改善