Added functionality to delete images in Pictopy and updated UI #98
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.
Pull Request: Add Image Deletion Functionality for Folders in Pictopy
1. Issue Description #96
Reference: Feat: Add Image Deletion Functionality for Folders in Pictopy #96
2. Frontend Changes
a. Component Updates
File Updated:
pictopy/frontend/src/AITagging/FilterControls.tsx
isVisibleSelectedImage
state tofalse
.isVisibleSelectedImage
isfalse
, renders the<DeleteSelectedImagePage />
component (imported fromsrc/components/FolderPicker/DeleteSelectedImagePage
).New Component:
<DeleteSelectedImagePage />
handleAddSelectedImages
function.b. API Integration
frontend/src/hooks/DeleteImages.ts
DELETE
request to the backend API/images/multiple-images
with the paths of images to delete.c. State Management
selectedImages
state.isVisibleSelectedImage
back totrue
ifisLoading
is not active.3. Backend Changes
a. Endpoint Addition
/images/multiple-images
inbackend/routes/images.py
paths
is a list.os.remove(path)
and updates the database withdelete_image_db(path)
.b. Error Handling
400
: Invalid paths or missing files.404
: File not found on the server.500
: Internal server errors.c. Successful Response
2. UI Updation
frontend/src/components/Navigation/Sidebar/Sidebar.tsx
updated allfillColor
props tofill
becauseSVG elements
usefill
instead offillColor
otherwise in frontend console this error will comeLogo not coming problem fixed : In
frontend/src/components/Navigation/Navbar/Navbar.tsx
converted :to :
Removed Images: Rmoved all unnecessary images from
images
folder4. Final Output :
FINAL-OUTPUT.mp4