Repository navigation
watchOS向けウィジェットと同等のロック画面ウィジェットをiOSに追加 - #6561
Merged
Merged
Conversation
Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TFBheCcZCtASN6YwuDNyeZ
Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TFBheCcZCtASN6YwuDNyeZ
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 (14)
📝 WalkthroughWalkthroughLive Activity の路線情報を App Group の共有 UserDefaults に同期します。新しいロック画面ウィジェットが共有状態を読み込み、複数のウィジェットファミリーで表示します。Prod と Canary のビルド設定および entitlements も更新します。 ChangesLive Activity とロック画面ウィジェット
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant useUpdateLiveActivities
participant LiveActivityModule
participant AppGroupUserDefaults
participant LockScreenProvider
participant LockScreenWidget
useUpdateLiveActivities->>LiveActivityModule: lineSymbol を含む状態を送信
LiveActivityModule->>AppGroupUserDefaults: 状態を保存
LiveActivityModule->>LockScreenWidget: タイムラインを再読み込み
LockScreenWidget->>LockScreenProvider: エントリを要求
LockScreenProvider->>AppGroupUserDefaults: 路線情報を読み込む
LockScreenProvider-->>LockScreenWidget: LockScreenEntry を返す
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
This was referenced Aug 6, 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.
概要
watchOS向けウィジェット(
WatchWidget)と同等の表示内容を、iOSのロック画面ウィジェット(WidgetKitのaccessoryファミリー)として新規に追加します。乗車中の路線・方面を、Live Activityとは別にロック画面へ常設表示できるようにします。watchOS版はWatch側のApp Group
UserDefaultsを参照しているためそのままでは移植できません。そこで同じデータキー(lineColor/lineName/lineSymbol/boundStationName/loaded)をiPhone側のApp Groupへ書き込む経路を新設し、ウィジェットのビュー実装はwatchOS版のデザインを踏襲しました。配信は既存のLive Activity用Extension(
RideSessionActivityExtension)に同居させ、新規Extensionターゲットは追加していません。変更の種類
変更内容
ios/RideSessionActivity/LockScreenWidget.swiftを新規追加。accessoryCircular(ナンバリングサークル)/accessoryRectangular(路線名+方面)/accessoryInline(「〜に乗車中」)の3ファミリーに対応(watchOS専用のaccessoryCornerは対象外)RideSessionWidgetBundle(WidgetBundle)をエントリポイント化し、RideSessionActivity.swiftの@mainを移動LiveActivityModule.swiftにApp Groupへの状態同期を追加。Live Activityの開始・更新時に路線情報を書き込んでWidgetCenterでタイムラインをリロードし、終了時にloaded=falseへクリアUserDefaults書き込みとWidgetKitのリロードバジェット消費を抑制useUpdateLiveActivitiesにナンバリングサークル表示用のlineSymbol(useNumbering由来)を追加し、liveActivityModule.tsの型にも反映RideSessionActivityExtension(Prod / Canary)のentitlementsにApp Group(group.me.tinykitten.trainlcd/.dev)を追加APP_GROUP_IDビルド設定を追加し、各Info.plistへAPP_GROUP_IDキーを配線(watch側と同じ方式)レビュー時の注意
containerBackgroundはiOS 17以降でのみ適用されるようバージョン分岐していますme.tinykitten.trainlcd/.devと各.ridesessionactivity)にApp Groups capabilityの追加が必要です。自動署名のためXcodeが処理しますが、初回ビルド時にDeveloper Portal側の更新が走りますテスト
Linux環境で実行したため、Swift側のビルド確認はCIおよびローカルのXcodeビルドに委ねています。JS/TS側は下記コマンドがすべて成功することを確認済みです(
npm testは207スイート・2192件すべてパス)。npm run lintが通ることnpm testが通ることnpm run typecheckが通ること関連Issue
スクリーンショット(任意)
作業環境にXcodeがなくシミュレータを起動できないため未添付です。ロック画面ウィジェットの実機・シミュレータでの見た目確認をお願いします。
Generated by Claude Code
Summary by CodeRabbit