mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 00:36:31 +02:00
feat: add processing document count hook and integrate spinner in sidebar navigation for improved user feedback during document processing
This commit is contained in:
parent
7f3c647328
commit
b98dbf8952
5 changed files with 138 additions and 4 deletions
|
|
@ -34,6 +34,7 @@ import { Input } from "@/components/ui/input";
|
|||
import { isPageLimitExceededMetadata } from "@/contracts/types/inbox.types";
|
||||
import { useAnnouncements } from "@/hooks/use-announcements";
|
||||
import { useInbox } from "@/hooks/use-inbox";
|
||||
import { useDocumentsProcessing } from "@/hooks/use-documents-processing";
|
||||
import { searchSpacesApiService } from "@/lib/apis/search-spaces-api.service";
|
||||
import { logout } from "@/lib/auth-utils";
|
||||
import { deleteThread, fetchThreads, updateThread } from "@/lib/chat/thread-persistence";
|
||||
|
|
@ -129,6 +130,9 @@ export function LayoutDataProvider({
|
|||
|
||||
const totalUnreadCount = commentsInbox.unreadCount + statusInbox.unreadCount;
|
||||
|
||||
// Whether any documents are currently being uploaded/indexed — drives sidebar spinner
|
||||
const isDocumentsProcessing = useDocumentsProcessing(numericSpaceId);
|
||||
|
||||
// Track seen notification IDs to detect new page_limit_exceeded notifications
|
||||
const seenPageLimitNotifications = useRef<Set<number>>(new Set());
|
||||
const isInitialLoad = useRef(true);
|
||||
|
|
@ -266,6 +270,7 @@ export function LayoutDataProvider({
|
|||
url: "#documents",
|
||||
icon: SquareLibrary,
|
||||
isActive: isDocumentsSidebarOpen,
|
||||
showSpinner: isDocumentsProcessing,
|
||||
},
|
||||
{
|
||||
title: "Announcements",
|
||||
|
|
@ -281,6 +286,7 @@ export function LayoutDataProvider({
|
|||
isDocumentsSidebarOpen,
|
||||
totalUnreadCount,
|
||||
announcementUnreadCount,
|
||||
isDocumentsProcessing,
|
||||
]
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue