Repository navigation
端末が portrait のままでも Main 画面を横長表示で維持する - #6030
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 (24)
✅ Files skipped from review due to trivial changes (3)
📝 WalkthroughWalkthroughウィンドウ dimensions 取得を landscape-aware に統一し、expo-screen-orientation への依存を廃止。新 ChangesLandscape-aware dimensions と向き制御リファクタリング
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@src/components/HeaderEast/HeaderEast.tsx`:
- Line 122: テストのパイプラインで useLandscapeWindowDimensions が undefined
になっているので、テスト側のモックで ../../hooks(または ~/hooks)に useLandscapeWindowDimensions
を追加して返り値を定義してください;具体的には HeaderEast.tsx が呼んでいる useLandscapeWindowDimensions をテストの
jest.mock()/手動モックに含め、期待する形(幅・高さやフラグなどコンポーネントが利用するプロパティ)を返すように実装してテスト実行時に
undefined にならないようにしてください。
In `@src/components/LineBoardJO.tsx`:
- Line 38: The test mock for the hooks module is missing a mock implementation
for useLandscapeWindowDimensions, causing useLandscapeWindowDimensions() in
LineBoardJO to be undefined; update the jest.mock for the hooks module in the
LineBoardJO test (the jest.mock(...) that currently stubs the hooks) to either
add useLandscapeWindowDimensions: () => ({ width: 1920, height: 1080 }) or
switch to a partial mock using ...jest.requireActual('~/hooks') and override
only what’s needed so that useLandscapeWindowDimensions is defined for the test.
🪄 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: 4e241270-791d-4cf0-9c95-1c5bc8281628
📒 Files selected for processing (26)
src/components/DevOverlay.tsxsrc/components/HeaderEast/HeaderEast.tsxsrc/components/HeaderLED.tsxsrc/components/LineBoard/shared/components/StationName.tsxsrc/components/LineBoardE231.tsxsrc/components/LineBoardEast.tsxsrc/components/LineBoardJO.tsxsrc/components/LineBoardJRKyushu.tsxsrc/components/LineBoardSaikyo.tsxsrc/components/LineBoardToei.tsxsrc/components/LineBoardWest.tsxsrc/components/Marquee.tsxsrc/components/PadArch.tsxsrc/components/Permitted.tsxsrc/components/TrainTypeBox.tsxsrc/components/TransfersYamanote.tsxsrc/components/TypeChangeNotify.tsxsrc/hooks/index.tssrc/hooks/useLandscapeWindowDimensions.tssrc/hooks/useLockLandscapeOnActive.test.tsxsrc/hooks/useLockLandscapeOnActive.tssrc/hooks/useQuickActions.tssrc/hooks/useScale.tssrc/screens/Main.tsxsrc/screens/SelectLineScreen.render.test.tsxsrc/screens/SelectLineScreen.tsx
💤 Files with no reviewable changes (6)
- src/hooks/useLockLandscapeOnActive.ts
- src/hooks/useLockLandscapeOnActive.test.tsx
- src/hooks/useQuickActions.ts
- src/screens/SelectLineScreen.tsx
- src/screens/SelectLineScreen.render.test.tsx
- src/components/Permitted.tsx
概要
端末側で画面回転がロックされている等で OS が portrait のままになっても、Main 画面を横長レイアウトで表示し続けるようにする。
変更の種類
変更内容
ScreenOrientation.lockAsync/unlockAsyncの呼び出しを全廃 (Main / Permitted / useQuickActions / SelectLineScreen)useLockLandscapeOnActiveと対応するテストを削除useLandscapeWindowDimensionsフックを新設し、useScaleおよび Main 配下でuseWindowDimensionsを使っていた箇所 (Header* / LineBoard* / Transfers / TypeChangeNotify / TrainTypeBox / DevOverlay / PadArch / Marquee / shared StationName) を一括置換テスト
npm run lintが通ることnpm testが通ることnpm run typecheckが通ること関連Issue
スクリーンショット(任意)
Summary by CodeRabbit