Repository navigation
横画面でのモーダル表示改善・BlurView適用 - #5677
Conversation
|
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 (1)
📝 WalkthroughWalkthrough複数モーダルでヘッダー/フッターにプラットフォーム・テーマ条件のBlur/オーバーレイを追加し、固定minHeightを項目数と画面高さから算出する動的高さへ置換、FlatList/ScrollViewのレイアウトとスクロールインセットを調整。新規のThemeConfirmModalを追加し、ThemeSettingsでこれを利用するよう差し替え。CustomModalにoverflow追加。trainType無効判定を調整。 Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
a76f348 to
fc1f2fe
Compare
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/components/Permitted.tsx`:
- Line 34: The import of useTrainTypeModal in Permitted.tsx fails because that
hook does not exist; either implement a new hook named useTrainTypeModal under
src/hooks that exports the expected API used by Permitted (create and export the
hook function with the same name), or change the import in Permitted.tsx to the
correct existing hook name/path that provides the same behavior used in the
component; search for existing hooks (e.g., any useTrain* or useModal hooks) and
update the import statement to reference that symbol instead of
useTrainTypeModal.
In `@src/components/RouteInfoModal.tsx`:
- Around line 266-271: The dynamicMinHeight calculation treats
deduppedStations.length === 0 as zero content height so the ListEmptyComponent
skeleton gets hidden; update the logic in the dynamicMinHeight useMemo (which
references deduppedStations.length and windowHeight) to reserve a minimum
body/item area when count is 0 (for example, treat count as Math.max(1,
deduppedStations.length) or add a minBodyHeight constant added to header/footer)
so the empty-state skeleton has visible space while still capping by
windowHeight * 0.9.
In `@src/components/StationSearchModal.tsx`:
- Around line 264-269: The calculated dynamicMinHeight in the useMemo (variable
dynamicMinHeight) yields zero body height when stations.length === 0; update the
calculation to ensure at least one row's worth of content by using
Math.max(count, 1) (or equivalent) when computing the body portion so content =
150 + Math.max(count, 1) * 80 + Math.max(0, count - 1) * 8 + 72, keeping the
Math.min(..., windowHeight * 0.9) cap and preserving dependencies
[stations?.length, windowHeight].
In `@src/components/TrainTypeListModal.tsx`:
- Around line 294-300: When calculating dynamicMinHeight in the useMemo, ensure
the "body" area isn't zero for trainTypes.length === 0 by introducing a minimum
body height for empty/loading states (e.g., minEmptyBodyHeight) and use it when
computing content; update the content calculation in dynamicMinHeight
(referencing trainTypes.length, content, maxHeight, windowHeight) to use body =
trainTypes.length > 0 ? trainTypes.length * 80 + Math.max(0, trainTypes.length -
1) * 8 : minEmptyBodyHeight, then return Math.min(72 + body + 72, maxHeight) so
the empty/loading UI is visible.
In `@src/screens/ThemeSettings.tsx`:
- Around line 247-253: 現在、visible と表示データ(themeId/themeTitle)を同じ pendingTheme
にしているため、handleCloseModal 等で pendingTheme を null
にすると閉じアニメ中に表示データが空になります。修正案:ThemeConfirmModal に onCloseAnimationEnd
コールバックを追加して(または既存のものを透過して)モーダルが閉じアニメ完了するまで親で pendingTheme をクリアしないようにし、visible
の切り替えは別のフラグ(または ThemeConfirmModal 内の isClosing 状態)で制御する。該当箇所:ThemeConfirmModal
コンポーネント呼び出し、pendingTheme 状態更新ロジック(handleCloseModal/handleConfirmThemeChange)と
onCloseAnimationEnd の透過実装を修正してください。
🪄 Autofix (Beta)
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: b2bb4eaa-dfd0-4b28-b4e7-26dbeb41b38c
📒 Files selected for processing (8)
src/components/CustomModal.tsxsrc/components/Permitted.tsxsrc/components/RouteInfoModal.tsxsrc/components/SelectBoundModal.tsxsrc/components/StationSearchModal.tsxsrc/components/ThemeConfirmModal.tsxsrc/components/TrainTypeListModal.tsxsrc/screens/ThemeSettings.tsx
fc1f2fe to
7823da9
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (1)
src/components/TrainTypeListModal.tsx (1)
294-300:⚠️ Potential issue | 🟠 Major0件時の本文高を確保してください。
trainTypes.length === 0だとminHeightがヘッダー + フッター分の 144px だけになり、本文領域が 0px になります。これだとListEmptyComponentのローディングがヘッダー/フッターの下に隠れるので、0件時用の最小本文高を別で持たせた方がよいです。🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/components/TrainTypeListModal.tsx` around lines 294 - 300, The dynamicMinHeight calculation (inside useMemo using trainTypes.length and windowHeight) doesn't reserve any body space when trainTypes.length === 0, causing the ListEmptyComponent to be hidden; update the logic in the dynamicMinHeight/useMemo block (or create a small helper) to enforce a minimum body height for the empty state (e.g., define a minBodyHeight constant and compute content as 72 + Math.max(minBodyHeight, trainTypes.length * 80 + Math.max(0, trainTypes.length - 1) * 8) + 72) then clamp with windowHeight * 0.9 so ListEmptyComponent is visible even when trainTypes.length is 0.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/components/SelectBoundModal.tsx`:
- Around line 905-909: The conditional for choosing the translate key uses
fetchedTrainTypes.length (unfiltered) but should use the post-filtered candidate
count used by TrainTypeListModal (i.e., apply the same line/destination filters)
so the label and enablement reflect actual candidates; update the logic around
the translate call to compute the filtered list (or reuse the existing
filteredTrainTypes/candidate array used by TrainTypeListModal) and use
filtered.length to decide between 'settingsAndTrainType' and 'settings' (apply
the same change to the other occurrence near the second location).
- Around line 64-78: The header and scroll content offsets diverge because
headerContainer uses paddingTop: 24 + paddingBottom: 16 plus Heading height
while ScrollView uses a fixed 48px top inset; introduce a single shared constant
(e.g. HEADER_HEIGHT) and use it for headerContainer (set explicit height or
compute paddings to sum to HEADER_HEIGHT) and for the ScrollView's paddingTop
and scrollIndicatorInsets.top so the visible header area and scroll offsets
always match; update uses of container.headerContainer, ScrollView paddingTop
and scrollIndicatorInsets.top, and any Heading layout that contributes to the
header so they all reference the same HEADER_HEIGHT constant.
---
Duplicate comments:
In `@src/components/TrainTypeListModal.tsx`:
- Around line 294-300: The dynamicMinHeight calculation (inside useMemo using
trainTypes.length and windowHeight) doesn't reserve any body space when
trainTypes.length === 0, causing the ListEmptyComponent to be hidden; update the
logic in the dynamicMinHeight/useMemo block (or create a small helper) to
enforce a minimum body height for the empty state (e.g., define a minBodyHeight
constant and compute content as 72 + Math.max(minBodyHeight, trainTypes.length *
80 + Math.max(0, trainTypes.length - 1) * 8) + 72) then clamp with windowHeight
* 0.9 so ListEmptyComponent is visible even when trainTypes.length is 0.
🪄 Autofix (Beta)
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: 1f800efc-8902-4cf6-ad66-0a50aa5e8a29
📒 Files selected for processing (9)
src/components/CustomModal.tsxsrc/components/Permitted.tsxsrc/components/RouteInfoModal.tsxsrc/components/SelectBoundModal.tsxsrc/components/SelectBoundSettingListModal.tsxsrc/components/StationSearchModal.tsxsrc/components/ThemeConfirmModal.tsxsrc/components/TrainTypeListModal.tsxsrc/screens/ThemeSettings.tsx
✅ Files skipped from review due to trivial changes (3)
- src/components/Permitted.tsx
- src/components/CustomModal.tsx
- src/components/StationSearchModal.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
- src/components/ThemeConfirmModal.tsx
- src/components/RouteInfoModal.tsx
|
@coderabbitai |
|
Tip For best results, initiate chat on the files or code changes.
✏️ Learnings added
🧠 Learnings used |
|
Tip For best results, initiate chat on the files or code changes.
✏️ Learnings added
🧠 Learnings used |
- CustomModalのcontentにoverflow: hiddenを追加 - SelectBoundModalをScrollView化し、ヘッダーをabsolute配置+BlurViewに変更 - SelectBoundModalの閉じるボタンをabsolute配置のstickyフッターに変更 - RouteInfoModal, TrainTypeListModal, StationSearchModalのヘッダー・フッターにBlurViewを適用 - 各モーダルのminHeightを固定値からコンテンツ件数に応じた動的計算に変更 - FlatListにscrollIndicatorInsetsを追加 - ヘッダーテキストの色をブラー背景で見やすいよう濃色(#111)に変更 - 列車種別が1件のみの場合は列車種別選択を無効化 - ThemeSettingsのテーマ確認モーダルをThemeConfirmModalコンポーネントに切り出し Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
visibleフラグとpendingThemeデータを分離し、閉じアニメーション完了後に pendingThemeをクリアするようにした Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
d536eba to
927163e
Compare
Summary
Changes
overflow: hiddenを追加ScrollView化、ヘッダーをabsolute配置+BlurView、閉じるボタンをstickyフッター化minHeightを動的計算に変更、FlatListにscrollIndicatorInsets追加#333→#111ThemeSettings.tsxからモーダルを新コンポーネントに切り出し、ScrollViewで横画面対応Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit
新機能
改善