-
+
+
-
+
{Math.round(zoom * 100)}%
@@ -83,11 +88,11 @@ export function PdfControlBar({
)}
diff --git a/packages/webui/components/viewers/pdf/pdf-viewer.tsx b/packages/webui/components/viewers/pdf/pdf-viewer.tsx
index fd8cbfab..7b41c0d1 100644
--- a/packages/webui/components/viewers/pdf/pdf-viewer.tsx
+++ b/packages/webui/components/viewers/pdf/pdf-viewer.tsx
@@ -20,13 +20,19 @@ const MAX_RENDER_PIXELS = 32_000_000
const MAX_RENDER_SCALE = 16
if (typeof window !== 'undefined' && pdfjsLib.GlobalWorkerOptions) {
- const workerPath =
- typeof pdfworker === 'string'
- ? pdfworker.startsWith('/')
- ? pdfworker
- : '/' + pdfworker.replace(/^\.\//, '')
- : pdfworker
- pdfjsLib.GlobalWorkerOptions.workerSrc = workerPath
+ try {
+ const workerPath =
+ typeof pdfworker === 'string'
+ ? pdfworker.startsWith('/')
+ ? pdfworker
+ : '/' + pdfworker.replace(/^\.\//, '')
+ : (pdfworker as unknown as string)
+ if (typeof workerPath === 'string') {
+ pdfjsLib.GlobalWorkerOptions.workerSrc = workerPath
+ }
+ } catch {
+ // Ignore in test/non-standard environments
+ }
}
export const PdfViewer = React.forwardRef
(
diff --git a/packages/webui/components/viewers/video/mobile-video-control-bar.test.tsx b/packages/webui/components/viewers/video/mobile-video-control-bar.test.tsx
new file mode 100644
index 00000000..6dc0dd83
--- /dev/null
+++ b/packages/webui/components/viewers/video/mobile-video-control-bar.test.tsx
@@ -0,0 +1,96 @@
+// @vitest-environment happy-dom
+import { cleanup, fireEvent, render, screen } from '@testing-library/react'
+import React from 'react'
+import { afterEach, describe, expect, it, vi } from 'vitest'
+import { MobileVideoControlBar } from './mobile-video-control-bar'
+import type { AssetInfo } from '@shumai/dtos'
+
+import type { DisplayTranscode } from './video-control-bar'
+
+describe('MobileVideoControlBar', () => {
+ afterEach(() => {
+ cleanup()
+ })
+
+ const mockData: AssetInfo = {
+ id: 'video-1',
+ name: 'sample.mp4',
+ proxyType: 'video',
+ media: {
+ metadata: {
+ duration: 100,
+ frameRate: 25,
+ },
+ },
+ } as AssetInfo
+
+ const defaultState = {
+ isPlaying: false,
+ progress: 10,
+ currentTime: 10,
+ duration: 100,
+ volume: 1,
+ isMuted: false,
+ isLooping: false,
+ playbackRate: 1,
+ isFullScreen: false,
+ showFrames: false,
+ currentResolution: '720p',
+ }
+
+ it('renders play, mute, timecode readout, settings, and fullscreen buttons', () => {
+ const togglePlay = vi.fn()
+ const toggleMute = vi.fn()
+ const toggleFullScreen = vi.fn()
+
+ render(
+ ,
+ )
+
+ const playBtn = screen.getByTestId('play-toggle')
+ expect(playBtn).toBeDefined()
+ fireEvent.click(playBtn)
+ expect(togglePlay).toHaveBeenCalledTimes(1)
+
+ const muteBtn = screen.getByLabelText(/Mute|Unmute/i)
+ expect(muteBtn).toBeDefined()
+ fireEvent.click(muteBtn)
+ expect(toggleMute).toHaveBeenCalledTimes(1)
+
+ const timeReadout = screen.getByTestId('time-readout')
+ expect(timeReadout).toBeDefined()
+
+ const fsBtn = screen.getByTitle(/Fullscreen/i)
+ expect(fsBtn).toBeDefined()
+ fireEvent.click(fsBtn)
+ expect(toggleFullScreen).toHaveBeenCalledTimes(1)
+ })
+})
diff --git a/packages/webui/components/viewers/video/mobile-video-control-bar.tsx b/packages/webui/components/viewers/video/mobile-video-control-bar.tsx
new file mode 100644
index 00000000..bf447626
--- /dev/null
+++ b/packages/webui/components/viewers/video/mobile-video-control-bar.tsx
@@ -0,0 +1,271 @@
+import { cn } from '@/ui/lib/utils'
+import { m } from '@/ui/paraglide/messages.js'
+import { useUiStore } from '@/ui/stores/ui'
+import {
+ Check,
+ ChevronDown,
+ Maximize,
+ Minimize,
+ Pause,
+ Play,
+ Repeat,
+ Settings,
+ Volume2,
+ VolumeX,
+} from 'lucide-react'
+import React from 'react'
+import {
+ DropdownMenu,
+ DropdownMenuContent,
+ DropdownMenuItem,
+ DropdownMenuLabel,
+ DropdownMenuSeparator,
+ DropdownMenuTrigger,
+} from '../../ui/dropdown-menu'
+import ProgressBar from './progress-bar'
+import { formatTime, formatTimecode } from './utils'
+import type { ControlBarProps } from './video-control-bar'
+
+export const MobileVideoControlBar: React.FC = ({
+ state,
+ isControlsVisible,
+ buffered,
+ data,
+ resolutions,
+ togglePlay,
+ toggleLoop,
+ toggleMute,
+ changePlaybackRate,
+ changeResolution,
+ toggleFullScreen,
+ frameRate,
+ totalFrames,
+ currentFrame,
+ seekToFrame,
+ floatOverlayInFullScreen = true,
+ onMouseEnter,
+ onMouseLeave,
+}) => {
+ const { videoTimeDisplayMode, setVideoTimeDisplayMode } = useUiStore()
+
+ if (!data.media?.metadata) {
+ return null
+ }
+
+ const overlay = state.isFullScreen && floatOverlayInFullScreen
+ const isAudio = data.proxyType === 'audio'
+
+ const startTimecode = data.media?.metadata?.startTimecode
+ const displayTotalFrames = Math.max(0, totalFrames - 1)
+ const displayString =
+ videoTimeDisplayMode === 'frames'
+ ? `${currentFrame} / ${displayTotalFrames} fr`
+ : videoTimeDisplayMode === 'standard'
+ ? `${formatTimecode(currentFrame, frameRate, 'standard')} / ${formatTime(totalFrames / frameRate)}`
+ : `${formatTimecode(currentFrame, frameRate, videoTimeDisplayMode, startTimecode)} / ${formatTimecode(displayTotalFrames, frameRate, videoTimeDisplayMode, startTimecode)}`
+
+ return (
+
+ {/* Progress Bar */}
+
+
+ {/* Control Row */}
+
+ {/* Left Side: Play, Mute, Time */}
+
+
+
+
+
+
+
+ {displayString}
+
+
+
+
+
+
+
+ {m.format()}
+
+ setVideoTimeDisplayMode('standard')}
+ className="flex items-center justify-between cursor-pointer text-xs"
+ >
+ {m.standard_time()}
+ {videoTimeDisplayMode === 'standard' && (
+
+ )}
+
+ setVideoTimeDisplayMode('frames')}
+ className="flex items-center justify-between cursor-pointer text-xs"
+ >
+ {m.frames()}
+ {videoTimeDisplayMode === 'frames' && (
+
+ )}
+
+ setVideoTimeDisplayMode('timecode')}
+ className="flex items-center justify-between cursor-pointer text-xs"
+ >
+ {m.timecode()}
+ {videoTimeDisplayMode === 'timecode' && (
+
+ )}
+
+
+
+
+
+
+ {/* Right Side: Settings (Quality + Speed) & Fullscreen */}
+
+
+
+
+
+
+ {!isAudio && resolutions.length > 0 && (
+ <>
+
+ {m.quality()}
+
+ {resolutions.map((res) => (
+ changeResolution(res)}
+ className={cn(
+ 'flex w-full items-center justify-between text-xs cursor-pointer',
+ state.currentResolution === res.resolution
+ ? 'text-primary font-medium'
+ : 'text-foreground',
+ )}
+ >
+ {res.resolution === 'Original' ? m.original() : res.resolution}
+
+ {res.width}x{res.height}
+
+
+ ))}
+
+ >
+ )}
+
+
+ {m.playback_speed()}
+
+ {[0.5, 1, 1.5, 2].map((rate) => (
+ changePlaybackRate(rate)}
+ className={cn(
+ 'flex items-center justify-between text-xs cursor-pointer',
+ state.playbackRate === rate ? 'text-primary font-medium' : 'text-foreground',
+ )}
+ >
+ {rate}x
+ {state.playbackRate === rate && }
+
+ ))}
+
+
+
+
+
+ {m.loop()}
+
+ {state.isLooping && }
+
+
+
+
+ {/* Fullscreen */}
+
+
+
+
+ )
+}
diff --git a/packages/webui/components/viewers/video/video-viewer.tsx b/packages/webui/components/viewers/video/video-viewer.tsx
index 83165318..a5430aaa 100644
--- a/packages/webui/components/viewers/video/video-viewer.tsx
+++ b/packages/webui/components/viewers/video/video-viewer.tsx
@@ -7,6 +7,8 @@ import type Player from 'video.js/dist/types/player'
import { useFramePlayer } from './use-frame-player'
import { resolveTotalFrames } from './utils'
import { VideoControlBar, type PlayerState, type DisplayTranscode } from './video-control-bar'
+import { MobileVideoControlBar } from './mobile-video-control-bar'
+import { useIsMobile } from '@/ui/hooks/use-mobile'
import DrawingCanvas from '@/ui/components/drawing-canvas'
import { useAnnotationStore } from '@/ui/stores/annotation-store'
import { FileViewerProps, MediaController } from '../types'
@@ -593,14 +595,49 @@ const VideoViewer = React.forwardRef(
}
const toggleFullScreen = () => {
- if (!rootRef.current) return
- if (!document.fullscreenElement) {
- rootRef.current.requestFullscreen()
- setState((prev) => ({ ...prev, isFullScreen: true }))
- } else {
- document.exitFullscreen()
- setState((prev) => ({ ...prev, isFullScreen: false }))
+ const rootEl = rootRef.current
+ const videoEl = videoHtmlEl || videoRef.current
+
+ // 1. Standard W3C Fullscreen API (Desktop Chrome/Firefox/Safari, Android, iPadOS)
+ if (rootEl && typeof rootEl.requestFullscreen === 'function') {
+ if (!document.fullscreenElement) {
+ rootEl.requestFullscreen().catch(() => {})
+ setState((prev) => ({ ...prev, isFullScreen: true }))
+ } else if (document.exitFullscreen) {
+ document.exitFullscreen().catch(() => {})
+ setState((prev) => ({ ...prev, isFullScreen: false }))
+ }
+ return
}
+
+ // 2. iOS WebKit native video fullscreen (iPhone Safari & Chrome)
+ const webkitVideo = videoEl as
+ | (HTMLVideoElement & {
+ webkitEnterFullscreen?: () => void
+ webkitExitFullscreen?: () => void
+ webkitDisplayingFullscreen?: boolean
+ })
+ | null
+
+ if (webkitVideo && typeof webkitVideo.webkitEnterFullscreen === 'function') {
+ if (!webkitVideo.webkitDisplayingFullscreen) {
+ try {
+ webkitVideo.webkitEnterFullscreen()
+ } catch (err) {
+ console.error('Failed to enter iOS fullscreen:', err)
+ }
+ } else if (typeof webkitVideo.webkitExitFullscreen === 'function') {
+ try {
+ webkitVideo.webkitExitFullscreen()
+ } catch (err) {
+ console.error('Failed to exit iOS fullscreen:', err)
+ }
+ }
+ return
+ }
+
+ // 3. Fallback: pseudo-fullscreen
+ setState((prev) => ({ ...prev, isFullScreen: !prev.isFullScreen }))
}
const handleDownload = async (key: string) => {
@@ -626,7 +663,7 @@ const VideoViewer = React.forwardRef(
}
}
- // Listen for fullscreen change events (ESC key)
+ // Listen for fullscreen change events (ESC key, iOS Done button)
useEffect(() => {
const onFsChange = () => {
setState((prev) => ({
@@ -635,12 +672,34 @@ const VideoViewer = React.forwardRef(
}))
}
document.addEventListener('fullscreenchange', onFsChange)
- return () => document.removeEventListener('fullscreenchange', onFsChange)
- }, [])
+
+ // iOS WebKit fullscreen events on
)
},
diff --git a/packages/webui/messages/en.json b/packages/webui/messages/en.json
index 9aca7115..6f73d0c9 100644
--- a/packages/webui/messages/en.json
+++ b/packages/webui/messages/en.json
@@ -1299,5 +1299,18 @@
"no_assets_in_folder": "No assets in this folder",
"linked_assets_count": "{count} assets",
"linked_tasks_count": "{count} tasks",
- "current_project_label": "Current Project"
+ "current_project_label": "Current Project",
+ "all_comments": "All comments",
+ "previous_file": "Previous file",
+ "next_file": "Next file",
+ "switch_version": "Switch version",
+ "more_options": "More options",
+ "change_time_format": "Change time format",
+ "format": "Format",
+ "standard_time": "Standard Time",
+ "frames": "Frames",
+ "timecode": "Timecode",
+ "playback_speed": "Playback Speed",
+ "settings": "Settings",
+ "failed_to_post_comment": "Failed to post comment"
}
diff --git a/packages/webui/messages/zh.json b/packages/webui/messages/zh.json
index b1deffab..50ec9034 100644
--- a/packages/webui/messages/zh.json
+++ b/packages/webui/messages/zh.json
@@ -1299,5 +1299,18 @@
"no_assets_in_folder": "此文件夹中没有资产",
"linked_assets_count": "{count} 个资产",
"linked_tasks_count": "{count} 个任务",
- "current_project_label": "当前项目"
+ "current_project_label": "当前项目",
+ "all_comments": "所有评论",
+ "previous_file": "上一个文件",
+ "next_file": "下一个文件",
+ "switch_version": "切换版本",
+ "more_options": "更多选项",
+ "change_time_format": "更改时间格式",
+ "format": "格式",
+ "standard_time": "标准时间",
+ "frames": "帧数",
+ "timecode": "时间码",
+ "playback_speed": "播放速度",
+ "settings": "设置",
+ "failed_to_post_comment": "发送评论失败"
}
diff --git a/packages/webui/paraglide/messages/_index.d.ts b/packages/webui/paraglide/messages/_index.d.ts
index b2356e5c..5e120ed6 100644
--- a/packages/webui/paraglide/messages/_index.d.ts
+++ b/packages/webui/paraglide/messages/_index.d.ts
@@ -1239,4 +1239,15 @@ export * from "./no_assets_in_folder.js";
export * from "./linked_assets_count.js";
export * from "./linked_tasks_count.js";
export * from "./current_project_label.js";
+export * from "./all_comments.js";
+export * from "./previous_file.js";
+export * from "./next_file.js";
+export * from "./more_options.js";
+export * from "./change_time_format.js";
+export * from "./format.js";
+export * from "./standard_time.js";
+export * from "./frames.js";
+export * from "./timecode.js";
+export * from "./playback_speed.js";
+export * from "./failed_to_post_comment.js";
export type LocalizedString = import("../runtime.js").LocalizedString;
diff --git a/packages/webui/paraglide/messages/_index.js b/packages/webui/paraglide/messages/_index.js
index 3ee30564..ec7309e0 100644
--- a/packages/webui/paraglide/messages/_index.js
+++ b/packages/webui/paraglide/messages/_index.js
@@ -1240,4 +1240,15 @@ export * from './n_assets_selected.js'
export * from './no_assets_in_folder.js'
export * from './linked_assets_count.js'
export * from './linked_tasks_count.js'
-export * from './current_project_label.js'
\ No newline at end of file
+export * from './current_project_label.js'
+export * from './all_comments.js'
+export * from './previous_file.js'
+export * from './next_file.js'
+export * from './more_options.js'
+export * from './change_time_format.js'
+export * from './format.js'
+export * from './standard_time.js'
+export * from './frames.js'
+export * from './timecode.js'
+export * from './playback_speed.js'
+export * from './failed_to_post_comment.js'
\ No newline at end of file
diff --git a/packages/webui/paraglide/messages/all_comments.d.ts b/packages/webui/paraglide/messages/all_comments.d.ts
new file mode 100644
index 00000000..90c90058
--- /dev/null
+++ b/packages/webui/paraglide/messages/all_comments.d.ts
@@ -0,0 +1,16 @@
+/**
+* | output |
+* | --- |
+* | "All comments" |
+*
+* @param {All_CommentsInputs} inputs
+* @param {{ locale?: "en" | "zh" }} options
+* @returns {LocalizedString}
+*/
+export const all_comments: ((inputs?: All_CommentsInputs, options?: {
+ locale?: "en" | "zh";
+}) => LocalizedString) & import("../runtime.js").MessageMetadata
;
+export type LocalizedString = import("../runtime.js").LocalizedString;
+export type All_CommentsInputs = {};
diff --git a/packages/webui/paraglide/messages/all_comments.js b/packages/webui/paraglide/messages/all_comments.js
new file mode 100644
index 00000000..334d12ff
--- /dev/null
+++ b/packages/webui/paraglide/messages/all_comments.js
@@ -0,0 +1,29 @@
+/* eslint-disable */
+import { getLocale, experimentalStaticLocale } from '../runtime.js';
+
+/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
+
+/** @typedef {{}} All_CommentsInputs */
+
+const en_all_comments = /** @type {(inputs: All_CommentsInputs) => LocalizedString} */ () => {
+ return /** @type {LocalizedString} */ (`All comments`)
+};
+
+const zh_all_comments = /** @type {(inputs: All_CommentsInputs) => LocalizedString} */ () => {
+ return /** @type {LocalizedString} */ (`所有评论`)
+};
+
+/**
+* | output |
+* | --- |
+* | "All comments" |
+*
+* @param {All_CommentsInputs} inputs
+* @param {{ locale?: "en" | "zh" }} options
+* @returns {LocalizedString}
+*/
+export const all_comments = /** @type {((inputs?: All_CommentsInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata} */ ((inputs = {}, options = {}) => {
+ const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
+ if (locale === "en") return en_all_comments(inputs)
+ return zh_all_comments(inputs)
+});
\ No newline at end of file
diff --git a/packages/webui/paraglide/messages/change_time_format.d.ts b/packages/webui/paraglide/messages/change_time_format.d.ts
new file mode 100644
index 00000000..8e0410b5
--- /dev/null
+++ b/packages/webui/paraglide/messages/change_time_format.d.ts
@@ -0,0 +1,16 @@
+/**
+* | output |
+* | --- |
+* | "Change time format" |
+*
+* @param {Change_Time_FormatInputs} inputs
+* @param {{ locale?: "en" | "zh" }} options
+* @returns {LocalizedString}
+*/
+export const change_time_format: ((inputs?: Change_Time_FormatInputs, options?: {
+ locale?: "en" | "zh";
+}) => LocalizedString) & import("../runtime.js").MessageMetadata;
+export type LocalizedString = import("../runtime.js").LocalizedString;
+export type Change_Time_FormatInputs = {};
diff --git a/packages/webui/paraglide/messages/change_time_format.js b/packages/webui/paraglide/messages/change_time_format.js
new file mode 100644
index 00000000..b6cd4b72
--- /dev/null
+++ b/packages/webui/paraglide/messages/change_time_format.js
@@ -0,0 +1,29 @@
+/* eslint-disable */
+import { getLocale, experimentalStaticLocale } from '../runtime.js';
+
+/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
+
+/** @typedef {{}} Change_Time_FormatInputs */
+
+const en_change_time_format = /** @type {(inputs: Change_Time_FormatInputs) => LocalizedString} */ () => {
+ return /** @type {LocalizedString} */ (`Change time format`)
+};
+
+const zh_change_time_format = /** @type {(inputs: Change_Time_FormatInputs) => LocalizedString} */ () => {
+ return /** @type {LocalizedString} */ (`更改时间格式`)
+};
+
+/**
+* | output |
+* | --- |
+* | "Change time format" |
+*
+* @param {Change_Time_FormatInputs} inputs
+* @param {{ locale?: "en" | "zh" }} options
+* @returns {LocalizedString}
+*/
+export const change_time_format = /** @type {((inputs?: Change_Time_FormatInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata} */ ((inputs = {}, options = {}) => {
+ const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
+ if (locale === "en") return en_change_time_format(inputs)
+ return zh_change_time_format(inputs)
+});
\ No newline at end of file
diff --git a/packages/webui/paraglide/messages/failed_to_post_comment.d.ts b/packages/webui/paraglide/messages/failed_to_post_comment.d.ts
new file mode 100644
index 00000000..3977d8e0
--- /dev/null
+++ b/packages/webui/paraglide/messages/failed_to_post_comment.d.ts
@@ -0,0 +1,16 @@
+/**
+* | output |
+* | --- |
+* | "Failed to post comment" |
+*
+* @param {Failed_To_Post_CommentInputs} inputs
+* @param {{ locale?: "en" | "zh" }} options
+* @returns {LocalizedString}
+*/
+export const failed_to_post_comment: ((inputs?: Failed_To_Post_CommentInputs, options?: {
+ locale?: "en" | "zh";
+}) => LocalizedString) & import("../runtime.js").MessageMetadata;
+export type LocalizedString = import("../runtime.js").LocalizedString;
+export type Failed_To_Post_CommentInputs = {};
diff --git a/packages/webui/paraglide/messages/failed_to_post_comment.js b/packages/webui/paraglide/messages/failed_to_post_comment.js
new file mode 100644
index 00000000..9f740237
--- /dev/null
+++ b/packages/webui/paraglide/messages/failed_to_post_comment.js
@@ -0,0 +1,29 @@
+/* eslint-disable */
+import { getLocale, experimentalStaticLocale } from '../runtime.js';
+
+/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
+
+/** @typedef {{}} Failed_To_Post_CommentInputs */
+
+const en_failed_to_post_comment = /** @type {(inputs: Failed_To_Post_CommentInputs) => LocalizedString} */ () => {
+ return /** @type {LocalizedString} */ (`Failed to post comment`)
+};
+
+const zh_failed_to_post_comment = /** @type {(inputs: Failed_To_Post_CommentInputs) => LocalizedString} */ () => {
+ return /** @type {LocalizedString} */ (`发送评论失败`)
+};
+
+/**
+* | output |
+* | --- |
+* | "Failed to post comment" |
+*
+* @param {Failed_To_Post_CommentInputs} inputs
+* @param {{ locale?: "en" | "zh" }} options
+* @returns {LocalizedString}
+*/
+export const failed_to_post_comment = /** @type {((inputs?: Failed_To_Post_CommentInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata} */ ((inputs = {}, options = {}) => {
+ const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
+ if (locale === "en") return en_failed_to_post_comment(inputs)
+ return zh_failed_to_post_comment(inputs)
+});
\ No newline at end of file
diff --git a/packages/webui/paraglide/messages/format.d.ts b/packages/webui/paraglide/messages/format.d.ts
new file mode 100644
index 00000000..05382510
--- /dev/null
+++ b/packages/webui/paraglide/messages/format.d.ts
@@ -0,0 +1,16 @@
+/**
+* | output |
+* | --- |
+* | "Format" |
+*
+* @param {FormatInputs} inputs
+* @param {{ locale?: "en" | "zh" }} options
+* @returns {LocalizedString}
+*/
+export const format: ((inputs?: FormatInputs, options?: {
+ locale?: "en" | "zh";
+}) => LocalizedString) & import("../runtime.js").MessageMetadata;
+export type LocalizedString = import("../runtime.js").LocalizedString;
+export type FormatInputs = {};
diff --git a/packages/webui/paraglide/messages/format.js b/packages/webui/paraglide/messages/format.js
new file mode 100644
index 00000000..46b7e0c4
--- /dev/null
+++ b/packages/webui/paraglide/messages/format.js
@@ -0,0 +1,29 @@
+/* eslint-disable */
+import { getLocale, experimentalStaticLocale } from '../runtime.js';
+
+/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
+
+/** @typedef {{}} FormatInputs */
+
+const en_format = /** @type {(inputs: FormatInputs) => LocalizedString} */ () => {
+ return /** @type {LocalizedString} */ (`Format`)
+};
+
+const zh_format = /** @type {(inputs: FormatInputs) => LocalizedString} */ () => {
+ return /** @type {LocalizedString} */ (`格式`)
+};
+
+/**
+* | output |
+* | --- |
+* | "Format" |
+*
+* @param {FormatInputs} inputs
+* @param {{ locale?: "en" | "zh" }} options
+* @returns {LocalizedString}
+*/
+export const format = /** @type {((inputs?: FormatInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata} */ ((inputs = {}, options = {}) => {
+ const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
+ if (locale === "en") return en_format(inputs)
+ return zh_format(inputs)
+});
\ No newline at end of file
diff --git a/packages/webui/paraglide/messages/frames.d.ts b/packages/webui/paraglide/messages/frames.d.ts
new file mode 100644
index 00000000..92233ae4
--- /dev/null
+++ b/packages/webui/paraglide/messages/frames.d.ts
@@ -0,0 +1,16 @@
+/**
+* | output |
+* | --- |
+* | "Frames" |
+*
+* @param {FramesInputs} inputs
+* @param {{ locale?: "en" | "zh" }} options
+* @returns {LocalizedString}
+*/
+export const frames: ((inputs?: FramesInputs, options?: {
+ locale?: "en" | "zh";
+}) => LocalizedString) & import("../runtime.js").MessageMetadata;
+export type LocalizedString = import("../runtime.js").LocalizedString;
+export type FramesInputs = {};
diff --git a/packages/webui/paraglide/messages/frames.js b/packages/webui/paraglide/messages/frames.js
new file mode 100644
index 00000000..50b8c985
--- /dev/null
+++ b/packages/webui/paraglide/messages/frames.js
@@ -0,0 +1,29 @@
+/* eslint-disable */
+import { getLocale, experimentalStaticLocale } from '../runtime.js';
+
+/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
+
+/** @typedef {{}} FramesInputs */
+
+const en_frames = /** @type {(inputs: FramesInputs) => LocalizedString} */ () => {
+ return /** @type {LocalizedString} */ (`Frames`)
+};
+
+const zh_frames = /** @type {(inputs: FramesInputs) => LocalizedString} */ () => {
+ return /** @type {LocalizedString} */ (`帧数`)
+};
+
+/**
+* | output |
+* | --- |
+* | "Frames" |
+*
+* @param {FramesInputs} inputs
+* @param {{ locale?: "en" | "zh" }} options
+* @returns {LocalizedString}
+*/
+export const frames = /** @type {((inputs?: FramesInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata} */ ((inputs = {}, options = {}) => {
+ const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
+ if (locale === "en") return en_frames(inputs)
+ return zh_frames(inputs)
+});
\ No newline at end of file
diff --git a/packages/webui/paraglide/messages/more_options.d.ts b/packages/webui/paraglide/messages/more_options.d.ts
new file mode 100644
index 00000000..e21d4c04
--- /dev/null
+++ b/packages/webui/paraglide/messages/more_options.d.ts
@@ -0,0 +1,16 @@
+/**
+* | output |
+* | --- |
+* | "More options" |
+*
+* @param {More_OptionsInputs} inputs
+* @param {{ locale?: "en" | "zh" }} options
+* @returns {LocalizedString}
+*/
+export const more_options: ((inputs?: More_OptionsInputs, options?: {
+ locale?: "en" | "zh";
+}) => LocalizedString) & import("../runtime.js").MessageMetadata;
+export type LocalizedString = import("../runtime.js").LocalizedString;
+export type More_OptionsInputs = {};
diff --git a/packages/webui/paraglide/messages/more_options.js b/packages/webui/paraglide/messages/more_options.js
new file mode 100644
index 00000000..fe3efab9
--- /dev/null
+++ b/packages/webui/paraglide/messages/more_options.js
@@ -0,0 +1,29 @@
+/* eslint-disable */
+import { getLocale, experimentalStaticLocale } from '../runtime.js';
+
+/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
+
+/** @typedef {{}} More_OptionsInputs */
+
+const en_more_options = /** @type {(inputs: More_OptionsInputs) => LocalizedString} */ () => {
+ return /** @type {LocalizedString} */ (`More options`)
+};
+
+const zh_more_options = /** @type {(inputs: More_OptionsInputs) => LocalizedString} */ () => {
+ return /** @type {LocalizedString} */ (`更多选项`)
+};
+
+/**
+* | output |
+* | --- |
+* | "More options" |
+*
+* @param {More_OptionsInputs} inputs
+* @param {{ locale?: "en" | "zh" }} options
+* @returns {LocalizedString}
+*/
+export const more_options = /** @type {((inputs?: More_OptionsInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata} */ ((inputs = {}, options = {}) => {
+ const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
+ if (locale === "en") return en_more_options(inputs)
+ return zh_more_options(inputs)
+});
\ No newline at end of file
diff --git a/packages/webui/paraglide/messages/next_file.d.ts b/packages/webui/paraglide/messages/next_file.d.ts
new file mode 100644
index 00000000..9fcb7b5c
--- /dev/null
+++ b/packages/webui/paraglide/messages/next_file.d.ts
@@ -0,0 +1,16 @@
+/**
+* | output |
+* | --- |
+* | "Next file" |
+*
+* @param {Next_FileInputs} inputs
+* @param {{ locale?: "en" | "zh" }} options
+* @returns {LocalizedString}
+*/
+export const next_file: ((inputs?: Next_FileInputs, options?: {
+ locale?: "en" | "zh";
+}) => LocalizedString) & import("../runtime.js").MessageMetadata;
+export type LocalizedString = import("../runtime.js").LocalizedString;
+export type Next_FileInputs = {};
diff --git a/packages/webui/paraglide/messages/next_file.js b/packages/webui/paraglide/messages/next_file.js
new file mode 100644
index 00000000..96d9d0a5
--- /dev/null
+++ b/packages/webui/paraglide/messages/next_file.js
@@ -0,0 +1,29 @@
+/* eslint-disable */
+import { getLocale, experimentalStaticLocale } from '../runtime.js';
+
+/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
+
+/** @typedef {{}} Next_FileInputs */
+
+const en_next_file = /** @type {(inputs: Next_FileInputs) => LocalizedString} */ () => {
+ return /** @type {LocalizedString} */ (`Next file`)
+};
+
+const zh_next_file = /** @type {(inputs: Next_FileInputs) => LocalizedString} */ () => {
+ return /** @type {LocalizedString} */ (`下一个文件`)
+};
+
+/**
+* | output |
+* | --- |
+* | "Next file" |
+*
+* @param {Next_FileInputs} inputs
+* @param {{ locale?: "en" | "zh" }} options
+* @returns {LocalizedString}
+*/
+export const next_file = /** @type {((inputs?: Next_FileInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata} */ ((inputs = {}, options = {}) => {
+ const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
+ if (locale === "en") return en_next_file(inputs)
+ return zh_next_file(inputs)
+});
\ No newline at end of file
diff --git a/packages/webui/paraglide/messages/playback_speed.d.ts b/packages/webui/paraglide/messages/playback_speed.d.ts
new file mode 100644
index 00000000..5727709e
--- /dev/null
+++ b/packages/webui/paraglide/messages/playback_speed.d.ts
@@ -0,0 +1,16 @@
+/**
+* | output |
+* | --- |
+* | "Playback Speed" |
+*
+* @param {Playback_SpeedInputs} inputs
+* @param {{ locale?: "en" | "zh" }} options
+* @returns {LocalizedString}
+*/
+export const playback_speed: ((inputs?: Playback_SpeedInputs, options?: {
+ locale?: "en" | "zh";
+}) => LocalizedString) & import("../runtime.js").MessageMetadata;
+export type LocalizedString = import("../runtime.js").LocalizedString;
+export type Playback_SpeedInputs = {};
diff --git a/packages/webui/paraglide/messages/playback_speed.js b/packages/webui/paraglide/messages/playback_speed.js
new file mode 100644
index 00000000..492251dd
--- /dev/null
+++ b/packages/webui/paraglide/messages/playback_speed.js
@@ -0,0 +1,29 @@
+/* eslint-disable */
+import { getLocale, experimentalStaticLocale } from '../runtime.js';
+
+/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
+
+/** @typedef {{}} Playback_SpeedInputs */
+
+const en_playback_speed = /** @type {(inputs: Playback_SpeedInputs) => LocalizedString} */ () => {
+ return /** @type {LocalizedString} */ (`Playback Speed`)
+};
+
+const zh_playback_speed = /** @type {(inputs: Playback_SpeedInputs) => LocalizedString} */ () => {
+ return /** @type {LocalizedString} */ (`播放速度`)
+};
+
+/**
+* | output |
+* | --- |
+* | "Playback Speed" |
+*
+* @param {Playback_SpeedInputs} inputs
+* @param {{ locale?: "en" | "zh" }} options
+* @returns {LocalizedString}
+*/
+export const playback_speed = /** @type {((inputs?: Playback_SpeedInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata} */ ((inputs = {}, options = {}) => {
+ const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
+ if (locale === "en") return en_playback_speed(inputs)
+ return zh_playback_speed(inputs)
+});
\ No newline at end of file
diff --git a/packages/webui/paraglide/messages/previous_file.d.ts b/packages/webui/paraglide/messages/previous_file.d.ts
new file mode 100644
index 00000000..4a99cc52
--- /dev/null
+++ b/packages/webui/paraglide/messages/previous_file.d.ts
@@ -0,0 +1,16 @@
+/**
+* | output |
+* | --- |
+* | "Previous file" |
+*
+* @param {Previous_FileInputs} inputs
+* @param {{ locale?: "en" | "zh" }} options
+* @returns {LocalizedString}
+*/
+export const previous_file: ((inputs?: Previous_FileInputs, options?: {
+ locale?: "en" | "zh";
+}) => LocalizedString) & import("../runtime.js").MessageMetadata;
+export type LocalizedString = import("../runtime.js").LocalizedString;
+export type Previous_FileInputs = {};
diff --git a/packages/webui/paraglide/messages/previous_file.js b/packages/webui/paraglide/messages/previous_file.js
new file mode 100644
index 00000000..9af04c16
--- /dev/null
+++ b/packages/webui/paraglide/messages/previous_file.js
@@ -0,0 +1,29 @@
+/* eslint-disable */
+import { getLocale, experimentalStaticLocale } from '../runtime.js';
+
+/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
+
+/** @typedef {{}} Previous_FileInputs */
+
+const en_previous_file = /** @type {(inputs: Previous_FileInputs) => LocalizedString} */ () => {
+ return /** @type {LocalizedString} */ (`Previous file`)
+};
+
+const zh_previous_file = /** @type {(inputs: Previous_FileInputs) => LocalizedString} */ () => {
+ return /** @type {LocalizedString} */ (`上一个文件`)
+};
+
+/**
+* | output |
+* | --- |
+* | "Previous file" |
+*
+* @param {Previous_FileInputs} inputs
+* @param {{ locale?: "en" | "zh" }} options
+* @returns {LocalizedString}
+*/
+export const previous_file = /** @type {((inputs?: Previous_FileInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata} */ ((inputs = {}, options = {}) => {
+ const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
+ if (locale === "en") return en_previous_file(inputs)
+ return zh_previous_file(inputs)
+});
\ No newline at end of file
diff --git a/packages/webui/paraglide/messages/standard_time.d.ts b/packages/webui/paraglide/messages/standard_time.d.ts
new file mode 100644
index 00000000..c01e9088
--- /dev/null
+++ b/packages/webui/paraglide/messages/standard_time.d.ts
@@ -0,0 +1,16 @@
+/**
+* | output |
+* | --- |
+* | "Standard Time" |
+*
+* @param {Standard_TimeInputs} inputs
+* @param {{ locale?: "en" | "zh" }} options
+* @returns {LocalizedString}
+*/
+export const standard_time: ((inputs?: Standard_TimeInputs, options?: {
+ locale?: "en" | "zh";
+}) => LocalizedString) & import("../runtime.js").MessageMetadata;
+export type LocalizedString = import("../runtime.js").LocalizedString;
+export type Standard_TimeInputs = {};
diff --git a/packages/webui/paraglide/messages/standard_time.js b/packages/webui/paraglide/messages/standard_time.js
new file mode 100644
index 00000000..2ff67567
--- /dev/null
+++ b/packages/webui/paraglide/messages/standard_time.js
@@ -0,0 +1,29 @@
+/* eslint-disable */
+import { getLocale, experimentalStaticLocale } from '../runtime.js';
+
+/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
+
+/** @typedef {{}} Standard_TimeInputs */
+
+const en_standard_time = /** @type {(inputs: Standard_TimeInputs) => LocalizedString} */ () => {
+ return /** @type {LocalizedString} */ (`Standard Time`)
+};
+
+const zh_standard_time = /** @type {(inputs: Standard_TimeInputs) => LocalizedString} */ () => {
+ return /** @type {LocalizedString} */ (`标准时间`)
+};
+
+/**
+* | output |
+* | --- |
+* | "Standard Time" |
+*
+* @param {Standard_TimeInputs} inputs
+* @param {{ locale?: "en" | "zh" }} options
+* @returns {LocalizedString}
+*/
+export const standard_time = /** @type {((inputs?: Standard_TimeInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata} */ ((inputs = {}, options = {}) => {
+ const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
+ if (locale === "en") return en_standard_time(inputs)
+ return zh_standard_time(inputs)
+});
\ No newline at end of file
diff --git a/packages/webui/paraglide/messages/timecode.d.ts b/packages/webui/paraglide/messages/timecode.d.ts
new file mode 100644
index 00000000..52256c12
--- /dev/null
+++ b/packages/webui/paraglide/messages/timecode.d.ts
@@ -0,0 +1,16 @@
+/**
+* | output |
+* | --- |
+* | "Timecode" |
+*
+* @param {TimecodeInputs} inputs
+* @param {{ locale?: "en" | "zh" }} options
+* @returns {LocalizedString}
+*/
+export const timecode: ((inputs?: TimecodeInputs, options?: {
+ locale?: "en" | "zh";
+}) => LocalizedString) & import("../runtime.js").MessageMetadata;
+export type LocalizedString = import("../runtime.js").LocalizedString;
+export type TimecodeInputs = {};
diff --git a/packages/webui/paraglide/messages/timecode.js b/packages/webui/paraglide/messages/timecode.js
new file mode 100644
index 00000000..8b59c263
--- /dev/null
+++ b/packages/webui/paraglide/messages/timecode.js
@@ -0,0 +1,29 @@
+/* eslint-disable */
+import { getLocale, experimentalStaticLocale } from '../runtime.js';
+
+/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
+
+/** @typedef {{}} TimecodeInputs */
+
+const en_timecode = /** @type {(inputs: TimecodeInputs) => LocalizedString} */ () => {
+ return /** @type {LocalizedString} */ (`Timecode`)
+};
+
+const zh_timecode = /** @type {(inputs: TimecodeInputs) => LocalizedString} */ () => {
+ return /** @type {LocalizedString} */ (`时间码`)
+};
+
+/**
+* | output |
+* | --- |
+* | "Timecode" |
+*
+* @param {TimecodeInputs} inputs
+* @param {{ locale?: "en" | "zh" }} options
+* @returns {LocalizedString}
+*/
+export const timecode = /** @type {((inputs?: TimecodeInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata} */ ((inputs = {}, options = {}) => {
+ const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
+ if (locale === "en") return en_timecode(inputs)
+ return zh_timecode(inputs)
+});
\ No newline at end of file
diff --git a/packages/webui/routes/__root.tsx b/packages/webui/routes/__root.tsx
index cde225ee..a0216092 100644
--- a/packages/webui/routes/__root.tsx
+++ b/packages/webui/routes/__root.tsx
@@ -91,7 +91,7 @@ function RootComponent() {
const isDashboardActive = pathname.includes('/dashboard')
return (
-
+
{
ensureTeamIdForProject(projectId)
@@ -190,7 +193,11 @@ function FileViewPage() {
const [isDeleteDialogOpen, setIsDeleteDialogOpen] = useState(false)
const $renameFile = client.api.files[':fileId'].$put
- const { mutate: renameFile, isPending: isRenaming } = useMutation<
+ const {
+ mutate: renameFile,
+ mutateAsync: renameFileAsync,
+ isPending: isRenaming,
+ } = useMutation<
InferResponseType,
Error,
InferRequestType
@@ -212,11 +219,11 @@ function FileViewPage() {
})
const $deleteFiles = client.api.files.$delete
- const { mutate: deleteFiles, isPending: isDeleting } = useMutation<
- void,
- Error,
- InferRequestType
- >({
+ const {
+ mutate: deleteFiles,
+ mutateAsync: deleteFilesAsync,
+ isPending: isDeleting,
+ } = useMutation>({
mutationFn: async (request) => {
const res = await $deleteFiles(request)
if (!res.ok) throw new Error('Failed to delete file')
@@ -397,6 +404,28 @@ function FileViewPage() {
if (batchFiles.some((f) => f.id === activeFileId)) {
found = true
lastCursor = result.pageInfo?.cursor || undefined
+ if (result.pageInfo?.cursor) {
+ try {
+ const nextRes = await client.api.folders[':folderId'].search.$post({
+ param: { folderId: parentFolderId },
+ json: {
+ assetType: 'file',
+ after: result.pageInfo.cursor,
+ first: 200,
+ recursively: false,
+ conditions: [],
+ },
+ })
+ if (nextRes.ok) {
+ const nextResult = (await nextRes.json()) as unknown as AssetInfoPaginatedList
+ const nextBatchFiles = (nextResult.data || []) as AssetInfo[]
+ allFiles.push(...nextBatchFiles)
+ lastCursor = nextResult.pageInfo?.cursor || undefined
+ }
+ } catch {
+ // Ignore prefetch error
+ }
+ }
break
}
if (!result.pageInfo?.cursor || batchFiles.length < 200) {
@@ -529,6 +558,65 @@ function FileViewPage() {
setSelectedCommentId(null)
}
+ if (isMobile && !isCompareMode) {
+ return (
+ {
+ navigate({
+ to: '/projects/$projectId/files/$fileId',
+ params: { projectId, fileId: targetId },
+ })
+ }}
+ onNavigateBack={() => {
+ if (parentFolderId && parentFolderId !== projectInfo?.rootFolder) {
+ navigate({
+ to: '/projects/$projectId/folders/$folderId',
+ params: { projectId, folderId: parentFolderId },
+ })
+ } else {
+ navigate({
+ to: '/projects/$projectId',
+ params: { projectId },
+ })
+ }
+ }}
+ onSelectVersion={(versionId) => {
+ navigate({
+ to: '/projects/$projectId/files/$fileId',
+ params: { projectId, fileId },
+ search: (prev: Record) => ({
+ ...prev,
+ version: versionId,
+ }),
+ })
+ }}
+ onRenameFile={async (newName) => {
+ await renameFileAsync({
+ param: { fileId: activeFileId },
+ json: { name: newName },
+ })
+ }}
+ onDeleteFile={async () => {
+ await deleteFilesAsync({
+ json: { ids: [activeFileId] },
+ })
+ }}
+ onSaveField={handleSaveField}
+ />
+ )
+ }
+
return (