Repository navigation
DevOverlayに縮小・展開トグル機能を追加 - #5613
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
📝 WalkthroughWalkthroughDevOverlay コンポーネントに展開/折りたたみアニメーションとそれに伴う動的幅・高さ、折りたたみ時のオーバーレイ表示、および拡張されたドラッグ/PanResponder ロジックを追加しました。isExpanded と animatedProgress で遷移を制御します。 Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (1)
src/components/DevOverlay.tsx
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
There was a problem hiding this comment.
🧹 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
📒 Files selected for processing (1)
src/components/DevOverlay.tsx
Summary
Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit