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

feat: support del hotkey for deleting photos in detail view #82

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alexandervantrijffel
Copy link

Support the "del" hotkey in photo detail view so that both browsing the photos and deleting the photos can be done with the keyboard only.

@alexandervantrijffel
Copy link
Author

@til-schneider can you review this PR please?

Copy link
Contributor

@til-schneider til-schneider left a comment

Choose a reason for hiding this comment

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

Very nice, thank you! 😀

I only found some minor cosmetic things.

@@ -75,7 +76,7 @@ export default class PhotoDetailBody extends React.Component<Props, State> {
constructor(props: Props) {
super(props)
bindMany(this, 'onLoadingStateChange', 'onResize', 'onTextureChange', 'onTogglePhotoSelected',
'setPhotoPosition', 'enterCropMode', 'onPhotoWorkEdited', 'onCropDone')
'setPhotoPosition', 'enterCropMode', 'onPhotoWorkEdited', 'onCropDone', "moveToTrash")
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use single ticks, so the code looks uniform

import { msg } from 'common/i18n/i18n'
import { formatNumber } from 'common/util/TextUtil'

export function movePhotosToTrash(photos: PhotoCollection | null | undefined, controller: PhotoActionController) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please don't introduce a new module here. Instead you can add an optional showToast?: boolean parameter to PhotoActionController.movePhotosToTrash and put the toast code to the defaultPhotoActionController.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants