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
2 changes: 1 addition & 1 deletion web-app/src/containers/dialogs/LoadModelErrorDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {

Check warning on line 1 in web-app/src/containers/dialogs/LoadModelErrorDialog.tsx

View workflow job for this annotation

GitHub Actions / coverage-check

1 line is not covered with tests
Dialog,
DialogContent,
DialogDescription,
Expand All @@ -6,76 +6,76 @@
DialogHeader,
DialogTitle,
} from '@/components/ui/dialog'
import { Button } from '@/components/ui/button'
import { AlertTriangle } from 'lucide-react'
import { IconCopy, IconCopyCheck } from '@tabler/icons-react'
import { useTranslation } from '@/i18n/react-i18next-compat'
import { useModelLoad } from '@/hooks/useModelLoad'
import { toast } from 'sonner'
import { useState } from 'react'

Check warning on line 15 in web-app/src/containers/dialogs/LoadModelErrorDialog.tsx

View workflow job for this annotation

GitHub Actions / coverage-check

9-15 lines are not covered with tests

export default function LoadModelErrorDialog() {
const { t } = useTranslation()
const { modelLoadError, setModelLoadError } = useModelLoad()
const [isCopying, setIsCopying] = useState(false)

Check warning on line 20 in web-app/src/containers/dialogs/LoadModelErrorDialog.tsx

View workflow job for this annotation

GitHub Actions / coverage-check

17-20 lines are not covered with tests

const handleCopy = async () => {
setIsCopying(true)
try {
await navigator.clipboard.writeText(modelLoadError ?? '')
toast.success('Copy successful', {
id: 'copy-model',
description: 'Model load error information copied to clipboard',
})
} catch {
toast.error('Failed to copy', {
id: 'copy-model-error',
description: 'Failed to copy error information to clipboard',
})
} finally {
setTimeout(() => setIsCopying(false), 2000)
}
}

Check warning on line 38 in web-app/src/containers/dialogs/LoadModelErrorDialog.tsx

View workflow job for this annotation

GitHub Actions / coverage-check

22-38 lines are not covered with tests

const handleDialogOpen = (open: boolean) => {
setModelLoadError(open ? modelLoadError : undefined)
}

Check warning on line 42 in web-app/src/containers/dialogs/LoadModelErrorDialog.tsx

View workflow job for this annotation

GitHub Actions / coverage-check

40-42 lines are not covered with tests

return (
<Dialog open={!!modelLoadError} onOpenChange={handleDialogOpen}>
<DialogContent showCloseButton={false}>
<DialogHeader>
<div className="flex items-start gap-3">
<div className="shrink-0">
<AlertTriangle className="size-4 text-destructive" />
</div>
<div>
<DialogTitle>{t('common:error')}</DialogTitle>
<DialogDescription className="mt-1 text-main-view-fg/70">

Check warning on line 54 in web-app/src/containers/dialogs/LoadModelErrorDialog.tsx

View workflow job for this annotation

GitHub Actions / coverage-check

44-54 lines are not covered with tests
Failed to load model
Something went wrong
</DialogDescription>
</div>
</div>
</DialogHeader>

Check warning on line 59 in web-app/src/containers/dialogs/LoadModelErrorDialog.tsx

View workflow job for this annotation

GitHub Actions / coverage-check

56-59 lines are not covered with tests

<div className="bg-main-view-fg/8 p-2 border border-main-view-fg/5 rounded-lg">
<p
className="text-sm text-main-view-fg/70 leading-relaxed max-h-[200px] overflow-y-auto break-all"
ref={(el) => {
if (el) {
el.scrollTop = el.scrollHeight
}
}}

Check warning on line 68 in web-app/src/containers/dialogs/LoadModelErrorDialog.tsx

View workflow job for this annotation

GitHub Actions / coverage-check

61-68 lines are not covered with tests
>
{modelLoadError}
</p>
</div>

Check warning on line 72 in web-app/src/containers/dialogs/LoadModelErrorDialog.tsx

View workflow job for this annotation

GitHub Actions / coverage-check

70-72 lines are not covered with tests

<DialogFooter className="flex flex-col gap-2 sm:flex-row sm:justify-right">
<Button
variant="link"
onClick={() => handleDialogOpen(false)}
className="flex-1 text-right sm:flex-none"

Check warning on line 78 in web-app/src/containers/dialogs/LoadModelErrorDialog.tsx

View workflow job for this annotation

GitHub Actions / coverage-check

74-78 lines are not covered with tests
>
{t('common:cancel')}
</Button>
Expand Down
3 changes: 1 addition & 2 deletions web-app/src/hooks/useChat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,7 @@
messages,
currentAssistant?.instructions
)

builder.addUserMessage(message)
if (troubleshooting) builder.addUserMessage(message)

let isCompleted = false

Expand Down Expand Up @@ -441,8 +440,8 @@
updateStreamingContent(undefined)
}
},
[

Check warning on line 443 in web-app/src/hooks/useChat.ts

View workflow job for this annotation

GitHub Actions / test-on-windows-pr

React Hook useCallback has a missing dependency: 'experimentalFeatures'. Either include it or remove the dependency array

Check warning on line 443 in web-app/src/hooks/useChat.ts

View workflow job for this annotation

GitHub Actions / test-on-ubuntu

React Hook useCallback has a missing dependency: 'experimentalFeatures'. Either include it or remove the dependency array

Check warning on line 443 in web-app/src/hooks/useChat.ts

View workflow job for this annotation

GitHub Actions / coverage-check

React Hook useCallback has a missing dependency: 'experimentalFeatures'. Either include it or remove the dependency array
getCurrentThread,

Check warning on line 444 in web-app/src/hooks/useChat.ts

View workflow job for this annotation

GitHub Actions / base_branch_cov

React Hook useCallback has a missing dependency: 'experimentalFeatures'. Either include it or remove the dependency array
resetTokenSpeed,
currentProviderId,
getProviderByName,
Expand Down
Loading
Loading