[PR #8816] [MERGED] Drag Models in the Connections panel like characters (mouse + touch) #8824

Closed
opened 2026-11-07 17:39:58 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8816
Author: @Gunterlie
Created: 11/4/2026
Status: ✅ Merged
Merged: 11/4/2026
Merged by: @Gunterlie

Base: connection-qol ← Head: qol/drag-shared-hook


📝 Commits (3)

  • c0f2d85 feat(client): drag Model rows with the shared touch/mouse drag hook
  • 3aab22f fix(client): chat-drop only all-chat model drags; share move loop; leave select mode after drag move
  • 1f77672 style(client): prettier on connection drag files

📊 Changes

4 files changed (+146 additions, -85 deletions)

View changed files

📝 packages/client/src/components/connections/ConnectionGroup.tsx (+67 -63)
📝 packages/client/src/components/connections/ConnectionRow.tsx (+8 -15)
📝 packages/client/src/components/connections/ModelRow.tsx (+1 -0)
📝 packages/client/src/components/panels/ConnectionsPanel.tsx (+70 -7)

📄 Description

Why

Dragging a Model row onto an account card worked only with a mouse (native HTML5 drag, #8811). The character sidebar already drags with mouse and touch long-press through useTouchFolderDrag. Models now use that same hook.

What changed

  • Model rows start drags through useTouchFolderDrag (mouse and touch). In select mode, dragging a checked row drags all checked rows.
  • The hook's chat-resource payload keeps dropping a Model onto a chat working (the chat overlay reads the hook's active mouse/touch drag, not native dragstart).
  • On drop, the account card under the pointer (data-connection-account-id) is found with elementFromPoint. One row: same moves at once, other opens the Move dialog. Several rows: only if the card is same for every row; partial failures use the existing toast.
  • Valid cards keep the ring/tint from #8811, driven by the panel's drag state. Removed useDraggedConnectionId, card onDragOver/onDrop, and the native draggable on rows.

Manual verification

  • Mouse: drag a Model onto another card of the same service: moves at once with toast
  • Mouse: drag onto a card of another service: Move dialog opens with that target
  • Select mode: drag a checked Model with others checked onto a same-service card
  • Drag a Model onto an open chat: it is added to the chat as before
  • 390 px phone: tap, scroll, ⋯ menu and checkboxes work; long-press then drag moves a Model

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/8816 **Author:** [@Gunterlie](https://github.com/Gunterlie) **Created:** 11/4/2026 **Status:** ✅ Merged **Merged:** 11/4/2026 **Merged by:** [@Gunterlie](https://github.com/Gunterlie) **Base:** `connection-qol` ← **Head:** `qol/drag-shared-hook` --- ### 📝 Commits (3) - [`c0f2d85`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c0f2d85903d159bc4822d66098df19114012b1e7) feat(client): drag Model rows with the shared touch/mouse drag hook - [`3aab22f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3aab22f8dc6cb64189020a7adf60729f5e054770) fix(client): chat-drop only all-chat model drags; share move loop; leave select mode after drag move - [`1f77672`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1f7767269073f37f12d240def8c757cfd6e17212) style(client): prettier on connection drag files ### 📊 Changes **4 files changed** (+146 additions, -85 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/connections/ConnectionGroup.tsx` (+67 -63) 📝 `packages/client/src/components/connections/ConnectionRow.tsx` (+8 -15) 📝 `packages/client/src/components/connections/ModelRow.tsx` (+1 -0) 📝 `packages/client/src/components/panels/ConnectionsPanel.tsx` (+70 -7) </details> ### 📄 Description ## Why Dragging a Model row onto an account card worked only with a mouse (native HTML5 drag, #8811). The character sidebar already drags with mouse and touch long-press through `useTouchFolderDrag`. Models now use that same hook. ## What changed - Model rows start drags through `useTouchFolderDrag` (mouse and touch). In select mode, dragging a checked row drags all checked rows. - The hook's chat-resource payload keeps dropping a Model onto a chat working (the chat overlay reads the hook's active mouse/touch drag, not native dragstart). - On drop, the account card under the pointer (`data-connection-account-id`) is found with `elementFromPoint`. One row: `same` moves at once, `other` opens the Move dialog. Several rows: only if the card is `same` for every row; partial failures use the existing toast. - Valid cards keep the ring/tint from #8811, driven by the panel's drag state. Removed `useDraggedConnectionId`, card `onDragOver/onDrop`, and the native `draggable` on rows. ## Manual verification - [ ] Mouse: drag a Model onto another card of the same service: moves at once with toast - [ ] Mouse: drag onto a card of another service: Move dialog opens with that target - [ ] Select mode: drag a checked Model with others checked onto a same-service card - [ ] Drag a Model onto an open chat: it is added to the chat as before - [ ] 390 px phone: tap, scroll, ⋯ menu and checkboxes work; long-press then drag moves a Model --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 17:39:58 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#8824
No description provided.