Added panel to select image from images panel to fill images or uploa…#1827
Closed
SoloDevAbu wants to merge 1 commit intoonlook-dev:mainfrom
Closed
Added panel to select image from images panel to fill images or uploa…#1827SoloDevAbu wants to merge 1 commit intoonlook-dev:mainfrom
SoloDevAbu wants to merge 1 commit intoonlook-dev:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Caution
Changes requested ❌
Reviewed everything up to 3780e45 in 1 minute and 54 seconds. Click for details.
- Reviewed
160lines of code in2files - Skipped
0files when reviewing. - Skipped posting
6draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. apps/studio/src/routes/editor/EditPanel/StylesTab/single/ColorInput/ImageSelection.tsx:22
- Draft comment:
onOpenChange callback ignores the provided state. Consider checking the open state (e.g., if false then onClose()) to avoid unintended modal closures. - Reason this comment was not posted:
Marked as duplicate.
2. apps/studio/src/routes/editor/EditPanel/StylesTab/single/ColorInput/ImagePicker.tsx:104
- Draft comment:
New image data sets both 'url' and 'base64' to selectedImage.content. Clarify if this duplication is intentional. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
3. apps/studio/src/routes/editor/EditPanel/StylesTab/single/ColorInput/ImagePicker.tsx:146
- Draft comment:
Consider using a React ref for the file input rather than document.getElementById to avoid potential ID collisions. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
4. apps/studio/src/routes/editor/EditPanel/StylesTab/single/ColorInput/ImageSelection.tsx:36
- Draft comment:
Using image.fileName as a key might lead to collisions if filenames aren't unique. Consider using a unique identifier if available. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
5. apps/studio/src/routes/editor/EditPanel/StylesTab/single/ColorInput/ImagePicker.tsx:127
- Draft comment:
Consider reordering helper function declarations (e.g., moving saveImage above handleDrop) to enhance code clarity, even though the current order works due to closures. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
6. apps/studio/src/routes/editor/EditPanel/StylesTab/single/ColorInput/ImageSelection.tsx:17
- Draft comment:
If the list of image assets grows large, consider memoizing the filteredImages (using useMemo) to optimize performance. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
Workflow ID: wflow_Gq87obytDTFKo7JN
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
| ); | ||
|
|
||
| return ( | ||
| <Dialog open={isOpen} onOpenChange={() => onClose()}> |
Contributor
There was a problem hiding this comment.
The onOpenChange handler always calls onClose unconditionally. Consider using the provided open state (e.g. onOpenChange={(open) => !open && onClose()}) for more robust dialog behavior.
Suggested change
| <Dialog open={isOpen} onOpenChange={() => onClose()}> | |
| <Dialog open={isOpen} onOpenChange={(open) => !open && onClose()}> |
Contributor
|
Hello, I am migrating the desktop app to a new repository. This repository will now focus on the web version. This PR has been migrated to the new repository: onlook-dev#6. Sorry for the inconvenience, rest assure your work here will also be adapted for the web version (if it hasn't already). |
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.
Description
Added new modal to show the Images from the Image panel. user can either upload new image or select one from the Images panel and applied in the fill color.
Related Issues
fixes #1550
Type of Change
Testing
Tested by running locally
Screenshots (if applicable)
Screencast.from.2025-05-03.20-51-45.webm
Important
Added image selection modal to
ImagePicker.tsxfor selecting or uploading images as fill color.ImageSelectionModalinImageSelection.tsxfor selecting images from the image panel.ImagePicker.tsxupdated to includeSelectImageButtonto openImageSelectionModal.ImageSelectionModalfilters images based on search input and allows selection.handleImageSelectioninImagePicker.tsxupdates image data and inserts selected image into editor.SelectImageButtonand integrated it into the image picker UI.ImageSelectionModalusesDialog,DialogContent,DialogHeader, andDialogTitlefor modal display.This description was created by
for 3780e45. You can customize this summary. It will automatically update as commits are pushed.