Repository navigation
feat: add drag-and-drop logo upload for organizations - #4765
Merged
narcisonunez merged 14 commits intoSep 3, 2026
Merged
Conversation
- Integrated Dropzone component into handle-organization.tsx. - Resolved dialog auto-close bug by decoupling Dialog from DropdownMenu trigger. - Added DOMPurify to sanitize uploaded SVG logos preventing XSS. - Implemented client-side compression via canvas to resize raster images to 256x256 WebP. - Enhanced UX with instant logo preview, masked base64 input strings, and a quick-clear button. - Updated Dropzone to accept classNameContent for local height overrides.
imrja8
marked this pull request as draft
September 1, 2026 19:37
imrja8
marked this pull request as ready for review
September 1, 2026 19:37
imrja8
force-pushed
the
feat/organization-logo-drag-drop
branch
from
September 1, 2026 20:25
898e914 to
6d51c10
Compare
imrja8
marked this pull request as draft
September 1, 2026 20:31
imrja8
marked this pull request as ready for review
September 1, 2026 20:31
imrja8
force-pushed
the
feat/organization-logo-drag-drop
branch
from
September 1, 2026 20:39
efa904c to
0af50cb
Compare
imrja8
marked this pull request as draft
September 1, 2026 20:40
imrja8
marked this pull request as ready for review
September 1, 2026 20:40
imrja8
force-pushed
the
feat/organization-logo-drag-drop
branch
from
September 1, 2026 20:48
0af50cb to
c1af9d4
Compare
imrja8
marked this pull request as draft
September 1, 2026 20:50
imrja8
marked this pull request as ready for review
September 1, 2026 20:50
imrja8
marked this pull request as draft
September 1, 2026 20:54
imrja8
force-pushed
the
feat/organization-logo-drag-drop
branch
from
September 1, 2026 20:55
c1af9d4 to
93b0909
Compare
imrja8
force-pushed
the
feat/organization-logo-drag-drop
branch
from
September 1, 2026 20:57
9b0aa0e to
8806d4e
Compare
imrja8
marked this pull request as ready for review
September 1, 2026 20:59
imrja8
marked this pull request as draft
September 2, 2026 08:58
imrja8
marked this pull request as ready for review
September 2, 2026 12:00
narcisonunez
requested changes
Sep 2, 2026
imrja8
force-pushed
the
feat/organization-logo-drag-drop
branch
from
September 2, 2026 15:19
d08796e to
4877c4f
Compare
Collaborator
|
LGTM! I will complete the approval process later |
narcisonunez
approved these changes
Sep 3, 2026
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this PR about?
This PR introduces a drag-and-drop feature for uploading Organization Profiles/Logos. It brings parity to how icons are managed elsewhere in the application, but with a heavy emphasis on security, performance, and user experience.
User Experience (UX)
Dropzonecomponent into the "Add/Update Organization" dialog for seamless file uploads.logo.png) or a fallback "Uploaded image" text.GlobeIconand instantly swaps to the uploaded image without causing jarring layout shifts.DropdownMenucaused the dialog to prematurely close. Fixed by decoupling theAddOrganizationdialog from the dropdown trigger.Security
.svguploads are parsed throughDOMPurifyto strip arbitrary<script>tags and mitigate XSS risks.TextEncoderbeforebtoaencoding, completely preventing browser crashes when an SVG contains Unicode characters or emojis.useRefinvalidation system. If a user manually edits the URL, clears the input, or closes the dialog while a background upload is processing, the pending background task is instantly aborted and guaranteed not to overwrite the form state.Performance
organizationtable, any raster images (JPG, PNG) uploaded via the dropzone are instantly processed through a background HTML Canvas, resized to a maximum of256x256pixels, and compressed into the highly efficient WebP format. This shrinks typical 2MB user uploads to roughly ~15KB before they ever hit the database.Why and How
Users requested the ability to easily upload organization logos. However, storing raw, massive Base64 images directly into the PostgreSQL
TEXTcolumn creates unnecessary network/DB bottlenecks. UtilizedFileReaderto extract file contents,DOMPurifyfor SVG cleaning, and a nativecanvascontext for downscaling raster images. Furthermore, the globalDropzoneUI component was updated with a newclassNameContentprop to allow targeted height overrides, ensuring this specific dropzone fits the form perfectly without affecting global instances.Verification
Checklist
Before submitting this PR, please make sure that:
canarybranch.Issues related (if applicable)
closes #4727
Screenshots (if applicable)
Custom URL Input Working Perfectly

Drag and Drop Working Perfectly

Greptile Summary
The PR adds drag-and-drop organization logo uploads with SVG sanitization, raster resizing, previews, and lifecycle safeguards.
Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains.
Reviews (6): Last reviewed commit: "Merge branch 'Dokploy:canary' into feat/..." | Re-trigger Greptile