Repository navigation
iOSのプリセットウィジェットを高さに収まるだけ表示しsystemSmallは縦積みにする - #6589
Conversation
Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01AnY1Ffc9te3qeT6wUvzcCp
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 55 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughiOSウィジェットの表示件数を固定値から実描画高に基づく計算へ変更しました。 Changesウィジェットレイアウト変更
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant PresetsWidget
participant GeometryReader
participant PresetsWidgetFeatured
participant PresetLink
PresetsWidget->>GeometryReader: ウィジェット高を測定
GeometryReader->>PresetsWidget: rowCountを計算
PresetsWidget->>PresetsWidgetFeatured: systemSmallを1件表示
PresetsWidget->>PresetLink: systemMedium/systemLargeを行数分表示
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
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/PresetsWidget.swift`:
- Around line 31-33: Update the header view construction and sizing logic around
the header and rowCount(for:) so the rendered header height always matches
headerHeight (18pt): constrain the header to that fixed height and limit its
title to one line, ensuring the row-count calculation and final-row layout
cannot reserve less space than the header occupies.
🪄 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: c8ad0b8f-acd3-4c0c-9dc8-6f4aea33cce4
📒 Files selected for processing (2)
docs/home-screen-widgets.mdios/RideSessionActivity/PresetsWidget.swift
Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01AnY1Ffc9te3qeT6wUvzcCp
概要
iOS のプリセットウィジェットが余白を持て余していた点を改善しました。#6585 / #6586 のフォローアップです。
systemMedium/systemLarge: 件数の決め打ちをやめ、実際の描画高に収まるだけ行を詰めるようにしました。systemSmall: 1 件表示は維持しつつ、横一列だった「始発駅 → 終着駅」を縦積みに変更し、余白を使い切るようにしました。変更の種類
変更内容
表示件数を実測ベースに変更
これまでは
compactRowCount = 2/largeRowCount = 5とファミリーごとに決め打ちしていました。この方式では端末サイズ差で余白が出たり見切れたりするため、GeometryReaderで実際の描画高を測り、rowHeight/rowSpacing/headerHeightから収まる行数を求める形に変更しています。行の高さは
PresetsWidgetRowに.frame(height: rowHeight)を付けて固定したので、計算値と実際の描画が一致します。Android 側で高さを dp で見積もって破綻した経緯がありますが、そちらは OS から渡る値が端末・ランチャー・向きで変わるのが原因でした。iOS は自分が指定した行高を自分で数えるだけなのでずれません。systemSmall を縦積みに変更
systemSmallはウィジェット全体が単一のタップ領域で、行ごとのLinkが個別のタップ先になりません。行を並べても 1 件しか開けないため件数は 1 件のままとし、代わりにレイアウトを作り直しました(PresetsWidgetFeatured)。正方形の領域に「始発駅 → 終着駅」を横一列で置くと横幅で先に頭打ちになり、駅名がすぐ省略されます。そこで以下の順に縦へ積み、1 駅あたりの幅をフルに使うようにしました。
Spacerで余白を均し、上下どちらかに寄った空きが残らないようにしています。駅名が未取得のプリセットでは従来どおり路線名のみを表示します。その他
systemLargeのプレビューが空きだらけになるのを防ぐためです。PresetsWidgetItem.hasStationsを追加し、駅名の有無判定をrouteDescriptionと縦積み表示で共有しています。docs/home-screen-widgets.mdのサイズ・表示件数の記述を更新しました。Android 側は変更していません。
回帰リスクと緩和
rowHeightなどの定数はレイアウトの実寸と対応させる必要があるため、行の見た目を変えたら合わせて更新する旨をコメントとドキュメントに明記しています。GeometryReaderの高さが 0 以下の場合は 1 行にフォールバックします。systemMedium/systemLargeの行ごとのLink、systemSmallのwidgetURLはいずれも従来の経路のままで、ディープリンクの組み立て(presetURL)にも変更はありません。ローカルで実行したコマンド
本 PR は iOS の Swift とドキュメントのみの変更で、JS/TS には手を入れていません(上記は影響が無いことの確認として実行)。
テスト
npm run lintが通ることnpm testが通ることnpm run typecheckが通ることネイティブビルド環境が無いため、実機での表示確認は未実施です。
関連Issue
#6585 / #6586 のフォローアップ
スクリーンショット(任意)
ネイティブビルド環境が無いため未添付です。
Generated by Claude Code
Summary by CodeRabbit
改善
ドキュメント