fix: ドラッグの終了判定を緩和する#4998
Conversation
|
Preview (prod) → https://4998-prod.traq-preview.trapti.tech/ |
|
diff がデカくて見づらいので #4890 の後に見ます |
cp-20
left a comment
There was a problem hiding this comment.
ありがとう
概ね良いと思いますが、1つだけコメントしたので直してもらえると嬉しいです
|
|
||
| isDragging.value = true | ||
|
|
||
| document.body.style.cursor = 'e-resize' |
There was a problem hiding this comment.
このスタイルは useNavigationResizer に特化したものなので、ここにあると良くなさそう
22ccefb to
b998d3e
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4998 +/- ##
=======================================
Coverage 60.81% 60.81%
=======================================
Files 101 101
Lines 2973 2973
Branches 616 616
=======================================
Hits 1808 1808
Misses 1071 1071
Partials 94 94 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
212b144 to
32a9329
Compare
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug where drag operations would not properly terminate when focus changed during dragging (e.g., via keyboard shortcuts). The fix introduces a new reusable useDragging composable that handles multiple drag termination conditions beyond the standard pointerup event.
- Introduced
useDraggingcomposable to centralize drag handling logic with enhanced termination conditions - Refactored
useNavigationResizerto use the new composable, reducing code duplication - Added
pointercancelevent handler to the resizer element for better drag state management
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/composables/dom/useDragging.ts |
New composable that manages drag state and handles termination via Escape key, pointercancel, contextmenu, visibilitychange, blur, and pagehide events |
src/components/Main/NavigationBar/composables/useNavigationResizer.ts |
Refactored to use useDragging composable, simplifying code and removing duplicate drag handling logic |
src/components/Main/NavigationBar/DesktopNavigationBar.vue |
Added @pointercancel event listener to handle pointer cancellation events |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
32a9329 to
05dc12c
Compare
概要
pointercancelイベントが発火したときdocumentのcontextmenuイベントが発火したときdocumentのchangevisivilityイベントが発火し, hidden となったときwindowのblurイベントが発火したときなぜこの PR を入れたいのか
PR を出す前の確認事項