Anki-Android icon indicating copy to clipboard operation
Anki-Android copied to clipboard

(Request) Delete button

Open javiercl2020 opened this issue 3 years ago • 24 comments

Can you please add the delete button during preview? I have around 5000 cards and when I preview them in the browser its frustrating to go back and delete it.

javiercl2020 avatar Feb 09 '22 18:02 javiercl2020

Interesting - I see what you mean. Would it work for you if - when you tap the pencil icon to go to edit the note - there was a delete note option in the edit note menu? That might be possible without too much UI changing

mikehardy avatar Feb 09 '22 19:02 mikehardy

Yes that works

javiercl2020 avatar Feb 09 '22 19:02 javiercl2020

Hi I am new to Anki-Droid and would like to work on this issue( if no one is working on it ). Can anyone please guide me with the steps to add this feature.

Areeb-510 avatar Feb 10 '22 11:02 Areeb-510

Hi there! Unfortunately we do not have a lot of time to offer guidance, so I just want to set the general explanation that you should picture yourself more as an explorer or an adventurer, not so much as a "tell me what to do" person. Get ready to explore :-)

In general you will want to use our Wiki, in particular the development guide. You will want to find another area that has delete note functionality to see how it is done You will want to understand exactly how the existing menu options in that menu work You will want to explore how to add menu items to a layout file in android, find that layout file and try adding a new delete option You will want to make a "dummy" implementation of the handler for your new menu option and make sure it is all hooked up

Now the hard part

You will want to actually delete the note if the user chooses that option, possibly with confirmation After deleting the note you will need to go back to the previewer, but you will need to pass it a return code somehow indicating that the note was deleted, so that it may remove the note from it's selection of notes being previewed, and if you were only previewing one note and deleted it then the Previewer itself will need to return back to the deck list

I think the user interface part will be easy. I think managing the control flow back to previewer where it handles the deletion and maybe returns will be the hard part

Hope this helps

mikehardy avatar Feb 10 '22 13:02 mikehardy

Thanks for the guidance it helps a lot.

Areeb-510 avatar Feb 10 '22 16:02 Areeb-510

@mikehardy Is this issue resolved? Or else can I work on it?

rishavchanda avatar Feb 15 '22 11:02 rishavchanda

@rishavchanda it appears @Areeb-510 is working on this at the moment, so it might be best to find a different issue

mikehardy avatar Feb 15 '22 13:02 mikehardy

@mikehardy ok

rishavchanda avatar Feb 15 '22 14:02 rishavchanda

@Areeb-510 Hi, are you still working on this issue? If not I can give it a try!

WPum avatar Mar 06 '22 14:03 WPum

HI @mikehardy., if no one is working on this issue now, Can i work on it ?

parthn2 avatar Mar 11 '22 05:03 parthn2

@parthn2 The issue hasn't been worked on in a month, and hasn't had any responses. I started work on it because of that, but if you want to work on this specific issue, that's cool with me, otherwise you can also try another issue (there are a couple good firsts open which are easier), all up to you, just let me know :)

viciousAegis avatar Mar 11 '22 07:03 viciousAegis

@viciousAegis please drop a note in the future but I'd say that means you have the issue for the moment

Sorry @parthn2 but hopefully there is another issue in the repo that looks interesting? I think the inventory might be pretty low at the moment unfortunately (a good thing normally? but a bad thing when we have people looking for stuff to do 😆 ). I think there is always kotlin migration to do and there is a document on the wiki about how to do that...

mikehardy avatar Mar 11 '22 11:03 mikehardy

Apologies, I started work and was just coming here to comment, and then I saw the other comment. Honest apologies @parthn2, I'll communicate better in the future.

viciousAegis avatar Mar 11 '22 11:03 viciousAegis

How does this look @mikehardy @javiercl2020?

The implementation is this:

You will want to actually delete the note if the user chooses that option, possibly with confirmation After deleting the note you will need to go back to the previewer, but you will need to pass it a return code somehow indicating that the note was deleted, so that it may remove the note from it's selection of notes being previewed, and if you were only previewing one note and deleted it then the Previewer itself will need to return back to the deck list

Will send in a PR in the morning. Let me know if this looks okay.

https://user-images.githubusercontent.com/86671025/157906813-2abdce09-ccdb-4bd1-9fd8-722b83270b60.mov

viciousAegis avatar Mar 11 '22 16:03 viciousAegis

My reading of this is that it should be from the Preview functionality, not the Edit Note functionality.

It'd be worth keeping this in a branch. I wouldn't massively oppose this functionality in the note editor either, BUT: It discourages people from finding the functionality in the right place (Card Browser)

david-allison avatar Mar 11 '22 16:03 david-allison

@david-allison it works in the Previewer as well, since the pencil icon opens the Edit Note menu only, as Mike mentioned in https://github.com/ankidroid/Anki-Android/issues/10321#issuecomment-1034106789:

Would it work for you if - when you tap the pencil icon to go to edit the note - there was a delete note option in the edit note menu? That might be possible without too much UI changing

If there is something else to be done & I've read it wrong, let me know and I'll make the changes :)

viciousAegis avatar Mar 11 '22 16:03 viciousAegis

@viciousAegis This is the preview for the browser:

Select cards (long press) -> Preview,

This offers a "Card Viewer" approach to Previewing cards, and makes it much easier to transition between viewing cards than the Note Editor

david-allison avatar Mar 11 '22 16:03 david-allison

@david-allison Yep! Got it. Thanks for catching that one early 😅. I'll shelve this in a branch (can create a separate PR for it, if maintainers think it's a good addition), and work on the Previewer now.

viciousAegis avatar Mar 11 '22 16:03 viciousAegis

Would be worth creating a new issue to discuss. I'm on the fence about that one

david-allison avatar Mar 11 '22 17:03 david-allison

Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically

github-actions[bot] avatar May 10 '22 17:05 github-actions[bot]

Very very busy with school work right now, would happily let someone else try their hand at this!

viciousAegis avatar May 12 '22 16:05 viciousAegis

@viciousAegis School takes priority. Will be fantastic to see you back when you have time

david-allison avatar May 12 '22 16:05 david-allison

Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically

github-actions[bot] avatar Jul 15 '22 14:07 github-actions[bot]

Hey, I'd like to work on this issue if it's available!

addy-zero avatar Aug 09 '22 16:08 addy-zero

Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically

github-actions[bot] avatar Oct 26 '22 13:10 github-actions[bot]

I'm still working on this. Been busy with uni / internship work lately.

addy-zero avatar Oct 27 '22 07:10 addy-zero

Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically

github-actions[bot] avatar Dec 26 '22 09:12 github-actions[bot]