Skip to content

贴纸和形状 - #85

Open
devin-ai-integration[bot] wants to merge 4 commits into
devin/1796516442-speed-effectsfrom
devin/1796517396-stickers-shapes
Open

devin-ai-integration[bot] wants to merge 4 commits into
devin/1796516442-speed-effectsfrom
devin/1796517396-stickers-shapes

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Dec 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

叠在 #84 上。左侧菜单新增「贴纸」面板:16 个内置彩色贴纸和 11 种形状(矩形、圆角矩形、圆形、三角形、菱形、六边形、星形、心形、对话框、箭头、直线),形状可选颜色、填充或描边。

贴纸/形状不新增轨道类型,而是复用图片片段:

insertSticker(name, { color, outline })
  shapeSvg / stickerSvg  -> SVG(src/data/stickers.ts)
  rasterizeSvg           -> 512px 宽 PNG File
  importMedia([file])    -> 先进入素材列表(按内容去重)
  insertAsset(record, start, fit) -> ImageTrack,长边 = 画布短边 1/3

因此预览、MP4 导出、剪映草稿、工程保存、关键帧/动画等都直接沿用图片片段逻辑。代价是形状加到时间轴后不能再改颜色,需要重新添加。

  • insertAsset 新增可选 fit 回调,在 addTrack 前调整图片尺寸。
  • MCP 新增 add_sticker({ name, color?, outline?, start?, duration?, x?, y? }),未知名称或非法 CSS 颜色会报错。
  • 测试:src/data/stickers.test.ts(SVG 合法、颜色/描边、转义);e2e/mcp.spec.ts 覆盖 MCP 添加、面板点击添加、MP4 导出和剪映草稿中的 photo 素材。

贴纸面板

Link to Devin session: https://app.devin.ai/sessions/a882af08b80c444280600c6cdc988c2e
Open in Devin Desktop: https://app.devin.ai/desktop/session/a882af08b80c444280600c6cdc988c2e?variant=devin
Requested by: @x007xyz


🟢 Devin fixed all 3 findings · Follow Devin's work

Devin Review

Co-Authored-By: zhangxiang chen <x007xyzabc@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@vercel

vercel Bot commented Dec 6, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
fly-cut Ready Ready Preview Dec 6, 2026 12:56am UTC

devin-ai-integration Bot and others added 2 commits December 6, 2026 00:56
Co-Authored-By: zhangxiang chen <x007xyzabc@gmail.com>
Co-Authored-By: zhangxiang chen <x007xyzabc@gmail.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 3 findings. Devin automatically fixed all 3 findings.

Fixed by Devin (3)
  • Stickers tab opens clip attributes — MobilePanels now renders StickerPanel for the sticker tab.
  • Overlap error leaves a sticker behind — add_sticker applies duration/x/y in the insert fit callback, so the track is chosen for the final length and nothing is left behind.
  • Sticker insertion takes two undos — Same fix: insertion is a single history step; e2e checks one undo removes the sticker.

View findings in Devin Review · Follow Devin's work

Devin Review

This branch was successfully deployed

1 active deployment
Preview — 94ccd98c Deployed Dec 6, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant