diff --git a/src/app/api/documents/inbound/usage/route.ts b/src/app/api/documents/inbound/usage/route.ts index 4e0f45b89..a81fbe207 100644 --- a/src/app/api/documents/inbound/usage/route.ts +++ b/src/app/api/documents/inbound/usage/route.ts @@ -49,7 +49,12 @@ export const GET = apiHandler(async () => { // offers what the endpoint would 422. resolveOcrCapability(user.id), // Content-index coverage: how many live documents are indexed … - prisma.documentContentIndex.count({ where: { userId: user.id } }), + // Scope the count to LIVE documents: a soft-deleted document keeps its + // index row (cascade fires on hard purge only), so an unscoped count + // would drift above `totalCount` and read the gauge past 100 %. + prisma.documentContentIndex.count({ + where: { userId: user.id, document: { deletedAt: null } }, + }), // … out of how many live documents there are. prisma.inboundDocument.count({ where: { userId: user.id, deletedAt: null }, diff --git a/src/components/documents/document-ai-panels.tsx b/src/components/documents/document-ai-panels.tsx index d24b0b1f2..e0a6b728b 100644 --- a/src/components/documents/document-ai-panels.tsx +++ b/src/components/documents/document-ai-panels.tsx @@ -298,12 +298,7 @@ export function ContentIndexStatus({ data-slot="content-index-status" className="flex items-center justify-between gap-2" > -

+

{hasContentIndex ? t("documents.contentIndex.searchable")