fix: add TextOverlay type and validate textOverlays in isValidRecipe - #1280
fix: add TextOverlay type and validate textOverlays in isValidRecipe#1280sudha09-git wants to merge 3 commits into
Conversation
|
@sudha09-git is attempting to deploy a commit to the magic-peach1's projects Team on Vercel. A member of the Team first needs to authorize it. |
👋 Thanks for your PR, @sudha09-git!Welcome to Reframe — a browser-based video editor built for everyone 🎬 What happens next
Quick checklist
Useful links
Happy coding! 🎉 |
✅ PR Format Check Passed — @sudha09-gitBasic format checks passed. A maintainer will review your code changes. This does not mean the PR is approved — it just means the format is correct. |
08750be to
f2d3527
Compare
201595f to
04b336c
Compare
- Add TextOverlay interface with id, text, x, y, fontSize, color, fontWeight - Add textOverlays field to EditRecipe and DEFAULT_RECIPE (types.ts + constants.ts) - Add isValidTextOverlay helper with full per-element validation - Add buildTextFilter to generate FFmpeg drawtext filters - Wire buildTextFilter into buildArguments filter chain Closes magic-peach#1246
5468b68 to
407d172
Compare
|
Hi @magic-peach |
|
/approve |
|
kindly approve my PR |
|
Hi @sudha09-git — good news and a small ask. Your PR passed review in our backlog cleanup and was queued to merge. We merged 38 PRs today, and yours now conflicts with To land it: git fetch origin
git rebase origin/main
# resolve conflicts
git push --force-with-leasePing me here once it's green and I'll merge it straight away — it's already approved on our side, so it won't go back into the queue. Thanks for your patience with how long this sat 🙏 |
Summary
Closes #1246
Problem
isValidRecipeinsrc/lib/types.tshad notextOverlaysfield at all.Malformed overlays from shared URLs could reach
buildTextFilterand causeopaque FFmpeg failures with no useful error message.
Changes
src/lib/types.tsTextOverlayinterface (id, text, x, y, fontSize, color, fontWeight)textOverlays: TextOverlay[]field toEditRecipetextOverlays: []toDEFAULT_RECIPEisValidTextOverlayhelper with full per-element validation:x,y: finite number in range 0–100fontSize: finite number in range 8–300color: valid CSS hex regex/^#[0-9a-fA-F]{3,8}$/fontWeight: enum of"normal","bold","900"isValidRecipenow returnsfalsefor any invalid overlay elementsrc/lib/constants.tstextOverlays: []toDEFAULT_RECIPEsrc/lib/ffmpeg.tsbuildTextFilterto generate safe FFmpegdrawtextfiltersbuildTextFilterintobuildArgumentsfilter chainTesting
npx tsc --noEmitpasses with zero errors