Skip to content

watchOS・ロック画面ウィジェットと同じ体裁のホーム画面ウィジェットをiOSに追加 - #6573

Merged
TinyKitten merged 3 commits into
devfrom
claude/ios-home-screen-widget-4i8yoy
Aug 6, 2026
Merged

TinyKitten merged 3 commits into
devfrom
claude/ios-home-screen-widget-4i8yoy

Conversation

@TinyKitten

@TinyKitten TinyKitten commented Aug 6, 2026 •

Copy link
Copy Markdown
Member

概要

iOSのホーム画面に置けるウィジェットを追加しました。デザインとレイアウトは既存のwatchOSウィジェット(accessoryRectangular / accessoryCircular)とiOSのロック画面ウィジェット、およびAndroidのホーム画面ウィジェット(#6569)の体裁を踏襲しています。

新規ターゲットは作らず、既存の RideSessionActivity Extension(ライブアクティビティ・ロック画面ウィジェット・ロック画面コントロールを配信中)の WidgetBundle に足す形にしたため、署名・entitlements・App Group の設定はそのまま流用できます。

変更の種類

  • バグ修正
  • 新機能
  • リファクタリング
  • ドキュメント
  • CI/CD
  • その他

変更内容

  • ios/RideSessionActivity/HomeScreenWidget.swift を追加し、systemSmall / systemMedium に対応
    • systemSmall: 左上に路線色のナンバリングサークル(accessoryCircular 相当。路線記号が無い路線は路線名の先頭1文字で代替)、その下に路線名と方面
    • systemMedium: accessoryRectangular と同じ「路線色バー + 路線名 + 方面」に、tramシンボル付きのアプリ名とナンバリングサークルを追加
    • 背景はニュートラル(.fill.tertiary)+路線色をアクセントに使う構成とし、ロック画面ウィジェット・Android版と揃えた
    • Extensionのデプロイターゲットが16.1のため、containerBackground は既存の互換ラップと同じ方式で @available 分岐し、コンテンツマージンの無いiOS 16では自前で余白を付ける
  • 表示データはロック画面ウィジェットと同じ LockScreenEntry / LockScreenProvider(App Group)を共有。新しい同期経路は増やしていないためJS側の変更は無し
  • LiveActivityModule がApp Groupへ書き込む際、ホーム画面ウィジェットのtimelineも併せてリロードするよう変更(差分がある時だけ書き込む既存のリロードバジェット節約はそのまま維持)
    • あわせて syncLockScreenWidgetState → syncWidgetState など、ロック画面専用ではなくなったprivateメソッド名を実態に合わせて改名
  • ウィジェットギャラリー用の説明文を ja/en の Localizable.strings に widgetDescription として追加(文言はAndroid版の widget_description と統一)
  • project.pbxproj にProd / Canary両RideSessionActivity Extensionのソースとして登録

テスト

  • npm run lint が通ること
  • npm test が通ること
  • npm run typecheck が通ること

リグレッションリスクと補足

  • 既存のロック画面ウィジェット・ロック画面コントロール・ライブアクティビティのコードパスは、WidgetCenter.reloadTimelines の対象kindが1つ増える以外は変更していません。App Groupに書き込むキーも従来どおりで、追加・変更はありません。
  • 実行環境にXcode / Swiftツールチェーンが無いため、ネイティブビルドとシミュレータ上での表示確認は未実施です。レイアウトは既存ウィジェットと同じAPI・記法に揃えていますが、実機での見え方の最終確認をお願いします。
  • origin/dev の ロック画面コントロールを長押ししてもアプリが開かない問題を修正 #6572(OpenTrainLCDIntent.swift 追加)と project.pbxproj のオブジェクトIDが偶然衝突していたため、devをマージのうえ本PR側のIDを採番し直しています(重複IDが残っていないことは確認済み)。

関連Issue

スクリーンショット(任意)


Generated by Claude Code

Summary by CodeRabbit

  • 新機能
    • iOSのホーム画面に、乗車中の路線や方面を表示するSmall・Mediumウィジェットを追加しました。
    • 乗車開始・更新・終了時に、ホーム画面ウィジェットの表示内容が自動更新されます。
    • 英語・日本語のウィジェット説明文に対応しました。

@coderabbitai

coderabbitai Bot commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 54 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1682e497-dbae-4fff-b239-6c58eda2df6f

📥 Commits

Reviewing files that changed from the base of the PR and between 9e149f6 and 8d025df.

📒 Files selected for processing (3)
  • ios/RideSessionActivity/HomeScreenWidget.swift
  • ios/RideSessionActivity/LockScreenControl.swift
  • ios/RideSessionActivity/LockScreenWidget.swift
📝 Walkthrough

Walkthrough

ホーム画面用のSmall・Mediumウィジェットを追加しました。既存の共有エントリーを使用して路線情報を表示します。Live Activityの開始・更新・停止時に、ロック画面とホーム画面のウィジェット状態を同期します。

Changes

ホーム画面ウィジェット対応

Layer / File(s) Summary
ウィジェット表示とExtension登録
ios/RideSessionActivity/HomeScreenWidget.swift, ios/RideSessionActivity/LockScreenWidget.swift, ios/TrainLCD.xcodeproj/project.pbxproj, ios/Localizable/.../Localizable.strings
Small・Mediumウィジェットを追加しました。共有のLockScreenEntryから路線情報を表示します。ウィジェットをバンドルとProd/Canary Extensionに登録しました。英語と日本語の説明文を追加しました。
ウィジェット状態同期
ios/Modules/LiveActivity/LiveActivityModule.swift
状態同期とクリア処理を全ウィジェット対応に変更しました。状態更新時にホーム画面ウィジェットのタイムラインを再読み込みします。

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant LiveActivityModule
  participant WidgetCenter
  participant LockScreenWidget
  participant HomeScreenWidget

  LiveActivityModule->>WidgetCenter: 状態を同期
  LiveActivityModule->>WidgetCenter: 両ウィジェットを再読み込み
  WidgetCenter->>LockScreenWidget: 共有状態を反映
  WidgetCenter->>HomeScreenWidget: タイムラインを更新
Loading

Possibly related PRs

  • TrainLCD/MobileApp#6561: LiveActivityModule.swiftとLockScreenWidget.swiftのウィジェット同期処理に直接関連します。
  • TrainLCD/MobileApp#6568: ウィジェット状態の同期、クリア、共有App Groupエントリーに重なりがあります。

Poem

うさぎが画面をぴょんと見て
路線と方面を表示する
小さな窓も中くらいの窓も
更新の波に耳を立て
今日の乗車を案内する кла?

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed iOSホーム画面ウィジェットの追加という主変更を明確に示しており、既存ウィジェットとのデザイン関係も説明しています。
Description check ✅ Passed 概要、変更種類、変更内容、テスト結果、未実施のネイティブ確認を記載しており、テンプレートを十分に満たしています。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/ios-home-screen-widget-4i8yoy

Comment @coderabbitai help to get the list of available commands.

@TinyKitten TinyKitten self-assigned this Aug 6, 2026
@github-actions github-actions Bot added the ios label Aug 6, 2026
@TinyKitten

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/HomeScreenWidget.swift`:
- Line 26: Update the Color(hex:) usages for the route circle stroke and route
bar in the relevant widget view to replace an empty lineColor with the same
default color used by LockScreenControlValue.tint. Preserve provided non-empty
colors while ensuring missing line colors remain visible.
🪄 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: 48977145-f41c-4724-a152-d62b65af0c88

📥 Commits

Reviewing files that changed from the base of the PR and between cb3367e and 9e149f6.

📒 Files selected for processing (6)
  • ios/Localizable/en.lproj/Localizable.strings
  • ios/Localizable/ja.lproj/Localizable.strings
  • ios/Modules/LiveActivity/LiveActivityModule.swift
  • ios/RideSessionActivity/HomeScreenWidget.swift
  • ios/RideSessionActivity/LockScreenWidget.swift
  • ios/TrainLCD.xcodeproj/project.pbxproj

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants