fix(ui): ignore internal card drags in model card preview drop (#1034)

Tag move-to-folder drags with a custom dataTransfer MIME type so card
preview-drop handlers skip them entirely (no highlight, no upload), and
mark the preview image non-draggable so the browser no longer synthesizes
a File payload when a drag starts on the image. Fixes card-on-card drops
and click-jitter self-drops replacing the preview with itself.
This commit is contained in:
Will Miao
2026-08-18 20:22:32 +08:00
parent d2f50f26f1
commit 5d1a22fb8f
4 changed files with 61 additions and 4 deletions
+4
View File
@@ -87,6 +87,10 @@ export const BASE_MODELS = {
UNKNOWN: "Other"
};
// Custom dataTransfer MIME type tagging internal model-card drags (move-to-folder).
// Preview-drop handlers use it to ignore drags that did not come from the OS file system.
export const MODEL_CARD_DRAG_MIME_TYPE = 'application/x-lora-manager-model-card';
// Model sub-type display names (new canonical field: sub_type)
export const MODEL_SUBTYPE_DISPLAY_NAMES = {
// LoRA sub-types