{/* File Image Preview */}
- {getFilePreviewUrl(uploadedFile) ? (
+ {isUploading ? (
+
+ ) : getFilePreviewUrl(uploadedFile) ? (
`• ${row.filename}`).join("\n")}`}
+${formatFilesToDelete(selectedRows)}`}
confirmText={selectedRows.length > 1 ? "Delete All" : "Delete"}
onConfirm={handleBulkDelete}
isLoading={deleteDocumentMutation.isPending}
diff --git a/frontend/components/delete-confirmation-dialog.tsx b/frontend/components/delete-confirmation-dialog.tsx
index c561c97d..7971933d 100644
--- a/frontend/components/delete-confirmation-dialog.tsx
+++ b/frontend/components/delete-confirmation-dialog.tsx
@@ -12,6 +12,26 @@ import {
import { Button } from "./ui/button";
import { AlertTriangle } from "lucide-react";
+/**
+ * Formats a list of files to be deleted, truncating if necessary.
+ * @param files - Array of files with a `filename` property
+ * @param maxVisible - Maximum number of items to show before truncating (default: 5)
+ * @returns Formatted string with bullet points, truncated if needed
+ */
+export function formatFilesToDelete(
+ files: Array<{ filename: string }>,
+ maxVisible = 5,
+): string {
+ const visibleFiles = files.slice(0, maxVisible);
+ const remainingCount = files.length - maxVisible;
+ const fileList = visibleFiles.map((file) => `• ${file.filename}`).join("\n");
+ return remainingCount > 0
+ ? `${fileList}\n• ... and ${remainingCount} more document${
+ remainingCount > 1 ? "s" : ""
+ }`
+ : fileList;
+}
+
interface DeleteConfirmationDialogProps {
open: boolean;
onOpenChange: (open: boolean) => void;
diff --git a/frontend/components/navigation.tsx b/frontend/components/navigation.tsx
index 773117fb..4efd1403 100644
--- a/frontend/components/navigation.tsx
+++ b/frontend/components/navigation.tsx
@@ -472,19 +472,15 @@ export function Navigation({
>
)}
-
-
-
- Files
-
-
-
- {(newConversationFiles?.length ?? 0) === 0 ? (
-
- No documents yet
-
- ) : (
- newConversationFiles?.map((file, index) => (
+ {(newConversationFiles?.length ?? 0) !== 0 && (
+
+
+
+ Files
+
+
+
+ {newConversationFiles?.map((file, index) => (
- ))
- )}
+ ))}
+
-
+ )}
)}