feat(transcode): add 3D asset support and turntable viewer (#454)

* feat(transcode): add 3D asset support and turntable viewer

* perf(turntable): stream file via Bun.file and increase upload timeout

* feat(turntable): increase upload timeout to 15m to support 5GB uploads

* fix(webui): align 3D model viewer layout and full-width control bar with video viewer

* feat(webui): unify 3D viewer bottom bar and redesign cyclic ruler slider

- Place RulerSlider in single row with playback and zoom controls, centered with max 320px width
- Flank RulerSlider with minus and plus buttons to step angle by 15°
- Redesign RulerSlider with fixed center indicator and moving cyclic track with continuous 360° wrapping
- Render major ticks longer at 60° intervals without numeric text labels on track
- Display floating degree tooltip above center indicator only during dragging

* fix(webui): prevent RulerSlider from collapsing to 0px width in control bar

- Use flex layout with flex-1 on left and right clusters to preserve center cluster width
- Enforce min-w-[140px] and w-full on RulerSlider
- Fix tooltip positioning and remove outer overflow-hidden

* feat(webui): snap RulerSlider track directly to discrete 15° ticks during drag

* fix(webui): prevent ruler snap-back caused by floating point second truncation

- Use Math.round instead of Math.floor in secondToDegree to avoid 0.999996 dropping to previous frame
- Ensure final dragDegree is committed on pointer up

* fix(webui): fix arrow key frame rounding and duplicate event bubbling

- Use Math.round instead of Math.floor for keyboard arrow frame navigation in ModelViewer
- Add e.stopPropagation() to RulerSlider keyboard events to prevent duplicate bubbling to window listener

* feat(webui): redesign RulerSlider with encapsulated step buttons and capsule pill track

* feat(webui): make RulerSlider responsive on mobile and remove bottom bar reset button

* fix(webui): load 3d video directly without poster and invert drag rotation to counterclockwise

* fix(webui): fix 3d asset viewer frame seeking and drag jitter

* feat(transcode): show 3D asset poster preview immediately after render start

* fix(viewer): synchronize 3D turntable playback via frame callback to prevent skipped degrees

* fix(viewer): handle touchpad zoom gestures and prevent page zoom in 3D viewer

* fix(viewer): eliminate 3D model rotation jitter at 345 degrees

* fix(share): watermark 3D asset turntable video on share links

* fix(share): preserve video transcode resolution on watermarked share links

* fix(viewer): download original 3D model file instead of rendered turntable MP4
This commit is contained in:
Yiling-J
2026-10-11 21:32:28 +08:00
committed by GitHub
parent e894457275
commit 43a2eced75
68 changed files with 5548 additions and 59 deletions
+4 -4
View File
@@ -14,7 +14,7 @@ export const assetInfoPaginatedListSchema = z.object({
export type AssetInfoPaginatedList = z.infer<typeof assetInfoPaginatedListSchema>
export const previewInfoSchema = z.object({
proxyType: z.enum(['image', 'video', 'audio', 'pdf']).nullable().optional(),
proxyType: z.enum(['image', 'video', 'audio', 'pdf', '3d']).nullable().optional(),
thumbnailUrl: z.string().optional(),
originalHeight: z.number().optional(),
originalWidth: z.number().optional(),
@@ -76,7 +76,7 @@ export const assetInfoSchema = z.object({
type: z.string(),
targetType: z.string().optional().nullable(),
status: z.string(),
proxyType: z.enum(['image', 'video', 'audio', 'pdf']).nullable().optional(),
proxyType: z.enum(['image', 'video', 'audio', 'pdf', '3d']).nullable().optional(),
latestChildren: z.array(childPreviewSchema).optional(),
preview: previewInfoSchema.nullable().optional(),
createdAt: z.string(),
@@ -143,7 +143,7 @@ export const assetInfoSchema = z.object({
.optional(),
})
.optional(),
proxyType: z.enum(['image', 'video', 'audio', 'pdf']).nullable().optional(),
proxyType: z.enum(['image', 'video', 'audio', 'pdf', '3d']).nullable().optional(),
metadata: mediaMetadataSchema.optional(),
error: z.string().optional(),
})
@@ -233,7 +233,7 @@ export const attachmentInfoSchema = z.object({
id: z.string(),
assetId: z.string(),
url: z.string(),
proxyType: z.enum(['image', 'video', 'audio', 'pdf']).nullable().optional(),
proxyType: z.enum(['image', 'video', 'audio', 'pdf', '3d']).nullable().optional(),
})
export type AttachmentInfo = z.infer<typeof attachmentInfoSchema>
+3 -3
View File
@@ -7,7 +7,7 @@ export const kanbanAttachmentPayloadSchema = z.object({
key: z.string(),
sizeByte: z.number(),
contentType: z.string().nullable().optional(),
proxyType: z.enum(['image', 'video', 'audio', 'pdf']).nullable().optional(),
proxyType: z.enum(['image', 'video', 'audio', 'pdf', '3d']).nullable().optional(),
})
export type KanbanAttachmentPayload = z.infer<typeof kanbanAttachmentPayloadSchema>
@@ -17,7 +17,7 @@ export const kanbanAttachmentInfoSchema = z.object({
sizeByte: z.number(),
contentType: z.string().nullable().optional(),
url: z.string(),
proxyType: z.enum(['image', 'video', 'audio', 'pdf']).nullable().optional(),
proxyType: z.enum(['image', 'video', 'audio', 'pdf', '3d']).nullable().optional(),
})
export type KanbanAttachmentInfo = z.infer<typeof kanbanAttachmentInfoSchema>
@@ -28,7 +28,7 @@ export const postKanbanAttachmentResponseSchema = z.object({
sizeByte: z.number(),
contentType: z.string().nullable().optional(),
uploadUrl: z.string(),
proxyType: z.enum(['image', 'video', 'audio', 'pdf']).nullable().optional(),
proxyType: z.enum(['image', 'video', 'audio', 'pdf', '3d']).nullable().optional(),
})
export type PostKanbanAttachmentResponse = z.infer<typeof postKanbanAttachmentResponseSchema>
+1 -1
View File
@@ -92,7 +92,7 @@ export const kanbanTaskAssetInfoSchema = z.object({
id: z.string(),
name: z.string(),
type: z.string(),
proxyType: z.enum(['image', 'video', 'audio', 'pdf']).nullable().optional(),
proxyType: z.enum(['image', 'video', 'audio', 'pdf', '3d']).nullable().optional(),
thumbnailUrl: z.string().nullable().optional(),
path: z.string(),
creator: kanbanUserInfoSchema.nullable().optional(),
+1 -1
View File
@@ -18,7 +18,7 @@ export type EntityInfo = z.infer<typeof entityInfoSchema>
export const assetPreviewSchema = z.object({
id: z.string().optional(),
proxyType: z.enum(['image', 'video', 'audio', 'pdf']).nullable().optional(),
proxyType: z.enum(['image', 'video', 'audio', 'pdf', '3d']).nullable().optional(),
name: z.string().optional(),
preview: z.string().optional(),
thumbnailUrl: z.string().optional(),
+16
View File
@@ -142,6 +142,21 @@ export const updateTeamSettingsRequestSchema = z.union([
])
export type UpdateTeamSettingsRequest = z.infer<typeof updateTeamSettingsRequestSchema>
export const turntableSettingsResponseSchema = z.object({
url: z.string().optional(),
username: z.string().optional(),
hasPassword: z.boolean(),
isEnvConfigured: z.boolean(),
})
export type TurntableSettingsResponse = z.infer<typeof turntableSettingsResponseSchema>
export const updateTurntableSettingsRequestSchema = z.object({
url: z.string().optional(),
username: z.string().optional(),
password: z.string().optional(),
})
export type UpdateTurntableSettingsRequest = z.infer<typeof updateTurntableSettingsRequestSchema>
export interface TeamAppearanceSettings {
hideAgent?: boolean
}
@@ -155,6 +170,7 @@ export interface TeamSettingsResponse {
hlsEnabled?: boolean
hlsResolutions?: HlsResolutionLadder[]
}
turntable?: TurntableSettingsResponse
appearance?: TeamAppearanceSettings
semanticSearchEnabled?: boolean
[key: string]: unknown