refactor: Standardize document and folder identification with a new entryKey module.

This commit is contained in:
2025-11-24 23:13:11 +01:00
parent 096c377897
commit 22f0c040a2
12 changed files with 146 additions and 202 deletions
+4 -7
View File
@@ -2,11 +2,8 @@ import { useCallback, useEffect, useMemo } from 'react';
import type { MutableRefObject } from 'react';
import { resolveDocumentAssetUrl } from '../asset_manager';
import { useDetailPanel } from '../app/useDetailPanel';
import {
DEFAULT_FOLDER_NAME,
getRowId,
isDocumentRowKey,
} from '../app/workspaceUtils';
import { DEFAULT_FOLDER_NAME } from '../app/workspaceUtils';
import { getEntryId, isDocumentEntry } from '../app/entryKey';
import type { DocumentInfoPanelProps } from '../documents/DocumentInfoPanel';
import type { EnsureAssetUrl, GetDocumentAsset } from '../utils/ocr';
@@ -101,10 +98,10 @@ const useDetailWorkspace = ({
};
selectionOrder.forEach((key) => {
if (!isDocumentRowKey(key)) {
if (!isDocumentEntry(key)) {
return;
}
const docId = getRowId(key);
const docId = getEntryId(key);
const doc = documentLookup.get(docId) || null;
pushDoc(doc);
});