DocumentsPanel

This commit is contained in:
2025-11-02 00:23:25 +01:00
parent 14077d26d7
commit 49998fa23d
4 changed files with 9 additions and 16 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ import React, {
import { resolveDocumentAssetUrl, createAssetView } from './asset_manager';
import { useAssetNavigator } from './hooks/useAssetNavigator';
import { ArrowLeftIcon, ArrowRightIcon } from './ui/icons';
import { createDocumentsTableHeaderActions } from './documents/DocumentsTable';
import { createDocumentsTableHeaderActions } from './documents/DocumentsPanel';
import createWorkspaceSurfaceConfig from './documents/workspaceHeader';
import { clamp, formatTransform } from './desktop/math';
import { preventAll } from './desktop/events';
-10
View File
@@ -389,8 +389,6 @@ const AppLayout = () => {
[selectedEntries],
);
const selectionCount = selectedDocumentIds.length;
const selectedFolderIds = useMemo(
() =>
selectedEntries
@@ -3135,9 +3133,6 @@ const AppLayout = () => {
if (row.type === 'folder') {
selectFolder(row.id);
} else if (row.type === 'document') {
if (selectionCount === 0) {
detailPanelControlRef.current.open();
}
openDocumentPreview(row.id);
}
return;
@@ -3170,14 +3165,10 @@ const AppLayout = () => {
setFocusedRowKey(targetRow.key);
const hadSelection = selectionCount > 0;
handleRowSelection(targetRow.key, {
shiftKey,
preventDefault: () => {},
});
if (targetRow.type === 'document' && !hadSelection) {
detailPanelControlRef.current.open();
}
},
[
navigableRows,
@@ -3187,7 +3178,6 @@ const AppLayout = () => {
handleRowSelection,
selectFolder,
openDocumentPreview,
selectionCount,
setFocusedRowKey,
],
);
+1 -1
View File
@@ -1,6 +1,6 @@
import React, { useCallback, useMemo } from 'react';
import { ChevronsRightIcon } from '../ui/icons';
import { createDocumentsSurface } from '../documents/DocumentsTable';
import { createDocumentsSurface } from '../documents/DocumentsPanel';
import { createPreviewSurface } from '../preview/PreviewWorkspace';
import { createDesktopSurface } from '../DesktopWorkspace';
@@ -201,7 +201,7 @@ const DocumentThumbnailImage = ({
);
};
const DocumentsTable = ({
const DocumentsPanel = ({
currentFolderName,
breadcrumbs,
onRefresh,
@@ -441,7 +441,10 @@ const DocumentsTable = ({
}
if (entry.type === EntryType.document) {
if (typeof onOpenDetailPanel === 'function') {
const hasModifier = Boolean(
event && (event.shiftKey || event.metaKey || event.ctrlKey || event.altKey),
);
if (!hasModifier && typeof onOpenDetailPanel === 'function') {
onOpenDetailPanel();
}
return;
@@ -1228,7 +1231,7 @@ const DocumentsTable = ({
);
};
export default DocumentsTable;
export default DocumentsPanel;
export { DocumentThumbnailImage };
export const createDocumentsTableHeaderActions = ({
@@ -1328,7 +1331,7 @@ export const createDocumentsSurface = ({
onNavigateParent,
actions,
breadcrumbs,
content: <DocumentsTable {...tableProps} showHeader={false} />,
content: <DocumentsPanel {...tableProps} showHeader={false} />,
detail,
});