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 { resolveDocumentAssetUrl, createAssetView } from './asset_manager';
import { useAssetNavigator } from './hooks/useAssetNavigator'; import { useAssetNavigator } from './hooks/useAssetNavigator';
import { ArrowLeftIcon, ArrowRightIcon } from './ui/icons'; import { ArrowLeftIcon, ArrowRightIcon } from './ui/icons';
import { createDocumentsTableHeaderActions } from './documents/DocumentsTable'; import { createDocumentsTableHeaderActions } from './documents/DocumentsPanel';
import createWorkspaceSurfaceConfig from './documents/workspaceHeader'; import createWorkspaceSurfaceConfig from './documents/workspaceHeader';
import { clamp, formatTransform } from './desktop/math'; import { clamp, formatTransform } from './desktop/math';
import { preventAll } from './desktop/events'; import { preventAll } from './desktop/events';
-10
View File
@@ -389,8 +389,6 @@ const AppLayout = () => {
[selectedEntries], [selectedEntries],
); );
const selectionCount = selectedDocumentIds.length;
const selectedFolderIds = useMemo( const selectedFolderIds = useMemo(
() => () =>
selectedEntries selectedEntries
@@ -3135,9 +3133,6 @@ const AppLayout = () => {
if (row.type === 'folder') { if (row.type === 'folder') {
selectFolder(row.id); selectFolder(row.id);
} else if (row.type === 'document') { } else if (row.type === 'document') {
if (selectionCount === 0) {
detailPanelControlRef.current.open();
}
openDocumentPreview(row.id); openDocumentPreview(row.id);
} }
return; return;
@@ -3170,14 +3165,10 @@ const AppLayout = () => {
setFocusedRowKey(targetRow.key); setFocusedRowKey(targetRow.key);
const hadSelection = selectionCount > 0;
handleRowSelection(targetRow.key, { handleRowSelection(targetRow.key, {
shiftKey, shiftKey,
preventDefault: () => {}, preventDefault: () => {},
}); });
if (targetRow.type === 'document' && !hadSelection) {
detailPanelControlRef.current.open();
}
}, },
[ [
navigableRows, navigableRows,
@@ -3187,7 +3178,6 @@ const AppLayout = () => {
handleRowSelection, handleRowSelection,
selectFolder, selectFolder,
openDocumentPreview, openDocumentPreview,
selectionCount,
setFocusedRowKey, setFocusedRowKey,
], ],
); );
+1 -1
View File
@@ -1,6 +1,6 @@
import React, { useCallback, useMemo } from 'react'; import React, { useCallback, useMemo } from 'react';
import { ChevronsRightIcon } from '../ui/icons'; import { ChevronsRightIcon } from '../ui/icons';
import { createDocumentsSurface } from '../documents/DocumentsTable'; import { createDocumentsSurface } from '../documents/DocumentsPanel';
import { createPreviewSurface } from '../preview/PreviewWorkspace'; import { createPreviewSurface } from '../preview/PreviewWorkspace';
import { createDesktopSurface } from '../DesktopWorkspace'; import { createDesktopSurface } from '../DesktopWorkspace';
@@ -201,7 +201,7 @@ const DocumentThumbnailImage = ({
); );
}; };
const DocumentsTable = ({ const DocumentsPanel = ({
currentFolderName, currentFolderName,
breadcrumbs, breadcrumbs,
onRefresh, onRefresh,
@@ -441,7 +441,10 @@ const DocumentsTable = ({
} }
if (entry.type === EntryType.document) { 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(); onOpenDetailPanel();
} }
return; return;
@@ -1228,7 +1231,7 @@ const DocumentsTable = ({
); );
}; };
export default DocumentsTable; export default DocumentsPanel;
export { DocumentThumbnailImage }; export { DocumentThumbnailImage };
export const createDocumentsTableHeaderActions = ({ export const createDocumentsTableHeaderActions = ({
@@ -1328,7 +1331,7 @@ export const createDocumentsSurface = ({
onNavigateParent, onNavigateParent,
actions, actions,
breadcrumbs, breadcrumbs,
content: <DocumentsTable {...tableProps} showHeader={false} />, content: <DocumentsPanel {...tableProps} showHeader={false} />,
detail, detail,
}); });