Compare commits

...

3 Commits

Author SHA1 Message Date
saas-backend-agent 1c1ccfa89b fix(title): 单视频预览传递完整 titleSettings(补全描边/阴影/背景字段)
CI/CD Pipeline / Check push changed paths (pull_request) Has been skipped
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 1s
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 1s
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web 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 Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Web 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 / Frontend Lint (pull_request) Successful in 1m39s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 1m51s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Successful in 1m53s
CI/CD Pipeline / PR Build Web Image (pull_request) Successful in 1m53s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 1m57s
CI/CD Pipeline / Validate - Style (pull_request) Successful in 4m7s
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Successful in 4m19s
AI Code Review / AI Code Review (pull_request) Successful in 6m34s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 5m46s
ACR Cleanup / ACR Image Cleanup (pull_request_target) Successful in 32s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 57s
CI/CD Pipeline / Validate - Security (pull_request) Successful in 12m26s
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 / CI Gate (pull_request) Successful in 2s
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
问题:GeneratePage 中单视频预览(非批量)传给 FrontendPreviewPlayer 的 titleSettings 对象
只包含 title/size/font/color/position/bold/italic/stroke/shadow/posX/posY,缺了 strokeWidth/
strokeColor/shadowOffsetX/Y/shadowBlur/shadowColor/bgEnabled/bgColor/bgPadding/bgRadius/lineHeight/
maxCharsPerLine 等字段。#2018 已修复 FrontendPreviewPlayer 读取真实字段(而非硬编码),
但单预览父层没传这些字段 → 全部走 fallback(strokeWidth=4/黑描边/默认阴影)。
批量预览(CanvasPreviewGrid)在 #2018 已补全字段。

修复:GeneratePage 单预览 titleSettings 也补全所有字段。
2026-09-23 14:46:10 +08:00
saas-backend-agent ad76d25842 chore: 修复 TitleMiniPreview useEffect 依赖项警告
CI/CD Pipeline / Check push changed paths (pull_request) Has been skipped
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 2s
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 2s
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 / Build Staging API 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 Web 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 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 / Frontend Lint (pull_request) Successful in 1m12s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 1m18s
CI/CD Pipeline / PR Build Web Image (pull_request) Successful in 1m12s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 1m24s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Successful in 1m23s
AI Code Review / AI Code Review (pull_request) Successful in 6m28s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 5m42s
ACR Cleanup / ACR Image Cleanup (pull_request_target) Successful in 27s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 1m3s
CI/CD Pipeline / Validate - Security (pull_request) Successful in 10m9s
CI/CD Pipeline / Validate - Style (pull_request) Successful in 18m51s
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Successful in 19m5s
CI/CD Pipeline / Build Production API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Web Image (pull_request) Has been skipped
CI/CD Pipeline / CI Gate (pull_request) Successful in 1s
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Canary Release to Production (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
2026-09-23 14:13:45 +08:00
saas-backend-agent 16e20ff63c fix(title): 预览区标题样式应用真实模板描边/阴影/背景值
CI/CD Pipeline / Check push changed paths (pull_request) Has been skipped
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 2s
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 1s
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 / 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 / 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 / Frontend Lint (pull_request) Failing after 1m6s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 1m12s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Successful in 1m24s
CI/CD Pipeline / PR Build Web Image (pull_request) Successful in 1m26s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 1m52s
CI/CD Pipeline / Canary Release to Production (pull_request) Has been cancelled
CI/CD Pipeline / CI Gate (pull_request) Has been cancelled
CI/CD Pipeline / Build Production API Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Web Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Deploy Production (pull_request) Has been cancelled
CI/CD Pipeline / Production Browser E2E (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Style (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Security (pull_request) Has been cancelled
AI Code Review / AI Code Review (pull_request) Has been cancelled
PR Automation / Auto Merge on CI Green + Approved (pull_request) Has been cancelled
问题:FrontendPreviewPlayer 渲染视频预览标题时,描边宽度/颜色、阴影偏移/模糊/颜色、背景色块都被硬编码(如黑描边2px、固定2px阴影、无背景),选模板后预览文字不显示模板真实样式(例如抖音爆款黄的8px黑描边只显示2px)。

修复:
- FrontendPreviewPlayer 扩展 titleSettings props,接收 strokeWidth/strokeColor/shadowOffsetX/Y/shadowBlur/shadowColor/bgEnabled/bgColor/bgPadding/bgRadius/lineHeight 字段
- 所有描边/阴影/背景值按容器等比缩放后用于 CSS
- CanvasPreviewGrid 传递 titleSettings 时补充上述字段,批量预览同步生效
- 删除不再使用的 titleScale 常量
- 数字人侧 PanelLipsyncPreview 已正确读字段,无需改动
2026-09-23 14:10:42 +08:00
4 changed files with 64 additions and 9 deletions
@@ -580,7 +580,19 @@ const GeneratePage: React.FC = () => {
bold: titleSettings.bold,
italic: titleSettings.italic,
stroke: titleSettings.stroke,
strokeWidth: titleSettings.strokeWidth,
strokeColor: titleSettings.strokeColor,
shadow: titleSettings.shadow,
shadowOffsetX: titleSettings.shadowOffsetX,
shadowOffsetY: titleSettings.shadowOffsetY,
shadowBlur: titleSettings.shadowBlur,
shadowColor: titleSettings.shadowColor,
bgEnabled: titleSettings.bgEnabled,
bgColor: titleSettings.bgColor,
bgPadding: titleSettings.bgPadding,
bgRadius: titleSettings.bgRadius,
lineHeight: titleSettings.lineHeight,
maxCharsPerLine: titleSettings.maxCharsPerLine,
posX: titleSettings.posX,
posY: titleSettings.posY,
}}
@@ -140,7 +140,19 @@ const CanvasPreviewGrid: React.FC<CanvasPreviewGridProps> = ({
bold: titleSettings.bold,
italic: titleSettings.italic,
stroke: titleSettings.stroke,
strokeWidth: titleSettings.strokeWidth,
strokeColor: titleSettings.strokeColor,
shadow: titleSettings.shadow,
shadowOffsetX: titleSettings.shadowOffsetX,
shadowOffsetY: titleSettings.shadowOffsetY,
shadowBlur: titleSettings.shadowBlur,
shadowColor: titleSettings.shadowColor,
bgEnabled: titleSettings.bgEnabled,
bgColor: titleSettings.bgColor,
bgPadding: titleSettings.bgPadding,
bgRadius: titleSettings.bgRadius,
lineHeight: titleSettings.lineHeight,
maxCharsPerLine: titleSettings.maxCharsPerLine,
posX: titleSettings.posX,
posY: titleSettings.posY,
}}
@@ -36,6 +36,18 @@ interface FrontendPreviewPlayerProps {
italic?: boolean
stroke?: boolean
shadow?: boolean
strokeWidth?: number
strokeColor?: string
shadowOffsetX?: number
shadowOffsetY?: number
shadowBlur?: number
shadowColor?: string
bgEnabled?: boolean
bgColor?: string
bgPadding?: number
bgRadius?: number
lineHeight?: number
maxCharsPerLine?: number
posX?: number | null
posY?: number | null
}
@@ -249,10 +261,25 @@ const FrontendPreviewPlayer: React.FC<FrontendPreviewPlayerProps> = ({
const titleSidePct = (TITLE_MARGIN_SIDE / playRes.width) * 100
const titleTopPct = (TITLE_MARGIN_TOP / playRes.height) * 100
const titleBottomPct = (TITLE_MARGIN_BOTTOM / playRes.height) * 100
const titleScale = containerHeight > 0 ? containerHeight / playRes.height : 1
const titleStrokeWidth = Math.max(1, 2 * titleScale)
const titleShadowBlur = 4 * titleScale
const titleShadowOffset = 2 * titleScale
// 标题缩放到容器:字号 px = (settings.size / playRes.height) * containerHeight
// 描边/阴影:读 titleSettings 真实值,按容器比例缩放
const titleStrokeWidth = Math.max(
1,
((titleSettings?.strokeWidth ?? 4) / playRes.height) * containerHeight,
)
const titleStrokeColor = titleSettings?.strokeColor ?? "#000000"
const titleShadowBlur = ((titleSettings?.shadowBlur ?? 4) / playRes.height) * containerHeight
const titleShadowOffsetX =
((titleSettings?.shadowOffsetX ?? 2) / playRes.height) * containerHeight
const titleShadowOffsetY =
((titleSettings?.shadowOffsetY ?? 2) / playRes.height) * containerHeight
const titleShadowColor = titleSettings?.shadowColor ?? "rgba(0,0,0,0.8)"
const titleShadowStr = `${titleShadowOffsetX}px ${titleShadowOffsetY}px ${titleShadowBlur}px ${titleShadowColor}`
// 标题背景色块
const titleBgEnabled = !!titleSettings?.bgEnabled
const titleBgColor = titleSettings?.bgColor ?? "rgba(0,0,0,0.5)"
const titleBgPadding = ((titleSettings?.bgPadding ?? 12) / playRes.height) * containerHeight
const titleBgRadius = ((titleSettings?.bgRadius ?? 8) / playRes.height) * containerHeight
// ── Video 播放器(默认路径,浏览器原生硬件解码) ──
const {
@@ -561,14 +588,18 @@ const FrontendPreviewPlayer: React.FC<FrontendPreviewPlayerProps> = ({
color: titleSettings.color || "#ffffff",
fontWeight: titleSettings.bold ? 700 : 400,
fontStyle: titleSettings.italic ? "italic" : "normal",
lineHeight: 1.05,
lineHeight: titleSettings.lineHeight ?? 1.05,
wordBreak: "break-word",
WebkitTextStroke: titleSettings.stroke
? `${titleStrokeWidth}px #000000`
? `${titleStrokeWidth}px ${titleStrokeColor}`
: undefined,
textShadow: titleSettings.shadow
? `${titleShadowOffset}px ${titleShadowOffset}px ${titleShadowBlur}px rgba(0,0,0,0.8)`
textShadow: titleSettings.shadow ? titleShadowStr : undefined,
background: titleBgEnabled ? titleBgColor : undefined,
padding: titleBgEnabled
? `${titleBgPadding}px ${titleBgPadding * 1.5}px`
: undefined,
borderRadius: titleBgEnabled ? `${titleBgRadius}px` : undefined,
display: titleBgEnabled ? "inline-block" : undefined,
}}
>
{(effectiveTitle || "").split(/[/]/).map((part, i) => (
@@ -190,7 +190,7 @@ const TitleMiniPreview: React.FC<Props> = ({
ctx.shadowBlur = prevShadow.b
ctx.shadowOffsetX = prevShadow.ox
ctx.shadowOffsetY = prevShadow.oy
}, [settings, width, h, text])
}, [settings, width, h, text, transparent, portrait, background])
return (
<canvas