Skip to content

DevOverlayのドラッグ操作で端末向きを考慮する - #6072

Merged
TinyKitten merged 1 commit into
devfrom
fix/dev-overlay-drag-orientation-clean
May 28, 2026
Merged

TinyKitten merged 1 commit into
devfrom
fix/dev-overlay-drag-orientation-clean

Conversation

@TinyKitten

@TinyKitten TinyKitten commented May 28, 2026 •

Copy link
Copy Markdown
Member

概要

DevOverlay のドラッグ操作が、物理 portrait 端末を 90 度回転表示している状態でも見た目の向きに沿って動くように修正しました。

変更の種類

  • バグ修正
  • 新機能
  • リファクタリング
  • ドキュメント
  • CI/CD
  • その他

変更内容

  • DevOverlay の D&D 移動量を、端末が物理 portrait で横向き表示に回転されている場合のローカル座標へ変換
  • 物理横向き時と回転表示時の座標変換をテストで検証

テスト

  • npm run lint が通ること
  • npm test が通ること
  • npm run typecheck が通ること

Windows cmd では npm test 内の TZ=UTC が解釈されないため、ローカルでは set TZ=UTC&& npx jest --runInBand で同等のフル Jest を実行しました。

関連Issue

スクリーンショット(任意)

Summary by CodeRabbit

リリースノート

  • Bug Fixes

    • デバイスの物理的な回転(縦向き・横向き)に対応して、ドラッグ操作の座標変換ロジックを改善しました。
  • Tests

    • デバイス回転時のドラッグ座標変換動作を検証するテストケースを追加しました。

Review Change Stack

@TinyKitten TinyKitten self-assigned this May 28, 2026
@github-actions github-actions Bot added the react label May 28, 2026
@coderabbitai

coderabbitai Bot commented May 28, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a666b371-3d7e-4c62-833c-c5922f66e024

📥 Commits

Reviewing files that changed from the base of the PR and between 0945a59 and 79a3379.

📒 Files selected for processing (2)
  • src/components/DevOverlay.test.tsx
  • src/components/DevOverlay.tsx

📝 Walkthrough

Walkthrough

DevOverlay のドラッグ座標変換ロジックをデバイス回転に対応させました。新しい getDevOverlayDragTranslation ヘルパー関数が回転状態に応じて座標軸をスワップ・反転し、PanResponder の移動ハンドラがこのヘルパーを使用して正確な変換を実現します。テストが物理横向き・縦向きの両ケースで動作を検証します。

Changes

DevOverlay Rotation-Aware Drag Translation

Layer / File(s) Summary
Drag Translation Helper and Rotation Detection
src/components/DevOverlay.tsx
useWindowDimensions から取得した physicalDim を比較して isRotatedToLandscape を導出し、新規エクスポート関数 getDevOverlayDragTranslation(dx, dy, isRotatedToLandscape) が回転状態に応じてドラッグ座標を x/y に変換します。
PanResponder Move Handler Integration
src/components/DevOverlay.tsx
PanResponder の移動イベントハンドラが新しいヘルパー関数を呼び出すよう置き換わり、isRotatedToLandscape が依存配列に追加されます。
Drag Translation Test Cases
src/components/DevOverlay.test.tsx
getDevOverlayDragTranslation をインポートし、物理横向き・縦向き(90度回転)のケースごとに期待される座標変換結果を検証するテストケースを追加します。

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

📱 回転かな、座標も踊る、角度調べ
ヘルパー関数、軸をクルッと反転させて
テストも確か、横も縦も対応完了
ウサギのお墨付き、ドラッグはスムーズに 🐰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed PRのタイトルは、DevOverlayのドラッグ操作で端末向きを考慮するという変更内容を明確かつ簡潔に要約しており、主要な変更を的確に表現しています。
Description check ✅ Passed PRの説明は、テンプレートの主要セクション(概要、変更の種類、変更内容、テスト)を網羅しており、変更内容が具体的に記述されていて充実しています。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/dev-overlay-drag-orientation-clean

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

Actionable comments posted: 0

@TinyKitten
TinyKitten merged commit 8950c39 into dev May 28, 2026
6 checks passed
@TinyKitten
TinyKitten deleted the fix/dev-overlay-drag-orientation-clean branch May 28, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant