Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable multi deletion on keystroke #6216

Merged

Conversation

jungleBadger
Copy link
Contributor

@jungleBadger jungleBadger commented Apr 14, 2024

Summary

Files modified:

  • invokeai/frontend/web/src/features/gallery/components/CurrentImage/CurrentImageButtons.tsx
  • invokeai/frontend/web/public/locales/en.json
  • invokeai/frontend/web/src/features/deleteImageModal/components/DeleteImageModal.tsx

Explanation

I modified the CurrentImageButtons script to create a variable that stores the current image selection and uses it as a dependency in the handleDelete method.

Demo

demo-multi-delete.mp4

I also modified the DeleteImageModal to include the selection count as part of the modal title.

Related Issues / Discussions

QA Instructions

  1. Select multiple images in the gallery by shift+clicking, similar to the Windows Explorer experience.
  2. Hit the keyboard button delete.

Merge Plan

NA

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • Documentation added / updated (if applicable)

@github-actions github-actions bot added the frontend PRs that change frontend files label Apr 14, 2024
Copy link
Collaborator

@psychedelicious psychedelicious left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR.

I noticed that the delete button shows the single delete text even when multiple images are selected:
image

invokeai/frontend/web/public/locales/en.json Outdated Show resolved Hide resolved
@psychedelicious
Copy link
Collaborator

I noticed that the delete button shows the single delete text even when multiple images are selected:
image

Sorry, what I meant was we should update <DeleteImageButton /> to use the same translation string

@jungleBadger
Copy link
Contributor Author

I noticed that the delete button shows the single delete text even when multiple images are selected:
image

Sorry, what I meant was we should update <DeleteImageButton /> to use the exact translation string

Thanks for clarifying. I implemented the dynamic label on that button.

Multiple images selected

Screenshot 2024-04-14 191926

Single image selected

Screenshot 2024-04-14 191931

Copy link
Collaborator

@psychedelicious psychedelicious left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple tweaks needed still

Copy link
Collaborator

@psychedelicious psychedelicious left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for fixing this. Good user experience enhancement!

@psychedelicious psychedelicious merged commit b3b5b7e into invoke-ai:main Apr 14, 2024
14 checks passed
@jungleBadger jungleBadger deleted the enable-multi-deletion-on-keystroke branch April 14, 2024 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend PRs that change frontend files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants