Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

feat(gfs): video file icon across desktop app and control-ui

Miguelon Peluchon053b3720520f
diff --git a/control-ui/app/constants/gfsVideoFile.ts b/control-ui/app/constants/gfsVideoFile.ts
new file mode 100644
index 000000000..380b055a2
--- /dev/null
+++ b/control-ui/app/constants/gfsVideoFile.ts
@@ -0,0 +1,12 @@
+export const GFS_VIDEO_FILE_EXTENSIONS: readonly string[] = [
+ '3gp',
+ 'avi',
+ 'flv',
+ 'm4v',
+ 'mkv',
+ 'mov',
+ 'mp4',
+ 'ogv',
+ 'webm',
+ 'wmv',
+]
diff --git a/control-ui/components/GfsBrowser.tsx b/control-ui/components/GfsBrowser.tsx
index a9702c260..209d31f61 100644
--- a/control-ui/components/GfsBrowser.tsx
+++ b/control-ui/components/GfsBrowser.tsx
@@ -4,7 +4,13 @@ import React, { useCallback, useEffect, useRef, useState } from 'react'
import { FileUploadModal } from '@components/FileUploadModal'
import { GfsImagePreview } from '@components/GfsImagePreview'
import { GfsMarkdownPreview } from '@components/GfsMarkdownPreview'
-import { IconDocumentText, IconFolder, IconImage, IconServer } from '@components/Sidebar/icons'
+import {
+ IconDocumentText,
+ IconFolder,
+ IconImage,
+ IconServer,
+ IconVideo,
+} from '@components/Sidebar/icons'
import { useToast } from '@components/Toast'
import { IconChevronRight, IconDownload, IconPaperclip, IconUpload, IconX } from '@components/icons'
import { Button, TextInput } from '@components/ui'
@@ -14,6 +20,7 @@ import { assertGfsFileUploadSize } from '@lib/gfsFileUpload'
import { gfsImagePreviewMimeType } from '@lib/gfsImagePreview'
import { isGfsMarkdownPreviewFile } from '@lib/gfsMarkdownPreview'
import { normalizeGfsResourceName } from '@lib/gfsResourceName'
+import { isGfsVideoFile } from '@lib/gfsVideoFile'
import { GfsGrantPanel } from './GfsGrantPanel'
import { GfsResourceMenu } from './GfsResourceMenu'
import { NewFolderModal } from './NewFolderModal'
@@ -608,6 +615,8 @@ export function GfsBrowser(): React.JSX.Element {
<IconFolder />
) : gfsImagePreviewMimeType(child.name) ? (
<IconImage />
+ ) : isGfsVideoFile(child.name) ? (
+ <IconVideo />
) : isGfsDocumentFile(child.name) ? (
<IconDocumentText />
) : (
@@ -732,6 +741,8 @@ export function GfsBrowser(): React.JSX.Element {
<IconFolder />
) : gfsImagePreviewMimeType(selected.name) ? (
<IconImage />
+ ) : isGfsVideoFile(selected.name) ? (
+ <IconVideo />
) : isGfsDocumentFile(selected.name) ? (
<IconDocumentText />
) : (
diff --git a/control-ui/components/Sidebar/icons.tsx b/control-ui/components/Sidebar/icons.tsx
index 292bc6998..fe466fcaa 100644
--- a/control-ui/components/Sidebar/icons.tsx
+++ b/control-ui/components/Sidebar/icons.tsx
@@ -349,6 +349,23 @@ export function IconImage() {
)
}
+export function IconVideo() {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ width="18"
+ height="18"
+ viewBox="0 0 24 24"
+ fill="currentColor"
+ stroke="currentColor"
+ strokeWidth="0"
+ >
+ <path d="M0 4.75C0 3.784.784 3 1.75 3h20.5c.966 0 1.75.784 1.75 1.75v14.5A1.75 1.75 0 0 1 22.25 21H1.75A1.75 1.75 0 0 1 0 19.25Zm1.75-.25a.25.25 0 0 0-.25.25v14.5c0 .138.112.25.25.25h20.5a.25.25 0 0 0 .25-.25V4.75a.25.25 0 0 0-.25-.25Z" />
+ <path d="M9 15.584V8.416a.5.5 0 0 1 .77-.42l5.576 3.583a.5.5 0 0 1 0 .842L9.77 16.005a.5.5 0 0 1-.77-.42Z" />
+ </svg>
+ )
+}
+
export function IconDocumentText() {
return (
<svg
diff --git a/control-ui/lib/gfsVideoFile.ts b/control-ui/lib/gfsVideoFile.ts
new file mode 100644
index 000000000..ca4845c6e
--- /dev/null
+++ b/control-ui/lib/gfsVideoFile.ts
@@ -0,0 +1,7 @@
+import { GFS_VIDEO_FILE_EXTENSIONS } from '@constants/gfsVideoFile'
+
+export function isGfsVideoFile(fileName: string): boolean {
+ const extension = fileName.split('.').pop()?.toLowerCase()
+ if (!extension || extension === fileName.toLowerCase()) return false
+ return GFS_VIDEO_FILE_EXTENSIONS.includes(extension)
+}
diff --git a/control-ui/package-lock.json b/control-ui/package-lock.json
index d3c00d762..186b759a2 100644
--- a/control-ui/package-lock.json
+++ b/control-ui/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-ui",
- "version": "0.1.434",
+ "version": "0.1.435",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-ui",
- "version": "0.1.434",
+ "version": "0.1.435",
"dependencies": {
"@clerum/display-field": "file:../packages/display-field",
"@clerum/llm-providers": "file:../packages/llm-providers",
diff --git a/control-ui/package.json b/control-ui/package.json
index e66af8377..414f82f1d 100644
--- a/control-ui/package.json
+++ b/control-ui/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-ui",
- "version": "0.1.434",
+ "version": "0.1.435",
"private": true,
"scripts": {
"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",
diff --git a/desktop-app/ui/src/components/GfsFileIcon/index.tsx b/desktop-app/ui/src/components/GfsFileIcon/index.tsx
index 5b618173c..17b4e9bb8 100644
--- a/desktop-app/ui/src/components/GfsFileIcon/index.tsx
+++ b/desktop-app/ui/src/components/GfsFileIcon/index.tsx
@@ -1,12 +1,19 @@
-import { IconAttachFile, IconDocumentText, IconImage } from '@components/SidebarNav/icons'
+import {
+ IconAttachFile,
+ IconDocumentText,
+ IconImage,
+ IconVideo,
+} from '@components/SidebarNav/icons'
import { isGfsDocumentFile } from '@lib/gfsDocumentFile'
import { gfsImagePreviewMimeType } from '@lib/gfsImagePreview'
+import { isGfsVideoFile } from '@lib/gfsVideoFile'
import type { GfsFileIconProps } from './types'
export type { GfsFileIconProps } from './types'
export function GfsFileIcon({ name, ...iconProps }: GfsFileIconProps) {
if (gfsImagePreviewMimeType(name)) return <IconImage {...iconProps} />
+ if (isGfsVideoFile(name)) return <IconVideo {...iconProps} />
if (isGfsDocumentFile(name)) return <IconDocumentText {...iconProps} />
return <IconAttachFile {...iconProps} />
}
diff --git a/desktop-app/ui/src/components/SidebarNav/icons.tsx b/desktop-app/ui/src/components/SidebarNav/icons.tsx
index ebfe8d295..09376e6db 100644
--- a/desktop-app/ui/src/components/SidebarNav/icons.tsx
+++ b/desktop-app/ui/src/components/SidebarNav/icons.tsx
@@ -347,6 +347,22 @@ export function IconImage(props: IconProps) {
)
}
+export function IconVideo(props: IconProps) {
+ return (
+ <svg
+ viewBox="0 0 24 24"
+ aria-hidden="true"
+ fill="currentColor"
+ stroke="currentColor"
+ strokeWidth="0"
+ {...props}
+ >
+ <path d="M0 4.75C0 3.784.784 3 1.75 3h20.5c.966 0 1.75.784 1.75 1.75v14.5A1.75 1.75 0 0 1 22.25 21H1.75A1.75 1.75 0 0 1 0 19.25Zm1.75-.25a.25.25 0 0 0-.25.25v14.5c0 .138.112.25.25.25h20.5a.25.25 0 0 0 .25-.25V4.75a.25.25 0 0 0-.25-.25Z" />
+ <path d="M9 15.584V8.416a.5.5 0 0 1 .77-.42l5.576 3.583a.5.5 0 0 1 0 .842L9.77 16.005a.5.5 0 0 1-.77-.42Z" />
+ </svg>
+ )
+}
+
// Document file glyph for doc/docx/pdf/md/txt resources in GFS listings.
export function IconDocumentText(props: IconProps) {
return (
diff --git a/desktop-app/ui/src/constants/gfsVideoFile.ts b/desktop-app/ui/src/constants/gfsVideoFile.ts
new file mode 100644
index 000000000..380b055a2
--- /dev/null
+++ b/desktop-app/ui/src/constants/gfsVideoFile.ts
@@ -0,0 +1,12 @@
+export const GFS_VIDEO_FILE_EXTENSIONS: readonly string[] = [
+ '3gp',
+ 'avi',
+ 'flv',
+ 'm4v',
+ 'mkv',
+ 'mov',
+ 'mp4',
+ 'ogv',
+ 'webm',
+ 'wmv',
+]
diff --git a/desktop-app/ui/src/lib/gfsVideoFile.ts b/desktop-app/ui/src/lib/gfsVideoFile.ts
new file mode 100644
index 000000000..ca4845c6e
--- /dev/null
+++ b/desktop-app/ui/src/lib/gfsVideoFile.ts
@@ -0,0 +1,7 @@
+import { GFS_VIDEO_FILE_EXTENSIONS } from '@constants/gfsVideoFile'
+
+export function isGfsVideoFile(fileName: string): boolean {
+ const extension = fileName.split('.').pop()?.toLowerCase()
+ if (!extension || extension === fileName.toLowerCase()) return false
+ return GFS_VIDEO_FILE_EXTENSIONS.includes(extension)
+}