Repository navigation
CustomModalのmaxHeightを制限し下方向へのずれを修正 - #5693
Conversation
…しないようにする Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
|
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 (3)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthrough複数のモーダルで最大高さを75%に引き下げ、コンテンツの高さ制御を Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/components/StationSearchModal.tsx (1)
248-261:isLoadingの定義位置について
isLoadingが Line 268 で定義されていますが、stationsメモ内(Line 250-251)でも同じ条件が直接使用されています。可読性のため、isLoadingをstationsメモより前に定義し、両方で再利用することを検討してください。♻️ 提案
+ const isLoading = fetchStationsByNameLoading || fetchStationsNearbyLoading; + const stations = useMemo( () => - fetchStationsByNameLoading || fetchStationsNearbyLoading + isLoading ? [] : fetchStationsByNameCalled ? getUniqueStations(stationsByNameData?.stationsByName) : getUniqueStations(stationsNearbyData?.stationsNearby), [ stationsNearbyData?.stationsNearby, stationsByNameData?.stationsByName, fetchStationsByNameCalled, - fetchStationsByNameLoading, - fetchStationsNearbyLoading, + isLoading, ] ); - - const isLoading = fetchStationsByNameLoading || fetchStationsNearbyLoading;Also applies to: 268-269
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/components/StationSearchModal.tsx` around lines 248 - 261, Define a shared isLoading boolean before the stations useMemo and reuse it in the memo and later code to avoid duplicating the same loading condition; specifically, create isLoading = fetchStationsByNameLoading || fetchStationsNearbyLoading above the stations constant, then update the stations useMemo (the function that currently checks fetchStationsByNameLoading || fetchStationsNearbyLoading) to reference isLoading, and update any later references (e.g., where isLoading is currently declared on Lines ~268-269) to use this single definition so the loading logic is centralized and clearer.src/components/RouteInfoModal.tsx (1)
32-34:dynamicMinHeightとheaderHeightの不一致の可能性
dynamicMinHeightは静的なHEADER_HEIGHTを使用していますが、FlatListのpaddingTopとscrollIndicatorInsetsは動的なheaderHeight(onLayoutで測定)を使用しています。
RFValueはデバイスの高さに応じてスケーリングするため、実際のヘッダー高さがHEADER_HEIGHTと異なる場合、モーダルの高さ計算とコンテンツのパディングに微妙なずれが生じる可能性があります。一貫性を保つため、
dynamicMinHeightでもheaderHeightを使用することを検討してください。♻️ 提案
const dynamicMinHeight = useMemo(() => { const count = deduppedStations.length; const content = - HEADER_HEIGHT + count * 80 + Math.max(0, count - 1) * 8 + 72; + headerHeight + count * 80 + Math.max(0, count - 1) * 8 + 72; return Math.min(content, windowHeight * 0.75); - }, [deduppedStations.length, windowHeight]); + }, [deduppedStations.length, windowHeight, headerHeight]);Also applies to: 271-276
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/components/RouteInfoModal.tsx` around lines 32 - 34, The computed static HEADER_HEIGHT can diverge from the runtime-measured headerHeight (set in onLayout) causing mismatched dynamicMinHeight and FlatList padding/scrollIndicatorInsets; update the dynamicMinHeight calculation to reference the headerHeight state/variable instead of HEADER_HEIGHT, and ensure any places using HEADER_HEIGHT for layout (e.g., dynamicMinHeight, modal minHeight logic) consistently use headerHeight so FlatList paddingTop and scrollIndicatorInsets remain in sync with the actual measured header.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/components/RouteInfoModal.tsx`:
- Around line 32-34: The computed static HEADER_HEIGHT can diverge from the
runtime-measured headerHeight (set in onLayout) causing mismatched
dynamicMinHeight and FlatList padding/scrollIndicatorInsets; update the
dynamicMinHeight calculation to reference the headerHeight state/variable
instead of HEADER_HEIGHT, and ensure any places using HEADER_HEIGHT for layout
(e.g., dynamicMinHeight, modal minHeight logic) consistently use headerHeight so
FlatList paddingTop and scrollIndicatorInsets remain in sync with the actual
measured header.
In `@src/components/StationSearchModal.tsx`:
- Around line 248-261: Define a shared isLoading boolean before the stations
useMemo and reuse it in the memo and later code to avoid duplicating the same
loading condition; specifically, create isLoading = fetchStationsByNameLoading
|| fetchStationsNearbyLoading above the stations constant, then update the
stations useMemo (the function that currently checks fetchStationsByNameLoading
|| fetchStationsNearbyLoading) to reference isLoading, and update any later
references (e.g., where isLoading is currently declared on Lines ~268-269) to
use this single definition so the loading logic is centralized and clearer.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 62f2c58a-be4a-46cf-9f6a-a348e42a35f8
📒 Files selected for processing (5)
src/components/CustomModal.tsxsrc/components/EmptyResult.tsxsrc/components/RouteInfoModal.tsxsrc/components/StationSearchModal.tsxsrc/components/TrainTypeListModal.tsx
✅ Files skipped from review due to trivial changes (1)
- src/components/CustomModal.tsx
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Summary
CustomModalのmaxHeightを画面高さの75%に制限contentContainerStyle経由で渡されるminHeightがmaxHeightを超えないようStyleSheet.flattenでキャップ処理を追加minHeight > maxHeightでモーダルが下にずれる問題を解消Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit