fix tag dragging

This commit is contained in:
2025-12-08 12:30:44 +01:00
parent 608239e412
commit 44cf4603fe
3 changed files with 12 additions and 11 deletions
@@ -127,7 +127,7 @@ interface UseDocumentMutationsResult {
documentId: DocumentId, documentId: DocumentId,
nextIssuedDate: number | null, nextIssuedDate: number | null,
) => Promise<boolean>; ) => Promise<boolean>;
handleTagRemove: ( handleDocumentTagDetach: (
documentId?: DocumentId, documentId?: DocumentId,
tagId?: DocumentId, tagId?: DocumentId,
) => Promise<boolean>; ) => Promise<boolean>;
@@ -588,7 +588,7 @@ const useDocumentMutations = ({
[updateDocumentCaches], [updateDocumentCaches],
); );
const handleTagRemove = useCallback( const handleDocumentTagDetach = useCallback(
async ( async (
documentId?: DocumentId, documentId?: DocumentId,
tagId?: DocumentId, tagId?: DocumentId,
@@ -695,7 +695,7 @@ const useDocumentMutations = ({
handleDocumentTagAttach, handleDocumentTagAttach,
handleDocumentTitleUpdate, handleDocumentTitleUpdate,
handleDocumentIssuedUpdate, handleDocumentIssuedUpdate,
handleTagRemove, handleDocumentTagDetach,
handleFolderDelete, handleFolderDelete,
}; };
}; };
@@ -694,7 +694,7 @@ const useDocumentsWorkspace = ({
handleDocumentTagAttach, handleDocumentTagAttach,
handleDocumentTitleUpdate, handleDocumentTitleUpdate,
handleDocumentIssuedUpdate, handleDocumentIssuedUpdate,
handleTagRemove, handleDocumentTagDetach,
} = useDocumentMutations({ } = useDocumentMutations({
documentLookup, documentLookup,
folderLabelMap, folderLabelMap,
@@ -1003,7 +1003,7 @@ const useDocumentsWorkspace = ({
window.removeEventListener('dragend', handleTagDragEnd, true); window.removeEventListener('dragend', handleTagDragEnd, true);
setTagRemovalCursor(false); setTagRemovalCursor(false);
}; };
}, [handleTagRemove, setTagRemovalCursor]); }, [handleDocumentTagDetach, setTagRemovalCursor]);
const { const {
@@ -1026,7 +1026,7 @@ const useDocumentsWorkspace = ({
handleDocumentTitleUpdate, handleDocumentTitleUpdate,
handleDocumentIssuedUpdate, handleDocumentIssuedUpdate,
handleDocumentTagAdd, handleDocumentTagAdd,
handleTagRemove, handleDocumentTagDetach,
ensureAssetUrl, ensureAssetUrl,
getAsset: getDocumentAsset, getAsset: getDocumentAsset,
correspondents, correspondents,
@@ -1098,7 +1098,8 @@ const useDocumentsWorkspace = ({
activeTagFilters, activeTagFilters,
handleTagUpdate, handleTagUpdate,
handleTagDelete, handleTagDelete,
handleDocumentTagDrop: handleDocumentTagAttach, handleDocumentTagAttach,
handleDocumentTagDetach,
handleBulkTagAddFromDetail, handleBulkTagAddFromDetail,
handleBulkTagRemoveFromDetail, handleBulkTagRemoveFromDetail,
openTagsModal, openTagsModal,
@@ -27,7 +27,7 @@ interface UseDetailWorkspaceArgs {
handleDocumentTitleUpdate?: (docId: Identifier, title: string) => Promise<boolean> | boolean; handleDocumentTitleUpdate?: (docId: Identifier, title: string) => Promise<boolean> | boolean;
handleDocumentIssuedUpdate?: (docId: Identifier, issued: number | null) => Promise<boolean> | boolean; handleDocumentIssuedUpdate?: (docId: Identifier, issued: number | null) => Promise<boolean> | boolean;
handleDocumentTagAdd?: (doc: Document, value: string, context?: { option?: unknown }) => void; handleDocumentTagAdd?: (doc: Document, value: string, context?: { option?: unknown }) => void;
handleTagRemove?: (...args: unknown[]) => void; handleDocumentTagDetach?: (...args: unknown[]) => void;
ensureAssetUrl?: EnsureAssetUrl; ensureAssetUrl?: EnsureAssetUrl;
getAsset?: GetAsset; getAsset?: GetAsset;
correspondents?: unknown[]; correspondents?: unknown[];
@@ -64,7 +64,7 @@ const useDetailWorkspace = ({
handleDocumentTitleUpdate, handleDocumentTitleUpdate,
handleDocumentIssuedUpdate, handleDocumentIssuedUpdate,
handleDocumentTagAdd, handleDocumentTagAdd,
handleTagRemove, handleDocumentTagDetach,
ensureAssetUrl, ensureAssetUrl,
getAsset, getAsset,
correspondents, correspondents,
@@ -184,7 +184,7 @@ const useDetailWorkspace = ({
tags, tags,
tagLookupById, tagLookupById,
onTagAdd: handleDocumentTagAdd, onTagAdd: handleDocumentTagAdd,
onTagRemove: handleTagRemove, onTagRemove: handleDocumentTagDetach,
onOpenPreview: openDocumentPreview, onOpenPreview: openDocumentPreview,
activePreviewId, activePreviewId,
onUpdateTitle: handleDocumentTitleUpdate, onUpdateTitle: handleDocumentTitleUpdate,
@@ -212,7 +212,7 @@ const useDetailWorkspace = ({
handleDocumentTagAdd, handleDocumentTagAdd,
handleDocumentIssuedUpdate, handleDocumentIssuedUpdate,
handleDocumentTitleUpdate, handleDocumentTitleUpdate,
handleTagRemove, handleDocumentTagDetach,
folderNodes, folderNodes,
ensureFolderData, ensureFolderData,
openDocumentPreview, openDocumentPreview,