From dfbd47f219c7db49814fd87024021311af87ae6c Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Thu, 13 Nov 2025 13:22:10 +0100 Subject: [PATCH] fix --- frontend/src/desktop/DesktopDocumentCard.tsx | 6 +-- frontend/src/desktop/DesktopWorkspace.tsx | 10 +--- .../src/desktop/pointer/useDeskPointer.js | 7 ++- frontend/src/desktop/useDeskWorkspaceProps.ts | 28 ---------- .../documents/SelectionFloatingActions.tsx | 15 +++--- .../hooks/documents/useDocumentsWorkspace.ts | 1 - frontend/src/preview/DocumentViewerPanel.tsx | 8 ++- frontend/src/sidebar/SidebarContext.tsx | 4 +- frontend/src/styles/base/theme.css | 53 +++++++++++-------- frontend/src/styles/detail/detail-panels.css | 26 ++++++++- frontend/src/styles/documents/listing.css | 40 +++++--------- frontend/src/styles/documents/viewer.css | 2 +- 12 files changed, 93 insertions(+), 107 deletions(-) diff --git a/frontend/src/desktop/DesktopDocumentCard.tsx b/frontend/src/desktop/DesktopDocumentCard.tsx index ab4485a..944e88f 100644 --- a/frontend/src/desktop/DesktopDocumentCard.tsx +++ b/frontend/src/desktop/DesktopDocumentCard.tsx @@ -30,7 +30,7 @@ interface DesktopDocumentCardProps { getDocumentAsset?: (...args: any[]) => unknown; handleNavigatorSnapshot?: (...args: any[]) => void; cardPointerHandlers?: React.HTMLAttributes; - onDocumentOpen?: (id: string | number) => void; + onInspectDocument?: (id: string | number) => void; onTagDragEnter?: (event: React.DragEvent, docId: string | number) => void; onTagDragOver?: (event: React.DragEvent, docId: string | number) => void; onTagDragLeave?: (event: React.DragEvent, docId: string | number) => void; @@ -57,7 +57,7 @@ const DesktopDocumentCard: React.FC = ({ getDocumentAsset, handleNavigatorSnapshot, cardPointerHandlers, - onDocumentOpen, + onInspectDocument, onTagDragEnter, onTagDragOver, onTagDragLeave, @@ -117,7 +117,7 @@ const DesktopDocumentCard: React.FC = ({ onKeyDown={(event) => { if (event.key === 'Enter' || event.key === ' ') { preventAll(event); - onDocumentOpen?.(doc.id); + onInspectDocument?.(doc.id); } }} > diff --git a/frontend/src/desktop/DesktopWorkspace.tsx b/frontend/src/desktop/DesktopWorkspace.tsx index 0405fd5..1d9ade1 100644 --- a/frontend/src/desktop/DesktopWorkspace.tsx +++ b/frontend/src/desktop/DesktopWorkspace.tsx @@ -119,7 +119,6 @@ type WorkspaceSnapshotState = { interface DesktopWorkspaceProps { documents?: DeskDocument[]; searchResults?: DeskDocument[] | null; - onDocumentOpen?: (docId: Identifier | null, options?: Record) => void; onInspectDocument?: (...args: unknown[]) => void; onEntryPointer?: (...args: unknown[]) => void; onDocumentStackSelect?: (docIds: Identifier[]) => void; @@ -154,7 +153,6 @@ interface DesktopWorkspaceViewProps { tagDropTargetId: string | null; pendingTagDocId: string | null; pendingRemovalTag: unknown; - onDocumentOpen?: DesktopWorkspaceProps['onDocumentOpen']; ensureAssetUrl?: DesktopWorkspaceProps['ensureAssetUrl']; getDocumentAsset?: DesktopWorkspaceProps['getDocumentAsset']; handleNavigatorSnapshot: (docId: Identifier | null, snapshot: NavigatorSnapshot | null) => void; @@ -199,7 +197,6 @@ const DEBUG_FOCUS = false; const DesktopWorkspace: React.FC = ({ documents = [], searchResults = null, - onDocumentOpen, onInspectDocument = null, onEntryPointer = null, onDocumentStackSelect = null, @@ -717,7 +714,6 @@ const DesktopWorkspace: React.FC = ({ tagDropTargetId, pendingTagDocId, pendingRemovalTag, - onDocumentOpen, ensureAssetUrl, getDocumentAsset, handleNavigatorSnapshot, @@ -783,7 +779,6 @@ const DesktopWorkspace: React.FC = ({ layoutSnapshot, onClearSelection, onCloseDetailPanel, - onDocumentOpen, onDocumentStackSelect, onEntryPointer, onPromoteSelection, @@ -824,7 +819,6 @@ function DesktopWorkspaceView({ tagDropTargetId, pendingTagDocId, pendingRemovalTag, - onDocumentOpen, ensureAssetUrl, getDocumentAsset, handleNavigatorSnapshot, @@ -900,7 +894,7 @@ function DesktopWorkspaceView({ onEntryPointer, onDocumentStackSelect, onPromoteSelection, - onDocumentOpen, + onInspectDocument, selectedDocumentIds, detailPanelOpen, onCloseDetailPanel, @@ -1041,7 +1035,7 @@ function DesktopWorkspaceView({ getDocumentAsset={getDocumentAsset} handleNavigatorSnapshot={handleNavigatorSnapshot} cardPointerHandlers={cardPointerHandlers} - onDocumentOpen={onDocumentOpen} + onInspectDocument={onInspectDocument} onTagDragEnter={handleTagDragEnterDoc} onTagDragOver={handleTagDragOverDoc} onTagDragLeave={handleTagDragLeaveDoc} diff --git a/frontend/src/desktop/pointer/useDeskPointer.js b/frontend/src/desktop/pointer/useDeskPointer.js index 4feff5d..0200166 100644 --- a/frontend/src/desktop/pointer/useDeskPointer.js +++ b/frontend/src/desktop/pointer/useDeskPointer.js @@ -35,7 +35,7 @@ export const useDeskPointer = ({ onEntryPointer, onDocumentStackSelect, onPromoteSelection, - onDocumentOpen, + onInspectDocument, selectedDocumentIds, detailPanelOpen, onCloseDetailPanel, @@ -327,8 +327,7 @@ export const useDeskPointer = ({ const stillSelected = Array.isArray(selectedDocumentIds) && selectedDocumentIds.includes(doc.id); if (isPrimaryRelease && stillSelected) { - const useSelection = pointerState.selectedAtDown && pointerState.selectionCountAtDown > 0; - safeInvoke(onDocumentOpen, doc.id, { useSelection }); + safeInvoke(onInspectDocument, doc.id); } } } @@ -338,7 +337,7 @@ export const useDeskPointer = ({ }, [ handlePointerUp, - onDocumentOpen, + onInspectDocument, onDocumentStackSelect, onEntryPointer, resetLongPressState, diff --git a/frontend/src/desktop/useDeskWorkspaceProps.ts b/frontend/src/desktop/useDeskWorkspaceProps.ts index d46caf3..01cd3e4 100644 --- a/frontend/src/desktop/useDeskWorkspaceProps.ts +++ b/frontend/src/desktop/useDeskWorkspaceProps.ts @@ -62,7 +62,6 @@ interface UseDeskWorkspacePropsArgs { searchQuery?: string; activeCorrespondentFilters?: Identifier[]; selectedFolder?: Identifier | string | null; - openDetailPanel?: (args: { documentIds: Identifier[] }) => void; } const useDeskWorkspaceProps = ({ @@ -111,7 +110,6 @@ const useDeskWorkspaceProps = ({ searchQuery = '', activeCorrespondentFilters = [], selectedFolder, - openDetailPanel, }: UseDeskWorkspacePropsArgs) => { const handleDeskDocumentStackSelect: DeskDocumentStackSelectHandler = useCallback( (docIds) => { @@ -146,30 +144,6 @@ const useDeskWorkspaceProps = ({ [applySelection, resolveDocumentRowKey, selectedEntries, selectionAnchorRef], ); - const handleDeskDocumentOpen = useCallback( - (docId: Identifier | undefined, { useSelection = false }: { useSelection?: boolean } = {}) => { - const selectionDocIds = Array.isArray(selectedDocumentIds) - ? selectedDocumentIds - : []; - let targetIds: Identifier[] = []; - - if ((useSelection || selectionDocIds.includes(docId as Identifier)) && selectionDocIds.length) { - targetIds = selectionDocIds; - } else if (selectionDocIds.length) { - targetIds = selectionDocIds; - } else if (docId) { - targetIds = [docId]; - } - - if (!targetIds.length) { - return; - } - - openDetailPanel?.({ documentIds: targetIds }); - }, - [openDetailPanel, selectedDocumentIds], - ); - const deskViewId = useMemo(() => { if (showingSearchResults) { const trimmedQuery = searchQuery.trim(); @@ -198,7 +172,6 @@ const useDeskWorkspaceProps = ({ onViewModeChange: handleDocumentsViewModeChange, onExit: handleDeskExit, onRefresh: refreshCurrentFolder, - onDocumentOpen: handleDeskDocumentOpen, onInspectDocument: inspectDocument, onEntryPointer: handleEntryPointerCore, onDocumentStackSelect: handleDeskDocumentStackSelect, @@ -240,7 +213,6 @@ const useDeskWorkspaceProps = ({ handleDocumentsViewModeChange, handleDeskExit, refreshCurrentFolder, - handleDeskDocumentOpen, inspectDocument, handleEntryPointerCore, handleDeskDocumentStackSelect, diff --git a/frontend/src/documents/SelectionFloatingActions.tsx b/frontend/src/documents/SelectionFloatingActions.tsx index bb4f326..a1866b5 100644 --- a/frontend/src/documents/SelectionFloatingActions.tsx +++ b/frontend/src/documents/SelectionFloatingActions.tsx @@ -509,14 +509,13 @@ const SelectionFloatingActions: React.FC = ({ + {loadingFolders ? ( )} items={moveAssignments} @@ -582,8 +581,9 @@ const SelectionFloatingActions: React.FC = ({ -