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

Tell the users why card type deletion fails when this would orphan note #16789

Closed
Arthur-Milchior opened this issue Jul 28, 2024 · 10 comments · Fixed by #16840
Closed

Tell the users why card type deletion fails when this would orphan note #16789

Arthur-Milchior opened this issue Jul 28, 2024 · 10 comments · Fixed by #16840
Assignees
Milestone

Comments

@Arthur-Milchior
Copy link
Member

Arthur-Milchior commented Jul 28, 2024

An orphan note is a note that has no card. For example if you have a basic and reverse card, with only the front filled, and you delete the first card type, then the note has no card left.
In AnkiDroid/src/main/java/com/ichi2/anki/CardTemplateEditor.kt, when the user tries to delete a card type, if that would cause orphan, we stop the user from doing it, thanks to deletionWouldOrphanNote
Except that the user does not know why it failed.
We should add a simple message dialog explaining that some note would not have any card anymore.

You can imitate the lines above, where the user gets a message stating that there is a single card type and so it can't be deleted

(I should note that, in anki, we can create orphan. There is no warning. The orphan first disappear from the browser if it's opened, and then reappear if you close and reopen it.
Honestly, I prefer the way ankidroid handle it, but if a maintainer prefer to imitate anki, fine)

@HUN-sp
Copy link

HUN-sp commented Jul 28, 2024

@Arthur-Milchior Would love to work on this issue .

@Arthur-Milchior
Copy link
Member Author

Go for it. Sorry, it seems I can't assign from GitHub Android app

@HUN-sp
Copy link

HUN-sp commented Jul 28, 2024

Like? I am on it sir @Arthur-Milchior

@Sahil-Mandal15
Copy link
Contributor

Sahil-Mandal15 commented Aug 5, 2024

@Arthur-Milchior is this issue still open, can this be assigned to me and can I create a pull request for my fix?

@Arthur-Milchior
Copy link
Member Author

Arthur-Milchior commented Aug 5, 2024

@HUN-sp Can you please give us an update ? David asked you to close one of the PR and rebase and force push the other.
If you've not done in in 48 hours, then I'll assign it to @Sahil-Mandal15. It's supposed to be a short task, if it's not updated in a week already, I think it's okay to consider those PR as abandonned

@Sahil-Mandal15
Copy link
Contributor

@Arthur-Milchior I have my initial fix ready for the issue, I will create a PR when this is assigned to me.

@HUN-sp
Copy link

HUN-sp commented Aug 6, 2024 via email

@Sahil-Mandal15
Copy link
Contributor

Sahil-Mandal15 commented Aug 6, 2024

@Arthur-Milchior I am waiting for the issue to be assigned to me to create the PR or should I proceed with it?

@Arthur-Milchior
Copy link
Member Author

@Sahil-Mandal15 you could have proceeded. Of course, you're now assigned anyway.
Our goal here is just to ensure that we don't waste work, not to follow strict procedural rules. Given that HUN-sp mentioned they would let you work on it, and nobody else wanted it, it was perfectly to start

@devharsh2k4
Copy link

Is it still open?

@github-actions github-actions bot added this to the 2.19 release milestone Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants