Compare commits

...

1 Commits

Author SHA1 Message Date
xiaoxia 830c3c3b18 fix: Step5卡片黑边+缩放 & 配音时长对齐纳入转场时长 (#1756)
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 3m5s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 3m49s
AI Code Review / AI Code Review (pull_request) Successful in 6m36s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 11m1s
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 2s
CI/CD Pipeline / Check push changed paths (pull_request) Has been skipped
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 2s
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / PR Build API Image (pull_request) Has been skipped
CI/CD Pipeline / PR Build Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / PR Build Web Image (pull_request) Successful in 18s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Successful in 1m20s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 1m27s
CI/CD Pipeline / Validate - Style (pull_request) Successful in 2m7s
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Successful in 2m9s
CI/CD Pipeline / Validate - Security (pull_request) Successful in 8m5s
CI/CD Pipeline / Build Production API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
CI/CD Pipeline / Canary Release to Production (pull_request) Has been skipped
CI/CD Pipeline / CI Gate (pull_request) Successful in 3s
ACR Cleanup / ACR Image Cleanup (pull_request_target) Successful in 10s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 31s
修复-前端1: Step5确认生成步骤视频卡片黑边+占比过大
- generate.css: .xx-batch-gen-grid 改为 minmax(160px,180px) 与Step4一致
- generate.css: .xx-batch-gen-card background 改 transparent
- BatchGenerationGrid.tsx: 视频容器 background transparent, padding 0
- BatchGenerationGrid.tsx: video objectFit cover 填满卡片

修复-前端2: 配音时长对齐纳入转场时长
- FrontendPreviewPlayer.tsx: rawClipsDuration 计算包含 transition_duration
- speedFactor = (clips时长+转场时长) / 配音时长
2026-09-07 16:04:41 +08:00
3 changed files with 13 additions and 12 deletions
@@ -73,21 +73,21 @@ const BatchGenerationGrid: React.FC<BatchGenerationGridProps> = ({
display: "flex",
justifyContent: "center",
alignItems: "center",
background: "#000",
background: "transparent",
borderRadius: 8,
padding: 8,
padding: 0,
}}
>
<video
src={video.download_url || video.file_url}
controls
style={{
width: "auto",
maxWidth: "100%",
width: "100%",
maxHeight: "70vh",
aspectRatio: "9 / 16",
objectFit: "cover",
borderRadius: 4,
background: "#000",
background: "transparent",
}}
poster={video.thumbnail_url}
/>
@@ -145,13 +145,13 @@ const FrontendPreviewPlayer: React.FC<FrontendPreviewPlayerProps> = ({
}
}, [voiceAudioUrl])
// 计算 clips 原始总时长
// #1756clips 原始总时长 + 转场时长(后端等比分配配音时包含转场占位)
const rawClipsDuration = useMemo(() => {
if (!serverClips?.length) return 0
return serverClips.reduce((sum, c) => sum + (c.duration || 0), 0)
return serverClips.reduce((sum, c) => sum + (c.duration || 0) + (c.transition_duration || 0), 0)
}, [serverClips])
// #1754:配音时长可用且与 clips 总时长偏差 > 5% 时,按比例调速
// #1754→#1756:配音时长可用且与 clips+转场 总时长偏差 > 5% 时,按比例调速
const speedFactor = useMemo(() => {
if (!voiceDuration || voiceDuration <= 0 || rawClipsDuration <= 0) return 1
const ratio = rawClipsDuration / voiceDuration
+5 -4
View File
@@ -3404,15 +3404,16 @@
============================================================ */
.xx-batch-gen-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 16px;
grid-template-columns: repeat(auto-fill, minmax(160px, 180px));
justify-content: center;
gap: 14px;
}
.xx-batch-gen-card {
border: 1px solid var(--border-primary, #e2e8f0);
border-radius: 12px;
padding: 14px;
background: var(--bg-surface, #fff);
background: transparent;
display: flex;
flex-direction: column;
gap: 10px;
@@ -3480,6 +3481,6 @@
/* ── 响应式:窄屏批量网格回退单列(.xx-canvas-grid 的窄屏限宽见网格定义处 #1741) ── */
@media (max-width: 960px) {
.xx-batch-gen-grid {
grid-template-columns: 1fr;
grid-template-columns: minmax(0, 320px);
}
}