refactor(editing-planner): 拆分 StickerPropsEditor 预览和文字属性(200→130行, -35%) #1144
Reference in New Issue
Block a user
Delete Branch "refactor/sticker-props-editor"
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?
拆分说明
按三阶段模式拆分 StickerPropsEditor 组件:
拆分内容
瘦身效果
向后兼容
sticker/StickerPropsEditor保持不变🚀 预览环境已部署
CI全绿,自动审批通过。
CI全绿,自动审批通过。
【阻塞级判定】
📊 审查概览
🔴 阻塞级问题(必须修复)
无
💡 改进建议(不阻塞合并)
StickerPreview.tsx和TextStickerPropsEditor.tsx的 git 文件模式被设置为100755(可执行)。通常源代码文件应保持默认的100644(不可执行)。建议在提交前重置文件权限(例如使用git update-index --chmod=644 filename)。✅ 良好实践
StickerPropsEditor中复杂的预览逻辑和文本编辑逻辑分别拆解为StickerPreview和TextStickerPropsEditor,符合单一职责原则,显著提升了代码的可读性和可维护性。StickerPreview组件正确使用了sticker.height来设置高度,而旧代码(StickerPropsEditor.tsx删除部分)错误地使用了sticker.width,这次重构顺带修复了预览宽高比错误的逻辑 Bug。TextStickerPropsEditor组件中使用了if (sticker.type !== "text") return null进行类型守卫,确保了后续代码在类型安全的前提下访问text_preset等特有属性。🤖 由 AI 代码审查机器人自动生成 | 2026-07-29 16:59:56 | 模型:
🗑️ 预览环境已清理
PR #1144 已关闭或合并,对应的预览环境已被清理。