fix: resolve TypeScript compile errors in PreviewVideoPanel (#1386)
CI/CD Pipeline / Validate - Type Check (mypy) (push) Successful in 1m51s
CI/CD Pipeline / Validate - Migration (alembic) (push) Successful in 2m37s
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 4m48s
CI/CD Pipeline / Validate - Code Quality (push) Successful in 5m52s
CI/CD Pipeline / Build Staging Web Image (push) Failing after 6m4s
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 6m42s
CI/CD Pipeline / Integration Tests (push) Successful in 1m54s
CI/CD Pipeline / Unit Tests (push) Successful in 11m38s
CI/CD Pipeline / Build Staging API Image (push) Successful in 22m39s
CI/CD Pipeline / Production Browser E2E (push) Failing after 749h13m37s
CI/CD Pipeline / CI Gate (push) Failing after 749h13m38s
CI/CD Pipeline / Build Production Worker Image (push) Failing after 749h13m38s
CI/CD Pipeline / PR Build Worker Image (push) Failing after 749h23m19s
CI/CD Pipeline / PR Build Web Image (push) Failing after 749h23m21s
CI/CD Pipeline / Frontend Lint (push) Failing after 749h25m17s
CI/CD Pipeline / Check if frontend-only change (push) Failing after 749h25m19s
CI/CD Pipeline / Canary Release to Production (push) Failing after 749h2m36s
CI/CD Pipeline / Staging API Integration Tests (push) Failing after 749h2m36s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Failing after 749h2m38s
CI/CD Pipeline / Staging E2E Tests (push) Failing after 749h2m37s
CI/CD Pipeline / ACR Image Cleanup (push) Failing after 749h36m9s
CI/CD Pipeline / Deploy Production (push) Failing after 749h47m10s
CI/CD Pipeline / Build Production API Image (push) Failing after 749h47m11s
CI/CD Pipeline / PR Build API Image (push) Failing after 749h56m56s
CI/CD Pipeline / Build Production Web Image (push) Failing after 749h47m11s
CI/CD Pipeline / Validate - Type Check (mypy) (push) Successful in 1m51s
CI/CD Pipeline / Validate - Migration (alembic) (push) Successful in 2m37s
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 4m48s
CI/CD Pipeline / Validate - Code Quality (push) Successful in 5m52s
CI/CD Pipeline / Build Staging Web Image (push) Failing after 6m4s
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 6m42s
CI/CD Pipeline / Integration Tests (push) Successful in 1m54s
CI/CD Pipeline / Unit Tests (push) Successful in 11m38s
CI/CD Pipeline / Build Staging API Image (push) Successful in 22m39s
CI/CD Pipeline / Production Browser E2E (push) Failing after 749h13m37s
CI/CD Pipeline / CI Gate (push) Failing after 749h13m38s
CI/CD Pipeline / Build Production Worker Image (push) Failing after 749h13m38s
CI/CD Pipeline / PR Build Worker Image (push) Failing after 749h23m19s
CI/CD Pipeline / PR Build Web Image (push) Failing after 749h23m21s
CI/CD Pipeline / Frontend Lint (push) Failing after 749h25m17s
CI/CD Pipeline / Check if frontend-only change (push) Failing after 749h25m19s
CI/CD Pipeline / Canary Release to Production (push) Failing after 749h2m36s
CI/CD Pipeline / Staging API Integration Tests (push) Failing after 749h2m36s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Failing after 749h2m38s
CI/CD Pipeline / Staging E2E Tests (push) Failing after 749h2m37s
CI/CD Pipeline / ACR Image Cleanup (push) Failing after 749h36m9s
CI/CD Pipeline / Deploy Production (push) Failing after 749h47m10s
CI/CD Pipeline / Build Production API Image (push) Failing after 749h47m11s
CI/CD Pipeline / PR Build API Image (push) Failing after 749h56m56s
CI/CD Pipeline / Build Production Web Image (push) Failing after 749h47m11s
Co-authored-by: xiaoxia <dev@xiaoxiajianji.com> Co-committed-by: xiaoxia <dev@xiaoxiajianji.com>
This commit was merged in pull request #1386.
This commit is contained in:
@@ -28,6 +28,8 @@ import { useGenerateFormState } from "./hooks/useGenerateFormState"
|
||||
import { useStepNavigation } from "./hooks/useStepNavigation"
|
||||
import { useGenerateVideo } from "./hooks/useGenerateVideo"
|
||||
import { useStep5Preview } from "./hooks/useStep5Preview"
|
||||
import { useQuery } from "@tanstack/react-query"
|
||||
import { getAssetsByKind } from "@/api/assets"
|
||||
import "./generate.css"
|
||||
|
||||
const GeneratePage: React.FC = () => {
|
||||
@@ -265,7 +267,6 @@ const GeneratePage: React.FC = () => {
|
||||
onRegenerate={step5Preview.regeneratePreview}
|
||||
titleText={titleSettings.title}
|
||||
titleSettings={titleSettings}
|
||||
showTitlePreview={currentStep === 4}
|
||||
sourceVideoUrl={sourceVideoUrl}
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -29,8 +29,6 @@ interface PreviewVideoPanelProps {
|
||||
titleText?: string
|
||||
/** 标题样式设置 */
|
||||
titleSettings?: TitleSettings
|
||||
/** Step4 标题预览模式 */
|
||||
showTitlePreview?: boolean
|
||||
/** 素材视频 URL(用于 Step4 标题预览背景) */
|
||||
sourceVideoUrl?: string
|
||||
}
|
||||
@@ -46,7 +44,6 @@ export const PreviewVideoPanel: React.FC<PreviewVideoPanelProps> = ({
|
||||
onRegenerate,
|
||||
titleText,
|
||||
titleSettings,
|
||||
showTitlePreview,
|
||||
sourceVideoUrl,
|
||||
}) => {
|
||||
const hasPreview = previewStatus === "ready" && previewResult
|
||||
|
||||
@@ -86,6 +86,7 @@ const TitlePreviewCanvas: React.FC<TitlePreviewCanvasProps> = ({
|
||||
.load()
|
||||
.then(() => {
|
||||
if (!cancelled) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- FontFaceSet.add() exists at runtime
|
||||
;(document.fonts as any).add(fontFace)
|
||||
onFontReady()
|
||||
}
|
||||
@@ -108,11 +109,13 @@ const TitlePreviewCanvas: React.FC<TitlePreviewCanvasProps> = ({
|
||||
return () => {
|
||||
cancelled = true
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps -- draw uses refs, stable by design
|
||||
}, [titleSettings.font, titleSettings.size, titleSettings.bold, titleSettings.italic])
|
||||
|
||||
// props 变化时重绘
|
||||
useEffect(() => {
|
||||
requestAnimationFrame(draw)
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps -- draw uses refs, stable by design
|
||||
}, [titleText, titleSettings])
|
||||
|
||||
// ResizeObserver 监听容器尺寸变化
|
||||
@@ -126,6 +129,7 @@ const TitlePreviewCanvas: React.FC<TitlePreviewCanvasProps> = ({
|
||||
observer.observe(container)
|
||||
|
||||
return () => observer.disconnect()
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps -- draw uses refs, stable by design
|
||||
}, [])
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user