Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds HEIC/HEIF upload support: new conversion utility that detects and converts HEIC/HEIF files to JPEG, integrates conversion into multiple upload components, updates accepted file types, tweaks chat message-list padding, and adds Changes
Sequence DiagramsequenceDiagram
actor User
participant FileInput as File Input
participant Detector as HEIC Detector
participant Converter as HEIC→JPEG Converter
participant Uploader as Upload Mutation
participant Server as Server
User->>FileInput: Select / drop file
FileInput->>Detector: Provide File object
Detector-->>Detector: Check MIME type / extension
alt File is HEIC/HEIF
Detector->>Converter: Convert file
Converter->>Converter: Dynamically import heic2any
Converter->>Converter: Convert blob → image/jpeg (0.92)
Converter->>Converter: Create new .jpg File
Converter-->>Uploader: Return converted File
else Not HEIC/HEIF
Detector-->>Uploader: Return original File
end
Uploader->>Server: Upload File
Server-->>Uploader: Return URL
Uploader-->>User: Show uploaded image / update UI
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ 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: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/web/src/features/ecency-images/ecency-images-upload-form.tsx`:
- Line 65: In the ecency-images-upload-form.tsx input element (the accept prop
on the file input in the EcencyImagesUploadForm component), replace the
non-standard token "image/svg" with a valid SVG token such as "image/svg+xml"
and/or include the extension ".svg" (e.g., ".svg,image/svg+xml") to ensure the
file picker recognizes SVGs consistently; update the accept string accordingly
so it contains either or both valid tokens instead of "image/svg".
- Around line 23-25: Replace the non-null assertion on fileExtension by
explicitly guarding it: compute fileExtension (e.g., const fileExtension =
file?.name.split(".").pop()?.toLowerCase()) and change the conditional to first
verify fileExtension is defined before calling includes (for example: if (file
&& fileExtension &&
["png","svg","jpg","jpeg","webp","gif","heic","heif"].includes(fileExtension)) {
files.push(file); }). Update the check around the files.push call (in
ecency-images-upload-form.tsx where fileExtension and files are used) to remove
the "!" and ensure fileExtension is truthy before using it.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 1160c7bc-e162-465d-ae94-7ed87ae4d571
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (7)
apps/web/package.jsonapps/web/public/sw.jsapps/web/src/features/ecency-images/ecency-images-upload-dialog.tsxapps/web/src/features/ecency-images/ecency-images-upload-form.tsxapps/web/src/features/shared/image-upload-button.tsxapps/web/src/utils/convert-heic.tspackage.json
✅ Files skipped from review due to trivial changes (3)
- package.json
- apps/web/package.json
- apps/web/src/utils/convert-heic.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- apps/web/src/features/shared/image-upload-button.tsx
- apps/web/src/features/ecency-images/ecency-images-upload-dialog.tsx
Summary by CodeRabbit
New Features
UI Improvements