Code test for remove camera opt#1501
Conversation
WalkthroughModified file upload handling in the sidebox component to conditionally apply file restrictions and remove capture attributes based on device type detection on attachment click events. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ❌ 3❌ Failed checks (1 warning, 2 inconclusive)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@webplugin/js/app/mck-sidebox-1.0.js`:
- Around line 13692-13693: The HANDHELD_FILE_UPLOAD_ACCEPT constant is missing
audio formats (.wav and .mp3) so handheld users cannot upload recordings; update
the HANDHELD_FILE_UPLOAD_ACCEPT value to include ".wav" and ".mp3" in the
comma-separated accept string (e.g., append or insert .wav,.mp3 into the
existing string) in the declaration of HANDHELD_FILE_UPLOAD_ACCEPT so
recorder-produced files from webplugin/lib/js/recorder.js can be uploaded.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 7431b09c-93ea-4031-8d82-c60c9bec0a5f
📒 Files selected for processing (1)
webplugin/js/app/mck-sidebox-1.0.js
| var HANDHELD_FILE_UPLOAD_ACCEPT = | ||
| '.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt,.csv,.zip,.rar,.7z,.jpg,.jpeg,.png,.gif,.webp,.mp4,.mov,.m4v,.avi,.mkv,.webm,.3gp'; |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check if audio file types are supported elsewhere in the codebase
rg -n --type=js -C3 'audio|\.mp3|\.wav|\.aac|\.ogg|\.flac' --glob '!node_modules/**' | head -50Repository: Kommunicate-io/Kommunicate-Web-SDK
Length of output: 2915
Add audio formats to the handheld file accept list.
The HANDHELD_FILE_UPLOAD_ACCEPT constant is missing .wav and .mp3 formats. The application includes audio recording functionality (webplugin/lib/js/recorder.js) that produces WAV and MP3 files, but handheld users will be unable to upload them due to these missing formats in the accept list.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@webplugin/js/app/mck-sidebox-1.0.js` around lines 13692 - 13693, The
HANDHELD_FILE_UPLOAD_ACCEPT constant is missing audio formats (.wav and .mp3) so
handheld users cannot upload recordings; update the HANDHELD_FILE_UPLOAD_ACCEPT
value to include ".wav" and ".mp3" in the comma-separated accept string (e.g.,
append or insert .wav,.mp3 into the existing string) in the declaration of
HANDHELD_FILE_UPLOAD_ACCEPT so recorder-produced files from
webplugin/lib/js/recorder.js can be uploaded.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e6bf76725d
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| var HANDHELD_FILE_UPLOAD_ACCEPT = | ||
| '.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt,.csv,.zip,.rar,.7z,.jpg,.jpeg,.png,.gif,.webp,.mp4,.mov,.m4v,.avi,.mkv,.webm,.3gp'; |
There was a problem hiding this comment.
Preserve audio uploads in handheld attachment filter
The new handheld accept whitelist blocks selecting audio files because it only includes document/image/video extensions and omits common audio ones like .mp3, .wav, and .m4a. On mobile, this means users opening the generic attachment button cannot choose existing audio files from storage, even though the widget’s message pipeline/rendering supports audio attachments (see the fileType === 'audio' handling later in this file). This changes functional behavior beyond removing camera capture.
Useful? React with 👍 / 👎.
What do you want to achieve?
PR Checklist
How was the code tested?
What new thing you came across while writing this code?
In case you fixed a bug then please describe the root cause of it?
Screenshot
NOTE: Make sure you're comparing your branch with the correct base branch
Summary by CodeRabbit