Skip to content

DevOverlayに縮小・展開トグル機能を追加 - #5613

Merged
TinyKitten merged 2 commits into
devfrom
feature/dev-overlay-collapse
Mar 17, 2026
Merged

TinyKitten merged 2 commits into
devfrom
feature/dev-overlay-collapse

Conversation

@TinyKitten

@TinyKitten TinyKitten commented Mar 17, 2026 •

Copy link
Copy Markdown
Member

Summary

  • DevOverlayにタップで縮小/展開をトグルする機能を追加
  • 縮小時は「TrainLCD DO」のみ表示するコンパクトなピル型UI
  • 展開/縮小時にwidth/heightを同時にアニメーションし、overflow:hiddenで自然にクリップ
  • 縮小ラベルとフルコンテンツのクロスフェードにより滑らかな遷移を実現
  • ドラッグによるパネル移動は従来通り動作(right基準配置に変更)

Test plan

  • 縮小状態で「TrainLCD DO」のみ表示されることを確認
  • タップで展開/縮小がスムーズにアニメーションすることを確認
  • 縦横同時にサイズ変化すること、右上を起点に拡大することを確認
  • ドラッグでパネル移動が正常に動作することを確認
  • ランドスケープモードでも正常に動作することを確認
  • 展開時に全メトリクスが正しく表示されることを確認

🤖 Generated with Claude Code

Summary by CodeRabbit

  • 新機能
    • DevOverlay に展開/折りたたみの滑らかなアニメーションを追加
    • 展開時・折りたたみ時での動的な幅・高さ調整に対応
    • 折りたたみ時専用のオーバーレイ表示とタイトル表現を実装
    • ドラッグ操作とジェスチャー検知を強化し、直感的な操作感を向上
    • レイアウト制御と位置クランプが現在の状態に応じて適用されるよう改善

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@github-actions github-actions Bot added the react label Mar 17, 2026
@coderabbitai

coderabbitai Bot commented Mar 17, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

DevOverlay コンポーネントに展開/折りたたみアニメーションとそれに伴う動的幅・高さ、折りたたみ時のオーバーレイ表示、および拡張されたドラッグ/PanResponder ロジックを追加しました。isExpanded と animatedProgress で遷移を制御します。

Changes

Cohort / File(s) Summary
DevOverlay Animation & Interaction
src/components/DevOverlay.tsx
展開/折りたたみの状態 (isExpanded) とアニメーション進捗 (animatedProgress) を導入。幅/高さの補間(animatedWidth/animatedHeight)、折りたたみ用オーバーレイ/タイトル表示、onLayout での expandedHeight 取得、位置クランプの修正(rightOrigin 対応)、および PanResponder によるドラッグ/トグル挙動を追加。スタイルと小さなレイアウト調整を含む。

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰🌿
パネルがぴょんと広がるよ、
しゅっ、と戻るはやわらかさ、
指先で踊るドラッグの音、
小さな光が画面に差す。

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed プルリクエストのタイトルはDevOverlayに縮小・展開トグル機能を追加することを明確に示しており、変更内容の要点と完全に一致しています。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/dev-overlay-collapse
📝 Coding Plan
  • Generate coding plan for human review comments

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

@TinyKitten TinyKitten self-assigned this Mar 17, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 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/DevOverlay.tsx`:
- Around line 405-412: The animated height calculation can become undefined
while expandedHeight is 0 on first render, causing layout flicker; update
DevOverlay.tsx to compute a single resolvedExpandedHeight fallback (e.g.,
resolvedExpandedHeight = Math.max(expandedHeight || 0, collapsedHeight, 0)) and
use that variable in the animatedHeight interpolate and the other height/clamp
code paths (replace direct checks of expandedHeight with resolvedExpandedHeight
for animatedHeight, and replicate this change for the other occurrences noted
around the animatedProgress/height logic at the other locations).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4f1bb691-8ce1-4ced-96fe-6f3b9efff34e

📥 Commits

Reviewing files that changed from the base of the PR and between 438e1d8 and 0963999.

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

Comment thread src/components/DevOverlay.tsx Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/components/DevOverlay.tsx (1)

486-495: ドラッグ判定閾値は定数化すると保守しやすいです。

4 が複数箇所にあるので、将来の調整漏れを避けるために 1 箇所へ寄せるのがおすすめです。

♻️ 変更例
+const DRAG_THRESHOLD = 4;
+
 const panResponder = useMemo(
   () =>
     PanResponder.create({
       onStartShouldSetPanResponder: () => true,
       onMoveShouldSetPanResponder: (_event, gestureState) =>
-        Math.abs(gestureState.dx) > 4 || Math.abs(gestureState.dy) > 4,
+        Math.abs(gestureState.dx) > DRAG_THRESHOLD ||
+        Math.abs(gestureState.dy) > DRAG_THRESHOLD,
       onPanResponderGrant: () => {
         isDraggingRef.current = false;
         dragTranslation.stopAnimation();
         dragTranslation.setValue({ x: 0, y: 0 });
       },
       onPanResponderMove: (_event, gestureState) => {
-        if (Math.abs(gestureState.dx) > 4 || Math.abs(gestureState.dy) > 4) {
+        if (
+          Math.abs(gestureState.dx) > DRAG_THRESHOLD ||
+          Math.abs(gestureState.dy) > DRAG_THRESHOLD
+        ) {
           isDraggingRef.current = true;
         }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/DevOverlay.tsx` around lines 486 - 495, The repeated magic
number 4 used in onMoveShouldSetPanResponder and onPanResponderMove should be
extracted to a single constant (e.g., DRAG_THRESHOLD) to improve
maintainability; add a top-level or module-scoped constant and replace the
literal 4 in the expressions inside onMoveShouldSetPanResponder and
onPanResponderMove (where Math.abs(gestureState.dx) and
Math.abs(gestureState.dy) are compared), keeping behavior identical and
referencing the same DRAG_THRESHOLD when setting isDraggingRef and when deciding
to start/stop dragTranslation in onPanResponderGrant/onPanResponderMove.
🤖 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/DevOverlay.tsx`:
- Around line 486-495: The repeated magic number 4 used in
onMoveShouldSetPanResponder and onPanResponderMove should be extracted to a
single constant (e.g., DRAG_THRESHOLD) to improve maintainability; add a
top-level or module-scoped constant and replace the literal 4 in the expressions
inside onMoveShouldSetPanResponder and onPanResponderMove (where
Math.abs(gestureState.dx) and Math.abs(gestureState.dy) are compared), keeping
behavior identical and referencing the same DRAG_THRESHOLD when setting
isDraggingRef and when deciding to start/stop dragTranslation in
onPanResponderGrant/onPanResponderMove.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a87279af-24aa-45fc-8752-9ce2bc7f5203

📥 Commits

Reviewing files that changed from the base of the PR and between 0963999 and 3e0411c.

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

@TinyKitten
TinyKitten merged commit 2105f14 into dev Mar 17, 2026
5 checks passed
@TinyKitten
TinyKitten deleted the feature/dev-overlay-collapse branch March 17, 2026 04:34
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