Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

fix(web): resolve build type errors and stale SetupScreen test

Akarshan Biswas618ed62e8692
diff --git a/web-app/src/components/HtmlArtifact.tsx b/web-app/src/components/HtmlArtifact.tsx
index 39fc6a23b..9292fe8bd 100644
--- a/web-app/src/components/HtmlArtifact.tsx
+++ b/web-app/src/components/HtmlArtifact.tsx
@@ -3,6 +3,7 @@ import { useTranslation } from '@/i18n/react-i18next-compat'
import { CodeIcon, EyeIcon } from 'lucide-react'
import { cn } from '@/lib/utils'
import { CodeBlock } from '@/components/ai-elements/code-block'
+import type { BundledLanguage } from 'shiki'
interface HtmlArtifactProps {
code: string
@@ -158,7 +159,7 @@ function HtmlArtifactComponent({
srcDoc={srcDoc}
/>
) : (
- <CodeBlock code={code} language={language} />
+ <CodeBlock code={code} language={language as BundledLanguage} />
)}
</div>
)
diff --git a/web-app/src/components/WindowResizeGrips.tsx b/web-app/src/components/WindowResizeGrips.tsx
index 2ca6a2374..72a9c68c0 100644
--- a/web-app/src/components/WindowResizeGrips.tsx
+++ b/web-app/src/components/WindowResizeGrips.tsx
@@ -1,5 +1,15 @@
import { getCurrentWebviewWindow } from '@tauri-apps/api/webviewWindow'
-import type { ResizeDirection } from '@tauri-apps/api/window'
+
+// @tauri-apps/api declares ResizeDirection locally but doesn't export it.
+type ResizeDirection =
+ | 'East'
+ | 'North'
+ | 'NorthEast'
+ | 'NorthWest'
+ | 'South'
+ | 'SouthEast'
+ | 'SouthWest'
+ | 'West'
/**
* Invisible edge/corner grips that restore window resizing for a borderless
diff --git a/web-app/src/containers/__tests__/SetupScreen.test.tsx b/web-app/src/containers/__tests__/SetupScreen.test.tsx
index 438292409..ffac5adfa 100644
--- a/web-app/src/containers/__tests__/SetupScreen.test.tsx
+++ b/web-app/src/containers/__tests__/SetupScreen.test.tsx
@@ -167,10 +167,10 @@ describe('SetupScreen', () => {
it('clicking download triggers pullModelWithMetadata once metadata is ready', async () => {
hoisted.janModel = sampleModel
render(<SetupScreen />)
+ fireEvent.click(screen.getByText('Download'))
await waitFor(() =>
expect(hoisted.downloadStore.addLocalDownloadingModel).toHaveBeenCalled()
)
- // auto-start calls pull once support check completes
await waitFor(() =>
expect(hoisted.pullModelWithMetadataMock).toHaveBeenCalled()
)