feat: Add drag-and-drop support with visual feedback for sidebar nodes

This commit implements drag-and-drop functionality for sidebar nodes,
adding visual feedback via highlight styling when dragging over
valid drop targets. The CSS introduces new classes to style
drop indicators using the lora-accent color scheme, while the JS
adds event handlers to manage drag operations and update the UI
state accordingly. This improves user interaction by providing
clear visual cues for valid drop areas during file operations.
This commit is contained in:
Will Miao
2025-10-12 06:55:01 +08:00
parent 8f4c02efdc
commit 4e552dcf3e
4 changed files with 320 additions and 10 deletions

View File

@@ -1,8 +1,6 @@
import { modalManager } from '../managers/ModalManager.js';
import { getModelApiClient } from '../api/modelApiFactory.js';
const apiClient = getModelApiClient();
let pendingDeletePath = null;
let pendingExcludePath = null;
@@ -27,7 +25,7 @@ export async function confirmDelete() {
if (!pendingDeletePath) return;
try {
await apiClient.deleteModel(pendingDeletePath);
await getModelApiClient().deleteModel(pendingDeletePath);
closeDeleteModal();
@@ -72,7 +70,7 @@ export async function confirmExclude() {
if (!pendingExcludePath) return;
try {
await apiClient.excludeModel(pendingExcludePath);
await getModelApiClient().excludeModel(pendingExcludePath);
closeExcludeModal();
@@ -82,4 +80,4 @@ export async function confirmExclude() {
} catch (error) {
console.error('Error excluding model:', error);
}
}
}