Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions frontend/src/components/chat-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
} from 'lucide-react';

import { useAuth } from '@/context/auth-context';
import { triggerBalanceRefresh } from '@/hooks/use-accounting-api';
import { formatCostPerUnit, getCostsFromSource } from '@/lib/cost-utils';
import { getChatDataSources, getChatModels } from '@/lib/endpoint-utils';
import {
Expand Down Expand Up @@ -473,7 +474,7 @@
} else {
setProcessingStatus({
phase: 'retrieving',
message: `Searching ${event.sourceCount} data ${event.sourceCount === 1 ? 'source' : 'sources'}...`,

Check warning on line 477 in frontend/src/components/chat-view.tsx

View workflow job for this annotation

GitHub Actions / frontend-lint

Invalid type "number" of template literal expression
retrieval: {
completed: 0,
total: event.sourceCount,
Expand All @@ -489,12 +490,12 @@
setProcessingStatus((previous) => {
if (!previous) return null;
const newCompleted = (previous.retrieval?.completed ?? 0) + 1;
const newDocsFound = (previous.retrieval?.documentsFound ?? 0) + event.documentsRetrieved;

Check warning on line 493 in frontend/src/components/chat-view.tsx

View workflow job for this annotation

GitHub Actions / frontend-lint

Please rename the variable `newDocsFound`. Suggested names are: `newDocumentationFound`, `newDocumentsFound`. A more descriptive name will do too
const total = previous.retrieval?.total ?? 1;

return {
...previous,
message: `Retrieved from ${newCompleted}/${total} ${total === 1 ? 'source' : 'sources'}...`,

Check warning on line 498 in frontend/src/components/chat-view.tsx

View workflow job for this annotation

GitHub Actions / frontend-lint

Invalid type "number" of template literal expression

Check warning on line 498 in frontend/src/components/chat-view.tsx

View workflow job for this annotation

GitHub Actions / frontend-lint

Invalid type "number" of template literal expression
retrieval: {
completed: newCompleted,
total,
Expand Down Expand Up @@ -522,7 +523,7 @@
...previous,
message:
documentCount > 0
? `Found ${documentCount} relevant ${documentCount === 1 ? 'document' : 'documents'}`

Check warning on line 526 in frontend/src/components/chat-view.tsx

View workflow job for this annotation

GitHub Actions / frontend-lint

Extract this nested ternary operation into an independent statement

Check warning on line 526 in frontend/src/components/chat-view.tsx

View workflow job for this annotation

GitHub Actions / frontend-lint

Invalid type "number" of template literal expression
: 'No relevant documents found',
timing: {
...previous.timing,
Expand Down Expand Up @@ -842,6 +843,9 @@
);
});
}

// Refresh balance after successful chat completion (credits may have been consumed)
triggerBalanceRefresh();
} catch (error) {
// Handle SDK-specific errors
let errorMessage = 'An unexpected error occurred';
Expand Down
Loading
Loading