Property form: drag-and-drop image upload + paths editor UX#8151
Open
Kelsey-Ethyca wants to merge 4 commits into
Open
Property form: drag-and-drop image upload + paths editor UX#8151Kelsey-Ethyca wants to merge 4 commits into
Kelsey-Ethyca wants to merge 4 commits into
Conversation
Replaces the property logo and action icon path text inputs with a drag-and-drop image picker (Upload.Dragger) that stores selected files as base64 data URLs in the existing string fields. Adds an Add button and blur-commit to PathsEditor so typed paths can no longer be silently dropped on submit. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Users were getting silent failures when entering a path without the leading slash (e.g. "myprop" instead of "/myprop") -- the path saved but the privacy center wouldn't match it. Now we normalize on commit. Also swaps the deprecated Alert `message` prop for `description`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Spaces aren't valid in URL path segments. Live-replace runs of whitespace with a single hyphen so the user gets immediate visual feedback (typing "my path" → "my-path"), and strip stray leading or trailing hyphens on commit so paste of " my path " yields "/my-path". Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Author
Screen.Recording.2026-05-09.at.2.19.42.PM.mov |
Contributor
Author
Screen.Recording.2026-05-09.at.2.47.01.PM.mov |
lucanovera
approved these changes
May 11, 2026
Contributor
lucanovera
left a comment
There was a problem hiding this comment.
All the features worked as expected. These looks like all good UX improvements.
I do want to callout the image upload as base64 must be for demo purposes only.
The images as part of the config file increases the size from a few kbs to multiple megabytes with the images (logo + 1 for each actions), it's not cached in the browser or server, overall not a good practice.
For production, we need to implement the upload to an actual file storage service like s3. This is a very useful feature, so let's create those followup tickets for the production ready approach.
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.
Ticket [no ticket — demo branch]
Description Of Changes
Four UX improvements to the property form, targeting the
demo/aprilbranch:Upload.Dragger-based image picker. Selected files are read as base64 data URLs and stored in the existinglogo_path/icon_pathstring fields, so the privacy center config schema is unchanged. A thumbnail preview and Remove button are shown once a file is set. Files over 2MB or non-image MIME types are rejected client-side./. Paths must start with/to match in the privacy center, but the input let users savemyprop(which silently never matched). The editor now normalizesmyprop→/mypropon commit; an existing leading slash is preserved.my pathbecomesmy-pathin the input), and stray leading/trailing hyphens are stripped on commit so pastinghello worldyields/hello-world.Also fixes two latent antd v6 deprecations along the way (
Space direction→orientation,Alert message→description).Code Changes
clients/admin-ui/src/features/properties/privacy-center-config/ImageUploadField.tsx— reusable drag-and-drop image picker built onUpload.Dragger; reads files as base64 data URLs (max 2MB), shows thumbnail preview, Remove button, and inline error messaging.ActionEditModal.tsx— replace the icon path<Input>with<ImageUploadField />; rename label "Icon path" → "Icon".PrivacyCenterConfigSection.tsx— replace the logo path<Input>with<ImageUploadField>, manually wired tologo_path.PathsEditor.tsx— add Add button; commit on blur; auto-prefix/; live-convert whitespace to-on input; strip leading/trailing-on commit; replace deprecatedSpace directionandAlert messageprops.__tests__/ActionEditModal.test.tsx— mockImageUploadFieldwith a plain text input (same pattern used forSelect) so the existing form-submission assertion still runs in jsdom.Steps to Confirm
http://localhost:3000, navigate to Settings → Properties → (any property).http://localhost:3001/<path>); confirm the uploaded logo renders. (Privacy center pulls from API config when accessed via property path or withFIDES_PRIVACY_CENTER__USE_API_CONFIG=true.)/: type a path without a leading slash (e.g.myprop) and commit — confirm it saves as/myprop. Type one with a slash (/foo) — confirm it stays/foo.my path— confirm the input showsmy-pathas soon as you press space. Pastehello world— confirm it becomes-hello-world-in the input and saves as/hello-worldafter commit.Pre-Merge Checklist
CHANGELOG.mdupdated (seechangelog/8151-image-upload-and-paths-editor-ux.yaml)maindowngrade()migration is correct and works