[codex] Allow PNG custom background uploads#526
[codex] Allow PNG custom background uploads#526Sunwood-ai-labs wants to merge 1 commit intosiddharthvaddem:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (11)
✅ Files skipped from review due to trivial changes (10)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughSettingsPanel now accepts PNG in addition to JPG/JPEG by switching its file-input ChangesBackground Image Type Support
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 👉 Get your free trial and get 200 agent minutes per Slack user (a $50 value). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bc17fd1dab
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const lowerName = fileName.trim().toLowerCase(); | ||
| return [...SUPPORTED_BACKGROUND_IMAGE_EXTENSIONS].some((extension) => | ||
| lowerName.endsWith(extension), |
There was a problem hiding this comment.
Restrict extension fallback to empty MIME types
The new validator accepts files by extension even when the browser reports an explicit unsupported MIME type. For example, a text/plain file named notes.png now returns true, whereas this upload path previously rejected non-image MIME types. This can pass non-image payloads into the wallpaper flow and produce broken uploads; the extension check should only run when type is empty/unknown.
Useful? React with 👍 / 👎.
bc17fd1 to
613ed00
Compare
Summary
Root cause
The custom background upload path only accepted
image/jpeg/image/jpgand advertised.jpg,.jpeg,image/jpegin the file picker. Valid PNG files were rejected before they reached the existing FileReader/data URL flow, even though the rest of the background image pipeline can handle image data URLs.Validation
npx biome check src/components/video-editor/SettingsPanel.tsx src/components/video-editor/backgroundImageUpload.ts src/components/video-editor/backgroundImageUpload.test.ts src/i18n/locales/en/settings.json src/i18n/locales/es/settings.json src/i18n/locales/fr/settings.json src/i18n/locales/ja-JP/settings.json src/i18n/locales/ko-KR/settings.json src/i18n/locales/tr/settings.json src/i18n/locales/zh-CN/settings.json src/i18n/locales/zh-TW/settings.jsongit diff --checknpx vitest run src/components/video-editor/backgroundImageUpload.test.ts src/lib/wallpaper.test.ts src/components/video-editor/projectPersistence.test.tsnpm run build-viteKnown baseline note
npm run i18n:checkcurrently fails onmain-existing extra keys unrelated to this change (tr/launch.jsonaudio keys, severalsettings.jsonzoom/audio keys). This PR only updates the existingimageUpload.jpgOnlycopy across locales.Summary by CodeRabbit
New Features
Tests
Chores