diff --git a/src/components/doclist/DocumentListSkeleton.tsx b/src/components/doclist/DocumentListSkeleton.tsx index d80c076..e717f40 100644 --- a/src/components/doclist/DocumentListSkeleton.tsx +++ b/src/components/doclist/DocumentListSkeleton.tsx @@ -31,7 +31,7 @@ function IconsSkeleton({ iconSize }: { iconSize: IconSize }) { function ListSkeleton() { return (
-
+
@@ -50,7 +50,7 @@ function ListSkeleton() { {Array.from({ length: 10 }).map((_, index) => (
diff --git a/src/components/doclist/views/GalleryView.tsx b/src/components/doclist/views/GalleryView.tsx index eb8fd7b..339fa51 100644 --- a/src/components/doclist/views/GalleryView.tsx +++ b/src/components/doclist/views/GalleryView.tsx @@ -7,6 +7,7 @@ import type { DocumentListDocument } from '@/types/documents'; import { PDFIcon, EPUBIcon, FileIcon } from '@/components/icons/Icons'; import { DocumentPreview } from '@/components/doclist/DocumentPreview'; import { formatDocumentSize } from '@/components/doclist/formatSize'; +import { buttonClass } from '@/components/formPrimitives'; import { useDocumentSelection } from '../dnd/DocumentSelectionContext'; import { DND_DOCUMENT, documentIdentityKey, type DocumentDragItem } from '../dnd/dndTypes'; @@ -166,18 +167,25 @@ export function GalleryView({ setActiveIdx((i) => Math.min(documents.length - 1, i + 1)); } else if (e.key === 'ArrowLeft') { setActiveIdx((i) => Math.max(0, i - 1)); + } else if (e.key === 'Delete' || e.key === 'Backspace') { + const doc = documents[activeIdx]; + if (doc) { + e.preventDefault(); + onDeleteDoc(doc); + } } }; window.addEventListener('keydown', onKey); return () => window.removeEventListener('keydown', onKey); - }, [documents.length]); + }, [documents, activeIdx, onDeleteDoc]); return (
-
+
+
{activeDoc ? (
-
+
@@ -193,20 +201,20 @@ export function GalleryView({ Open
-
+
Type
{activeDoc.type}
Size
@@ -234,6 +242,7 @@ export function GalleryView({ ) : (

No documents to show

)} +
diff --git a/src/components/doclist/views/ListView.tsx b/src/components/doclist/views/ListView.tsx index e73f3ab..676b157 100644 --- a/src/components/doclist/views/ListView.tsx +++ b/src/components/doclist/views/ListView.tsx @@ -29,9 +29,9 @@ function formatDate(ms: number): string { } function KindIcon({ doc }: { doc: DocumentListDocument }) { - if (doc.type === 'pdf') return ; - if (doc.type === 'epub') return ; - return ; + if (doc.type === 'pdf') return ; + if (doc.type === 'epub') return ; + return ; } function HeaderCell({ @@ -131,7 +131,7 @@ function DocRow({ data-doc-tile aria-selected={isSelected} className={ - 'grid grid-cols-[minmax(0,1fr)_72px_88px_120px_28px] sm:grid-cols-[minmax(0,1fr)_88px_96px_140px_32px] items-center text-[12px] border-b border-offbase transition-colors duration-200 ease-out ' + + 'grid grid-cols-[minmax(0,1fr)_44px_72px_104px_28px] sm:grid-cols-[minmax(0,1fr)_56px_96px_140px_32px] items-center text-[12px] border-b border-offbase transition-colors duration-200 ease-out ' + (isSelected ? 'bg-offbase text-accent' : 'text-foreground hover:bg-offbase') + @@ -198,7 +198,7 @@ export function ListView({ return (
-
+
diff --git a/src/components/doclist/window/finderIcons.tsx b/src/components/doclist/window/finderIcons.tsx index f2f0fa3..dd376ad 100644 --- a/src/components/doclist/window/finderIcons.tsx +++ b/src/components/doclist/window/finderIcons.tsx @@ -62,10 +62,8 @@ export const ListViewIcon = (props: IconProps) => ( export const GalleryViewIcon = (props: IconProps) => ( - - - - + + );