feat: Introduce DocumentOpenContext for document activation in the frontend

This commit is contained in:
2025-12-04 00:57:54 +01:00
parent 65555c18e8
commit 447b012e48
9 changed files with 82 additions and 50 deletions
-4
View File
@@ -3,7 +3,6 @@ import { useDocumentViewLogic, DocumentViewLogic } from './hooks/useDocumentView
import { useDocumentsNavigation } from './hooks/useDocumentsNavigation';
import { useWorkspaceSelectionContext } from '../app/WorkspaceSelectionContext';
import { usePanelManager } from '../app/PanelManagerContext';
import { usePreviewContext } from '../preview/PreviewContext';
import DocumentsListRow from './components/DocumentsListRow';
import DocumentsGridCard from './components/DocumentsGridCard';
import DocumentsListContainer from './components/DocumentsListContainer';
@@ -24,7 +23,6 @@ const AbstractDocumentsView = <CProps extends { clearSelection: () => void; chil
...props
}: AbstractDocumentsViewProps<CProps>) => {
const { entries, onDocumentRename, onFolderRename, onFolderSelect, scrollRef, viewId } = props;
const { openPreview } = usePreviewContext();
const viewLogic = useDocumentViewLogic({
onDocumentRename,
onFolderRename,
@@ -32,7 +30,6 @@ const AbstractDocumentsView = <CProps extends { clearSelection: () => void; chil
const { handleKeyDown, handleFocus } = useDocumentsNavigation({
entries,
onFolderSelect,
onPreview: openPreview,
viewMode: props.viewMode,
scrollRef: props.scrollRef,
});
@@ -105,7 +102,6 @@ const AbstractDocumentsView = <CProps extends { clearSelection: () => void; chil
entry={entry}
viewLogic={viewLogic}
{...props}
onPreview={openPreview}
/>
))}
</ContainerComponent>