Repository navigation
テーマ確認モーダルのレイアウトを改善 - #6549
テーマ確認モーダルのレイアウトを改善#6549
Conversation
📝 WalkthroughWalkthroughCustomModalのタブレット時の最大高さを90%に変更しました。スマートフォン時は75%を維持します。ThemeConfirmModalでは、テーマ説明をプレビュー画像の後に移動し、下余白を24に変更しました。各変更をテストで検証します。 ChangesCustomModalのレスポンシブ表示
ThemeConfirmModalの説明配置
Estimated code review effort: 3 (Moderate) | ~20 minutes 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 triggered.
|
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
🧹 Nitpick comments (4)
src/components/CustomModal.tablet.test.tsx (1)
6-18: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win各テスト後にモックの呼び出し履歴をクリアしてください。
このファイルは
jest.mockでモックを登録していますが、afterEachがありません。同一ファイルにテストを追加すると、モックの呼び出し履歴が後続テストへ残る可能性があります。jest.mock('~/utils/isTablet', () => ({ __esModule: true, default: true, })); +afterEach(() => { + jest.clearAllMocks(); +});As per coding guidelines, テストファイルでは
afterEach内でjest.clearAllMocks()を呼び出してください。🤖 Prompt for 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. In `@src/components/CustomModal.tablet.test.tsx` around lines 6 - 18, Add an afterEach hook to the CustomModal tablet test file that calls jest.clearAllMocks(), ensuring mock call history from the jotai, Portal, and isTablet mocks is reset after every test.Source: Coding guidelines
src/components/CustomModal.test.tsx (1)
54-68: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winスマートフォン分岐をテスト内で固定してください。
CustomModal.tsxはisTabletによってmaxHeightを選択します。このテストは~/utils/isTabletをfalseに固定していません。Jest の setup または実行環境がtrueを返す場合、スマートフォン分岐を保証できません。既存の setup でfalseが保証されていることを確認し、保証がなければdefault: falseのモックを追加してください。As per coding guidelines, テストを単体で再現可能に実行できるよう、端末種別をテスト内で固定してください。
🤖 Prompt for 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. In `@src/components/CustomModal.test.tsx` around lines 54 - 68, In the CustomModal test covering the 75% maxHeight behavior, explicitly fix the ~/utils/isTablet mock to return false so the smartphone branch is deterministic. Reuse the existing Jest setup or add a default false mock if no such guarantee exists, while preserving the current assertions.Source: Coding guidelines
src/components/ThemeConfirmModal.test.tsx (2)
26-49: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
THEME_PREFERENCE.AUTOの回帰ケースを追加してください。このテストは
THEME_PREFERENCE.TOKYO_METROの通常テーマだけを検証しています。ThemeConfirmModal.tsxにはtranslate('themeDescriptionAuto')を使うisAuto分岐があります。AUTOの説明文がプレビュー後に表示され、marginBottomが24になることも確認してください。As per coding guidelines, 挙動を変更した場合は同じ変更セットで対象経路のテストを更新または追加してください。
🤖 Prompt for 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. In `@src/components/ThemeConfirmModal.test.tsx` around lines 26 - 49, Extend the ThemeConfirmModal test coverage with a THEME_PREFERENCE.AUTO case using the isAuto rendering path; verify the themeDescriptionAuto text appears after the preview Image and has a marginBottom of 24, while preserving the existing Tokyo Metro assertions.Source: Coding guidelines
8-25: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winテスト間のモック状態をリセットしてください。
useAtomValueと各コールバックを Jest モックで定義しています。テストを追加すると、モックの呼び出し履歴が次のテストへ残ります。describeの直後に cleanup を追加してください。修正例
describe('ThemeConfirmModal', () => { + afterEach(() => { + jest.clearAllMocks(); + }); + it('タイトルの位置を保ち、プレビュー画像を説明文より先に表示する', () => {As per coding guidelines, テストファイルでは各テスト後に
afterEachでjest.clearAllMocks()を呼び出してください。🤖 Prompt for 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. In `@src/components/ThemeConfirmModal.test.tsx` around lines 8 - 25, テスト間に Jest モックの呼び出し履歴が残らないよう、ThemeConfirmModal の describe ブロック直後に afterEach を追加し、各テスト後に jest.clearAllMocks() を実行してください。既存のモック実装やテスト内容は変更しないでください。Source: Coding guidelines
🤖 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.
Nitpick comments:
In `@src/components/CustomModal.tablet.test.tsx`:
- Around line 6-18: Add an afterEach hook to the CustomModal tablet test file
that calls jest.clearAllMocks(), ensuring mock call history from the jotai,
Portal, and isTablet mocks is reset after every test.
In `@src/components/CustomModal.test.tsx`:
- Around line 54-68: In the CustomModal test covering the 75% maxHeight
behavior, explicitly fix the ~/utils/isTablet mock to return false so the
smartphone branch is deterministic. Reuse the existing Jest setup or add a
default false mock if no such guarantee exists, while preserving the current
assertions.
In `@src/components/ThemeConfirmModal.test.tsx`:
- Around line 26-49: Extend the ThemeConfirmModal test coverage with a
THEME_PREFERENCE.AUTO case using the isAuto rendering path; verify the
themeDescriptionAuto text appears after the preview Image and has a marginBottom
of 24, while preserving the existing Tokyo Metro assertions.
- Around line 8-25: テスト間に Jest モックの呼び出し履歴が残らないよう、ThemeConfirmModal の describe
ブロック直後に afterEach を追加し、各テスト後に jest.clearAllMocks()
を実行してください。既存のモック実装やテスト内容は変更しないでください。
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 47cecc75-92da-4803-976a-cf15c8bd70be
📒 Files selected for processing (5)
src/components/CustomModal.tablet.test.tsxsrc/components/CustomModal.test.tsxsrc/components/CustomModal.tsxsrc/components/ThemeConfirmModal.test.tsxsrc/components/ThemeConfirmModal.tsx
概要
テーマ確認モーダルのコンテンツ順とタブレット表示領域、要素間隔を調整し、アクションボタンが見切れず読みやすいレイアウトにします。
変更の種類
変更内容
CustomModalの最大高さを 75% から 90% に拡張テスト
npm run lintが通ることnpm testが通ることnpm run typecheckが通ること実行結果:
npm run lint: 成功npm test -- --runInBand: 205 suites / 2182 tests 成功npm run typecheck: 成功関連Issue
なし
スクリーンショット(任意)
Summary by CodeRabbit