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

improvement: add confirmation before deleting item #787

Merged

Conversation

lexafaxine
Copy link
Contributor

PR for #776

For mobile,
added an alert when deleting bookmark

For web,
added an confirmation dialog when deleting bookmark

Proof:
https://drive.google.com/drive/folders/1067NHRKKIoip3vZRfgaJnbxBj1XHf5oc?usp=sharing

@lexafaxine lexafaxine force-pushed the delete-bookmark-confirmation branch from a50cac9 to 3b39327 Compare December 30, 2024 12:30
Copy link
Collaborator

@MohamedBassem MohamedBassem 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've left some small comments and then it'll be good to go!

Comment on lines 101 to 104
<ActionButton
loading={pendingDeletion}
loading={isPendingDelete}
className="size-14 rounded-full bg-background"
variant="none"
onClick={() => {
deleteBookmark({ bookmarkId: bookmark.id });
}}
onClick={() => setDeleteBookmarkDialogOpen(true)}
>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Given that this button no longer itself takes an action, we should switch it to just a normal button instead of ActionButton. That way, you also won't need to propagate the pending state back to this component.

Copy link
Contributor Author

@lexafaxine lexafaxine Dec 31, 2024

Choose a reason for hiding this comment

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

Comment on lines 115 to 119
<DeleteBookmarkConfirmationDialog
bookmark={bookmark}
open={deleteBookmarkDialogOpen}
setOpen={setDeleteBookmarkDialogOpen}
/>
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this probably should be moved out of the dropdown menu. Maybe move it beside the other modals on line 108?

Copy link
Contributor Author

@lexafaxine lexafaxine Dec 31, 2024

Choose a reason for hiding this comment

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

open={open}
setOpen={setOpen}
title={`Delete ${bookmark.title ?? "Bookmark"}?`}
description={`Are you sure you want to delete this bookmark?`}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you add this to the translation files in apps/web/lib/i18n/locales/en.json? So that people can also get a chance to translate it?

Copy link
Contributor Author

@lexafaxine lexafaxine Dec 31, 2024

Choose a reason for hiding this comment

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

@lexafaxine lexafaxine force-pushed the delete-bookmark-confirmation branch from 52924c6 to 571c730 Compare December 31, 2024 05:13
@lexafaxine lexafaxine force-pushed the delete-bookmark-confirmation branch from 571c730 to 5460f44 Compare December 31, 2024 05:16
@MohamedBassem MohamedBassem merged commit f476fca into hoarder-app:main Dec 31, 2024
4 checks passed
@MohamedBassem
Copy link
Collaborator

Thank you and congrats on the first contribution in Hoarder!

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.

2 participants