feat(web): 标题样式模板化 + 修复3个爆款预设bug #2014
Reference in New Issue
Block a user
Delete Branch "feat/title-template-system"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
背景
参考「IP智能体设置→字幕设置→字幕模板」交互,把标题样式从固定10个预设升级为模板系统,同时修复3个线上bug。
Bug 修复
useTitleStyleUpdaters.applyPreset把 snake_case 的preset.style(stroke_width/shadow_offset_x/bg_enabled 等)直接 spread 到 camelCase 的TitleSettings,导致细粒度字段实际没写到 state。新增titleStyleConfigToCamel做显式键名转换。buildPresetPreviewSettings归一化到固定56号 + 描边/阴影/背景按比例缩放,canvas 宽度改为 120px。toggleStroke开启时若 strokeWidth<2 自动给默认值4,确保滑块可见可调。模板系统
@/components/title/template-types.tsTitleTemplate(id:sys:<key>/usr:<uuid>、name/description/emoji/isBuiltin/style/createdAt/updatedAt)useTitleTemplates— localStoragexiaoxia.title.templates.v1,内置10个系统预设 + 自定义CRUD(新建/复制/更新/删除/导出JSON/导入JSON),跨 tab 同步截图要点
不涉及
验证
CI全绿,自动审批通过。
CI全绿,自动审批通过。
🚀 预览环境已部署
🗑️ 预览环境已清理
PR #2014 已关闭或合并,对应的预览环境已被清理。